Closed (fixed)
Project:
Drush
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 Apr 2009 at 20:23 UTC
Updated:
26 Apr 2010 at 22:20 UTC
Jump to comment: Most recent file
Non trivial, it seems. Worth doing though.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | recommended-release-with-type.patch | 2.71 KB | jonhattan |
| #8 | recommended-release-with-security.patch | 2.87 KB | jonhattan |
| #5 | recommended-release-with-type.patch | 2.69 KB | greg.1.anderson |
| #5 | recommended-release-with-security.patch | 2.9 KB | greg.1.anderson |
| #4 | recommended-release.patch | 2.48 KB | greg.1.anderson |
Comments
Comment #1
traviscarden commentedIt would indeed be very helpful to print next to each release whether it's recommended, supported, in development, unsupported, etc. For lack of this information, I oftentimes still have to go to Drupal.org to choose a version to download, which of course is precisely what the command is designed to keep you from having to do.
Comment #2
jonhattanHere's a patch for review. Haven't explored deeply possible edge cases. It also includes 'Installed' status. Sure there's a better word than status for the new table column.
Comment #3
greg.1.anderson commentedThis is awesome, Jonhattan! It does still have a bug, though; using the infamous nodewords example (from #761694: Drush downloading non-recommended release of nodewords), pm-releases does not agree with upc about which version of nodewords is recommended.
So, as you can see, pm-releases agrees with dl, but the algorithm used in these commands does not match what upc does. upc matches what is displayed on the nodewords project page, though, so it is correct and the other two are wrong.
Comment #4
greg.1.anderson commentedI checked out the code at project/release/project_release.module, which is responsible for picking the recommended release to display on a project page. I won't quote the code, but here is the comment that goes with the code:
Not surprisingly, this comment matches the documentation on release numbers -- although I found the later to be a bit ambiguous. The comment in the code is non-ambiguous, and the code that follows even matches the comment.
Here's a first-pass at a patch to fix this. It works fine, but it's a bit gitchy and could use some obvious clean-up (should be done in two passes, rather than use the magic index number '4'). I'm posting it early in case I don't have time to do more on it for a while; I'm out of town until Wednesday night.
Comment #5
greg.1.anderson commentedHere are two patches. Both are good. Pick one.
When I was fixing #4, I realised that I also wanted to see which releases were security updates. In the first version, I added a "type" column that included Security, Feature and Bugfix release information. This is very precise, but also very wordy. Therefore, I made another version that just adds a "Security" tag to the status column. "Features" and "Bugfixes" are not represented. This is less precise, but shows the most important information in a format that is easy to read.
It would also be easy enough to just yank out the security thing if you don't want it; the important part is that this patch makes pm-releases come into alignment with dl and upc.
Comment #6
greg.1.anderson commentedFYI, here's what the 'with-security' patch looks like:
Comment #7
moshe weitzman commentedcode looks good. if it seems to work right on d5/d6/d7, then feel free to commit. x-platform for this stuff has proven tricky. would be great to get some testers but thats not a prerequisite.
Comment #8
jonhattanLittle failure with `drush pm-releases views` in D7. $release['terms'] can be empty and not contain the key 'Release type'.
change:
if ((isset($release['terms']))&&(!empty($release['terms']))) {Comment #9
greg.1.anderson commentedCommitted the "with security" patch without d5/d7 testing. I am pretty confident that the "Recommended" selection will be stable cross-version. There is some chance that the "Security" mark might disappear in other versions. I'll investigate and test this as time permits, and handle separately if any problems are found.
Comment #10
jonhattanGreg: I reopen in case you didn't see #8
Comment #11
greg.1.anderson commentedThanks, Jonhattan. I committed that, but used array_key_exists instead to make sure that the 'Release type' element is there.