I have a drupal 6.16 install at a path resolved by an alias. My alias file looks like this:

<?php
$aliases['store'] = array (
  'root' => '/Users/kencooper/Sites/store/www',
  'uri' => 'store'
);
?>

When I attempt to use pm-update, I get the following:

$ drush @store pm-update
Initialized Drupal 6.16 root directory at /Users/kencooper/Sites/store/www                             [notice]
Initialized Drupal site store at sites/default                                                         [notice]
Refreshing update status information ...
WD update: Attempted to fetch information about all available new releases and updates.                [notice]
Done.
Update information last refreshed: Wed, 07/28/2010 - 12:21

Update status information on all installed and enabled Drupal projects:
 Name                 Installed version  Proposed version  Status           
 Administration menu  6.x-1.5            6.x-1.5           Up to date       
 Drupal core          6.16               6.17              Update available 
 ImageCache           6.x-2.0-beta10     6.x-2.0-beta10    Up to date       
 Lightbox2            6.x-1.9            6.x-1.9           Up to date       
 Skinr                6.x-1.5            6.x-1.5           Up to date       
 Acquia Prosper       6.x-1.0-beta4      6.x-1.0-beta4     Up to date       


Code updates will be made to drupal core.
WARNING:  Updating core will discard any modifications made to Drupal core files, most noteworthy among these are .htaccess and robots.txt.  If you have made any modifications to these files, please back them up before updating so that you can re-create your modifications in the updated version of the file.
Note: Updating core can potentially break your site. It is NOT recommended to update production sites without prior testing.
Do you really want to continue? (y/n): y
Executing: svn info '/Users/kencooper/Sites/store/www/drupal-6.17'                                     [notice]
Calling mkdir(/Users/kencooper/Sites/store/www/backup, 511)
Calling mkdir(/Users/kencooper/Sites/store/www/backup/modules, 511)
Calling mkdir(/Users/kencooper/Sites/store/www/backup/modules/20100728122058, 511)
Calling rename(/Users/kencooper/Sites/store/www/drupal-6.17, /Users/kencooper/Sites/store/www/backup/modules/20100728122058/drupal)
Updating project drupal ...                                                                            [notice]
Executing: cd /Users/kencooper/Sites/store/www ; cvs -z6 -dP                                           [notice]
-d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout -r DRUPAL-6-17 -d drupal drupal
Unable to update drupal from cvs.drupal.org                                                         [error]
Updating project drupal failed. Attempting to roll back to previously installed version.            [error]
An error occurred at function : drush_pm_updatecode                                                 [error]
Rolling back update of Drupal core code ...                                                            [notice]
Executing: svn info 'drupal-6.17'                                                                      [notice]
Calling rename(/Users/kencooper/Sites/store/www/backup/modules/20100728122058/drupal, /Users/kencooper/Sites/store/www/drupal-6.17)
Backups were restored successfully.                                                                 [ok]
An error occurred at function : drush_pm_update                                                     [error]
Command dispatch complete

Examining this in the debugger, I see that the cvs command is successful, and creates a directory called 'drupal' within store/www. The error is registered after line cvs.inc:45 when this directory does not match that of $project['full_project_path'], which is pointing at store/www/drupal-6.17 instead. Looking at the cvs command that is generated, a "-d drupal" argument is created based on the project name, which does not include the version suffix.

CommentFileSizeAuthor
#1 drush_pm_core_cvs_update.patch759 bytesAnonymous (not verified)
#4 drush_pm_core_cvs_update2.patch713 bytesAnonymous (not verified)

Comments

Anonymous’s picture

StatusFileSize
new759 bytes

I had the same problem on my system.

The problem is in the following line:
cvs -z6 -dP -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout -r DRUPAL-6-17 -d drupal drupal

What happens is that drush tries to run the CVS update against a 'drupal' subdirectory of the site root. This should be the root itself:
cvs -z6 -dP -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout -r DRUPAL-6-17 -d drupal

