Closed (fixed)
Project:
Drush
Component:
PM (dl, en, up ...)
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Nov 2010 at 00:39 UTC
Updated:
14 Dec 2010 at 12:30 UTC
Jump to comment: Most recent file
Working with a project "og_subgroups", which has a 6.0-0.x-dev and a 6.0-1.x-dev release, the 6.x-0.x releasenotes are displayed even when the 6.0-1.x-dev release is installed. Wrong release notes are shown for pm-updatecode and pm-releasenotes. Correct release notes are shown in pm-releasenotes when version is explicitly provided.
$ drush @genidev pm-updatecode
Update information last refreshed: Mon, 11/22/2010 - 17:19
Update status information on all installed and enabled Drupal projects:
Name Installed Proposed Status
version version
Subgroups for Organic groups 6.x-1.x-dev 6.x-1.x-dev Update
available
Code updates will be made to the following projects:
Subgroups for Organic groups [og_subgroups-6.x-1.x-dev]
------------------------------------------------------------------------------
> RELEASE NOTES FOR 'OG_SUBGROUPS' PROJECT, VERSION 6.x-0.x-dev:
> Last updated: July 11, 2010 - 07:58.
> Note: this is the recommended version.
------------------------------------------------------------------------------
Nightly development snapshot for Drupal 6.
Note: Updated projects can potentially break your site. It is NOT recommended to update production sites without prior testing.
Note: A backup of your package will be stored to backups directory if it is not managed by a supported version control system.
Note: If you have made any modifications to any file that belongs to one of these projects, you will have to migrate those modifications after updating.
Do you really want to continue with the update process? (y/n): n
drush: Aborting.
ga@ubuntu:~$ drush @genidev pm-releases og_subgroups
------- RELEASES FOR 'OG_SUBGROUPS' PROJECT -------
Release Date Status
6.x-1.x-dev 2010-Nov-18 Supported, Development, Installed
6.x-0.x-dev 2010-Jul-11 Supported, Recommended, Development
ga@ubuntu:~$ drush @genidev pm-releasenotes og_subgroups
------------------------------------------------------------------------------
> RELEASE NOTES FOR 'OG_SUBGROUPS' PROJECT, VERSION 6.x-0.x-dev:
> Last updated: July 11, 2010 - 07:58.
> Note: this is the recommended version.
------------------------------------------------------------------------------
Nightly development snapshot for Drupal 6.
ga@ubuntu:~$ drush @genidev pm-releasenotes og_subgroups-6.x-0.x-dev
------------------------------------------------------------------------------
> RELEASE NOTES FOR 'OG_SUBGROUPS' PROJECT, VERSION 6.x-0.x-dev:
> Last updated: July 11, 2010 - 07:58.
> Note: this is the recommended version.
------------------------------------------------------------------------------
Nightly development snapshot for Drupal 6.
ga@ubuntu:~$ drush @genidev pm-releasenotes og_subgroups-6.x-1.x-dev
------------------------------------------------------------------------------
> RELEASE NOTES FOR 'OG_SUBGROUPS' PROJECT, VERSION 6.x-1.x-dev:
> Last updated: November 18, 2010 - 18:46.
> Note: this is the installed version.
------------------------------------------------------------------------------
This is a new branch that stemmed from a direct port of the 5.x-4.0 branch.
This branch will not have a dependency on the Book module. See #337808:
Eliminate dependence on book.module
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | drush_pm_releasenotes_date_based_check.patch | 2.7 KB | luchochs |
| #4 | drush_pm_releasenotes_improve_consistency.patch | 860 bytes | luchochs |
Comments
Comment #1
greg.1.anderson commentedI realize now that in the case above, 6.x-0.x-dev is the recommended release, so this is just another case of #760814: drush pm-update offers to update to an older release than currently installed, and misses the newest available release, but for pm-releasenotes.
Comment #2
jonhattanCode related to this starts in pm.drush.inc:1074. That code needs some clarification.
Comment #3
luchochs commentedIn short, if the project does not have a recommended release with same version_major that the installed one, then only shows the release notes for the recommended one. Not so unwanted, I think.
Update: I write it as if it were a telegram, my apologies. More specific queries on the code would help me to respond faster. Well, a little less slow.
Comment #4
luchochs commentedThis patch may help to keep consistency in the output.
Comment #5
luchochs commentedSorry.
Comment #6
greg.1.anderson commentedI didn't have a chance to test the patch in #4 yet, but I suspect that what is going to be needed is a date-based check as in the issue quoted in #1. Leaving as "needs review" until I confirm my suspicion, but I suspect this needs work.
Comment #7
luchochs commentedSuspicions welcome.
Comment #8
greg.1.anderson commentedStill not quite right. Take for example the situation where the recommended release of captcha is installed:
This is correct. Now let's move forward to the latest dev release on the 2.x line:
etc.
The code is assuming that any "beta" or "stable" release is newer than the installed "dev" release, even though 2.x-dev was released more recently than 2.0-beta1 (since 2.x-dev is more recent than 2.3 stable, and therefore represents development that will eventually lead to a 2.4 release).
The code will need to be adjusted to include date comparison of the releases version when deciding which release notes to display.
Comment #9
luchochs commentedComment #10
luchochs commentedIn a nutshell: date-based check rules.
Comment #11
luchochs commented(#10's complement.)
Simpler, more effective; better.
Comment #12
greg.1.anderson commentedHave not tested yet, but code looks good.
Comment #13
greg.1.anderson commentedWorks great.
Comment #14
jonhattanThat's great. I got lost in the previous $i++ approach.
Commited.