see http://drupal.org/node/87298 for the core support for this feature...
here's an initial version of the packaging script changes. it only deals with existing .info files, so it doesn't attempt to add .info files to 4.7.x and earlier (as proposed in #87298). works great under heavy testing on my laptop (in fact, it helped me uncover a few minor bugs in other places, but i'll deal with those separately). ;)
as a bonus, this version won't always repackage the core tarballs based on branches (the current implementation always repackages core, even if nothing changed).
Comments
Comment #1
merlinofchaos commentedMy feelings on this are as follows, just to make sure this is available:
1) The packaging script should include a version line even if none previously existed in the .info file. Technically the lack of a version line should be considered an error but a very minor one.
2) We should *also* include an api version/drupal version/etc some other line that tells the system what version of Drupal this is for. While this is not needed for 5 because modules prior to 5 don't have a .info file, this will be needed for 6 and it'd be handy to get it in there as a start. Future versions of Drupal can then act on this data as they need. I'd say to get that info in the .info file now to make it easier to deal with in the future.
Comment #2
dww@merlin...
re 1: already implemented in the above patch, and webchick agreed in IRC not to fight this. ;)
re 2: so, something like:
core_api_version = 5or
core_api = 5or
core_compatibility = 5or... ?
also, we use "5.x" everywhere else... perhaps we should stick with that?
Comment #3
merlinofchaos commented2) Yes, we should use what's being used elsewhere. I.e, 5.x seems fine to me. Maybe 'for_drupal_version'. Actually I think we can use 'For drupal version' since spaces are OK in ini file keys.
Comment #4
dwwnew patch that applies cleanly to the end of DRUPAL-4-7--2 branch
(my watchdog cleanup caused the previous to not apply anymore).
also, makes the comment at the top of file_find_youngest() better for explaining what's up with the info_files array...
Comment #5
dwwat merlin's suggestion, add a comment for the autogenerated entry
Comment #6
dwwhere's a sample .info file from my local test site:
Comment #7
dwwunconed had some good feedback in IRC on some of the implementation details.
i'll clean this up based on (most of) his suggestions. ;)
Comment #8
dwwfix_info_file_version() is a lot nicer now. ;)
it's not quite as simple as steven wanted, since i still want to preserve the location in the file where the author put version (in case they have a comment next to it or something), but this is much better. ;)
thanks!
-derek
Comment #9
dwwUnConeD suggested just leaving any references to the existing
versionline alone, and always appending the corrected version at the end of the file. since it comes at the end, the ini parser will always use the most accurate value, but this avoids any of the complications of trying to change what's there. we just open the .info file for appending and add our data.here's a sample of the new signup.info file this is generating on my test site:
i added the extra newline at the front of the stuff i'm appending to protect us from .info files where EOF is at the end of the previous line, not at the start of a new one. if i slurped in the whole contents i could avoid this, but a) i don't care about 1 extra newline in some cases, and b) reading what's there was the complication this approach is trying to avoid anyway. ;)
any more objections, or is this finally RTBC?! ;)
thanks,
-derek
p.s. natrak: now that we're appending, and could potentially have 2 different version lines in the same file, the comment about "Added by drupal.org packaging script..." is definitely a good thing to leave in there.
Comment #10
dwwcommitted my latest patch to DRUPAL-4-7--2 and updated d.o.
Comment #11
moshe weitzman commentedcan the packaging script add something sensible for nightly development snapshots? seems like those get no version info at all. for example, see HEAD og and devel.
Comment #12
dwwthey get exactly as much version info as the release node contains. if you insist on using HEAD for anything, no one (not even the packaging script) knows what version it really is.
for new projects since the system went live, when the maintainer adds a release node pointing to HEAD, they still have to specify version info. in that case, the packaging script will add all the info it has. however, the historical HEAD releases were a huge problem, and sadly, i had to "won't fix" my own issue about *not* auto-creating release nodes during the live deployment on d.o (so we could have forced the maintainers to at least specify a core compatibility when creating a release node for HEAD):
http://drupal.org/node/93502
meanwhile, i have plans for making it easier/better to edit existing HEAD release nodes so that you can provide more version info, and even switch the branch they're pointing to if another branch exists for your project with the same version info which doesn't already have a release node pointing to it:
http://drupal.org/node/89699
enjoy,
-derek
Comment #13
moshe weitzman commentedI don't entirely follow that answer. But I guess the issue you point to will address the fact that the Version Number fieldset is completely disabled for me at http://drupal.org/node/95202/edit. And once I provide good info there, the packaging script will add something?
I'm not complaining, just wondering if we can do better here. After all, this HEAD release node is going to persist forever.
Comment #14
dwwright. the packaging script will only add the info it knows from the release node.
sorry you can't currently edit the HEAD node to provide more info. that's what http://drupal.org/node/89699 is about.
meanwhile, you already *have* 5.x releases for OG and Devel. so who cares about the HEAD release? no one should be using that, anyway... one of the many benefits of the new system is there's *no* reason anyone should ever have to rely on the evil, moving target, ambiguous "HEAD" for anything anymore.
HEAD is for the module maintainers to prepare the next release series, nothing more. if the next release series is new features for older core, when you're ready for the public to start using it, you make a new branch and generate releases off of that. personally, if it wasn't for the existing issues in the queue, there wouldn't be any HEAD release nodes at all. i would have been happy to completely prevent people from creating new release nodes pointing to HEAD, but i would have been lynched for that. ;) oh well, i can't have *everything* my way... ;)
-derek
Comment #15
(not verified) commented