I attached a patch that fixes this. On my machine all is fine now.
I hope it works for you as well.

Gertjan

Aug 23 2010: Please don't use the patch attached. It contains an error. Use the patch in comment #4 instead;

lsiden’s picture

I just applied this patch to my install of 6.x-3.3 (the recommended release) but I still have the same problem.

...
Updating project drupal ...                                                                                 [notice]
Executing: cd /home/lsiden/d5.anything-pages.com/webroot ; cvs -z6 -dP                                      [notice]
-d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -r DRUPAL-5-23 -d drupal
contributions/modules/drupal
Unable to checkout drupal from cvs.drupal.org.                                                           [error]

When I run the CVS checkout standalone from the command line:

$ cvs -z6 -dP -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -r DRUPAL-5-23 -d drupal contributions/modules/drupal
cvs [checkout aborted]: no such tag `DRUPAL-5-23'

The command that works is:

cvs -z6 -dP -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout -r DRUPAL-5-23 -d drupal contributions/modules/drupal

With a little more inspection, it seems that drush_pm_cvs in package_handler/cvs.inc: line 131 is getting called with param $release='modjule' and not 'core'. I tried inserting debug_print_stacktrace() (I had to format it in an editor to read it), The problem is that in the array returned by pm_project_filter, ['project_type'] for drupal is set to 'module' and not 'core'. In pm/update_info/drupal_5.inc I found this curious snippet:

  // update_status for drupal 5 can only process modules, 
  // so we need to add this here for backwards compatibility 
  // or pm_get_project_path() will fail 
  foreach ($data as $project_name => $project_data) { 
    $data[$project_name]['project_type'] = 'module'; 
  } 
Anonymous’s picture

Status: Active » Needs review

I'm surprised to see /cvs/drupal-contrib in your CVS commands. That should be just /cvs/drupal.
The standalone command you used wasn't complete. It should be
cvs -z6 -dP -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout -r DRUPAL-5-23 -d drupal

Please notice I removed the dot at the end of the command. That was a mistake in my patch. I'll post a new patch.

Anonymous’s picture

StatusFileSize
new713 bytes

Please don't use the patch above. There a small mistake in it.
Use the attached patch instead.

Gertjan

greg.1.anderson’s picture

Component: Code » PM (dl, en, up ...)
Status: Needs review » Needs work

Your comment above claims to be modifying the 'checkout' command, but your patch is in the else branch of if ($cvsmethod == 'checkout'), and therefore only seems to affect cvs commands other than 'checkout'.

I tried to execute a command similar to the one you quote above in #3, namely:

cvs -z6 -dP -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout -r
DRUPAL-6-19 -d drupal

However, this gives an error message:

cvs [checkout aborted]: must specify at least one module or directory

I'd say the error message is expected. Seems like you're on to something here, but your patch doesn't quite get us there...

jonhattan’s picture

Status: Needs work » Fixed

It was fixed recently in #826720: "--drupal-project-rename" doesn't seem to work. So I'll close this. Reopen if necessary.

Here's the trace of a test I did to update drupal-6.15 (from a tgz, not cvs) using cvs package handler. I've already done the same test with a drupal-6.15 cvs copy. It does exactly the same. I think it should do a cvs update :/

jonhattan@larry:/var/www/drupal-6.15$ drush --debug upc --package-handler=cvs
Bootstrap to phase 6. [0.13 sec, 3.2 MB]                                                                                           [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.14 sec, 3.2 MB]                                                          [bootstrap]
Initialized Drupal 6.15 root directory at /var/www/drupal-6.15 [0.15 sec, 3.76 MB]                                                    [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.15 sec, 3.77 MB]                                                         [bootstrap]
Initialized Drupal site default at sites/default [0.15 sec, 3.77 MB]                                                                  [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.15 sec, 3.77 MB]                                                [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.16 sec, 3.77 MB]                                                     [bootstrap]
Successfully connected to the Drupal database. [0.16 sec, 3.77 MB]                                                                 [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.16 sec, 4 MB]                                                            [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_login() [0.28 sec, 8.66 MB]                                                        [bootstrap]
Found command: pm-updatecode (commandfile=pm) [0.29 sec, 8.66 MB]                                                                  [bootstrap]
Initializing drush commandfile: drush_make [0.29 sec, 8.66 MB]                                                                     [bootstrap]
Initializing drush commandfile: drush_make_d_o [0.29 sec, 8.67 MB]                                                                 [bootstrap]
Initializing drush commandfile: user [0.29 sec, 8.67 MB]                                                                           [bootstrap]
Including /usr/src/drush-HEAD/commands/pm/updatecode.pm.inc [0.29 sec, 8.67 MB]                                                    [bootstrap]
Refreshing update status information ...
WD update: Attempted to fetch information about all available new releases and updates. [2.52 sec, 9.13 MB]                           [notice]
Done.
Update information last refreshed: Wed, 10/13/2010 - 16:00

Update status information on all installed and enabled Drupal projects:
 Name         Installed version  Proposed version  Status                    
 Drupal core  6.15               6.19              SECURITY UPDATE available 


Code updates will be made to drupal core.
WARNING:  Updating core will discard any modifications made to Drupal core files, most noteworthy among these are .htaccess and robots.txt.  If you have made any modifications to these files, please back them up before updating so that you can re-create your modifications in the updated version of the file.
Note: Updating core can potentially break your site. It is NOT recommended to update production sites without prior testing.
Do you really want to continue? (y/n): y
Executing: svn info '/var/www/drupal-6.15/drupal-6.19' [43.94 sec, 9.14 MB]                                                           [notice]
  svn: «/var/www/drupal-6.15/drupal-6.19» no es una copia de trabajo
Executing: mkdir '/home/jonhattan/.drush-backups/20101013160047' [43.98 sec, 9.16 MB]                                                 [notice]
Executing: mkdir '/home/jonhattan/.drush-backups/20101013160047/modules' [43.99 sec, 9.16 MB]                                         [notice]
Calling rename(/var/www/drupal-6.15/drupal-6.19, /home/jonhattan/.drush-backups/20101013160047/modules/drupal)
Updating project drupal ... [44 sec, 9.16 MB]                                                                                         [notice]
Calling chdir(/var/www/drupal-6.15)
Executing: cvs -z6 -dP -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout -r DRUPAL-6-19 -d drupal-6.19 drupal        [notice]
[44.01 sec, 9.17 MB]
....
....
cvs checkout: Updating drupal-6.19/updates
Calling chdir(/var/www/drupal-6.15)
Updating of drupal was successful. [65.98 sec, 9.27 MB]                                                                               [notice]
Project drupal was updated successfully. Installed version is now 6.19.
Backups were saved into the directory /home/jonhattan/.drush-backups/20101013160047/modules/drupal. [65.98 sec, 9.27 MB]           [ok]
You have pending database updates. Please run `drush updatedb` or visit update.php in your browser. [66.05 sec, 10.11 MB]          [warning]
Command dispatch complete [66.06 sec, 10.09 MB]                                                                                       [notice]
 Timer  Cum (sec)  Count  Avg (msec) 
 page   65.904     1      65903.95   

Peak memory usage was 10.55 MB [66.06 sec, 10.09 MB]  

jonhattan@larry:/var/www/drupal-6.15$ cat CVS/Tag 
NDRUPAL-6-19

jonhattan@larry:/var/www/drupal-6.15$ head /home/jonhattan/.drush-backups/20101013160047/modules/drupal/CHANGELOG.txt 
// $Id: CHANGELOG.txt,v 1.253.2.35 2009/12/16 20:47:10 goba Exp $

Drupal 6.15, 2009-12-16
----------------------

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.