drush self update

mojzis - April 6, 2009 - 21:41
Project:Drush
Version:All-Versions-HEAD
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:Owen Barton
Status:active
Description

I just realised I am running an older version of drush ... since I have drush beside the drupal directory, it doesnt get updated on pm update ... Probably the best workaround would be to remind people to use cvs for installing drush itself in the documentation ?

#1

mojzis - April 6, 2009 - 22:06
Title:drush self update ?» drush self update ? or just use cvs into README ?
Status:active» needs review

I added a note on CVS into the readme file.

AttachmentSize
drush-425670.patch 932 bytes

#2

rsvelko - April 7, 2009 - 04:02

maybe we also need a reminder if a new drush version is available whenever we run drush pm update (or its new analog if it has changed ..)?

and in the README we need more detailed description:
- exact and brief tutorial - with the exact sequence of commands and paths
- the initial checkout and the further update commands

#3

moshe weitzman - April 8, 2009 - 04:02
Title:drush self update ? or just use cvs into README ?» drush self update
Status:needs review» active

we can nearly do self_update today. see `drush pm info drush` and `drush dl drush`. we should still do a dedicated selfupdate command but the pieces are there.

#4

mojzis - April 14, 2009 - 16:12

How about 'drush version' or something, to be able to tell whether any action is needed ? And from which directory does one run `drush dl drush` ? Usually you run drush from the root drupal directory, bud drush is elsewhere ...
thanks :-)

#5

rsvelko - April 15, 2009 - 09:44

Stages of the self-update done via drush itself:
1. info - drush somehow discovers that it needs update (suggestion: hook it on every dr pm update and refresh)
2. remove old drush (thus moving/removing the very .php file that invokes the remove command - how is this supposed to work? ) , backing it up to a backup folder next to the old drush
3. dl new one and move to old drush's place

Self-update via cvs:
0. info - the same as 1. above
1. go to drush dir (a drush command can do that , yes?)
1.5. optionallty do a backup copy
2. do a cvs checkout with a predefined release tag - we're done

( as long as I know linux file systems when you checkout from cvs and thus change the same file that is invoking the change it will continue working and on next invokation it will be the newest version - I suppose it is the same if the file is removed and recreated) RIGHT?

The best scenario is that we do not care about the dl method - be it wget or cvs...

#6

macrocosm - May 5, 2009 - 23:30

Thank you a million times for this tip! I couldn't find the drush cvs install instructions anywhere ... I guess I should have guessed it was the same as any other cvs module install! Dohhh! Still getting used to cvs....

#7

rsvelko - May 6, 2009 - 22:19

"Still getting used to cvs...." - use the 'cvs instructions' tab up on the drush project page. Currently I am using the code there to checkout the new drush code and move it in the place of the old one after diff-ing to see what has changed ...

#8

macrocosm - May 8, 2009 - 10:03

lol ... wow I did not see that there... damn.
I guess its a habit I almost always go directly to google for everything,
which sometimes is akin to the whole needle in the haystack paradigm.

Cheers!
>_<

#9

MichaelCole - May 16, 2009 - 18:00

Hi, Moshe pointed out this issue to me.

I wrote a "drush version" command. See attached version.drush.inc.

It finds all the drush.inc files ( drush_commandfile_list(); ) and does a cvs status on them. I'm new to programming Drupal and Drush and I'm interested in feedback on the code if you have it.

The result is this:

aegir@vps10326:~/drupal-5.x$ drush version
Name                    Version                 File Path
----                    -------                 ---------
simpletest              DRUPAL-6--2-0-RC1       /var/aegir/drush/commands/simpletest/simpletest.drush.inc
core                    DRUPAL-6--2-0-RC1       /var/aegir/drush/commands/core/core.drush.inc
sql                     DRUPAL-6--2-0-RC1       /var/aegir/drush/commands/sql/sql.drush.inc
pm                      DRUPAL-6--2-0-RC1       /var/aegir/drush/commands/pm/pm.drush.inc
provision_mysql         DRUPAL-6--0-2-BETA1     /var/aegir/.drush/provision/db_server/provision_mysql.drush.inc
provision_drupal        DRUPAL-6--0-2-BETA1     /var/aegir/.drush/provision/platform/provision_drupal.drush.inc
provision_dns           DRUPAL-6--0-2-BETA1     /var/aegir/.drush/provision/dns_server/provision_dns.drush.inc
provision_apache        DRUPAL-6--0-2-BETA1     /var/aegir/.drush/provision/web_server/provision_apache.drush.inc
provision               DRUPAL-6--0-2-BETA1     /var/aegir/.drush/provision/provision.drush.inc
version                 Unknown.                /var/aegir/.drush/version.drush.inc
hosting_client          DRUPAL-5--0-2-BETA1     profiles/hostmaster/modules/hosting/client/hosting_client.drush.inc
hosting_alias           DRUPAL-5--0-2-BETA1     profiles/hostmaster/modules/hosting/alias/hosting_alias.drush.inc
hosting_migrate         DRUPAL-5--0-2-BETA1     profiles/hostmaster/modules/hosting/migrate/hosting_migrate.drush.inc
hosting_db_server       DRUPAL-5--0-2-BETA1     profiles/hostmaster/modules/hosting/db_server/hosting_db_server.drush.inc
hosting_site            DRUPAL-5--0-2-BETA1     profiles/hostmaster/modules/hosting/site/hosting_site.drush.inc
hosting_platform        DRUPAL-5--0-2-BETA1     profiles/hostmaster/modules/hosting/platform/hosting_platform.drush.inc
hosting_web_server      DRUPAL-5--0-2-BETA1     profiles/hostmaster/modules/hosting/web_server/hosting_web_server.drush.inc
hosting_package         DRUPAL-5--0-2-BETA1     profiles/hostmaster/modules/hosting/package/hosting_package.drush.inc
hosting                 DRUPAL-5--0-2-BETA1     profiles/hostmaster/modules/hosting/hosting.drush.inc

I'm new to Drush, but was trying to get Aegir installed and ran into some trouble setting up Drush. This was very helpful in figuring out what, was what version, and where.

I hope you find it useful!

Duplicate bug: http://drupal.org/node/462978

AttachmentSize
version.drush_.inc_.txt 3.26 KB

#10

moshe weitzman - May 26, 2009 - 22:38

@michaelcole - perhaps merge this info with statusmodules command.

self-update ought to be its own command.

#11

moshe weitzman - January 2, 2010 - 07:05

one missing piece is that drush does not know its own version. If one uses a tarball from drupal.org, we can discern the release from drush.info but otherwise no. I think we need to add a DRUSH_VERSION constant like drupal core and keep bumping that with every release.

#12

rsvelko - January 11, 2010 - 22:12

@11: totally agree - DO IT

#13

anarcat - January 13, 2010 - 23:44

DRUSH_VERSION patch suggestion in #683942: provide an API to detect the drush version, this here is about updating drush.

#14

moshe weitzman - January 19, 2010 - 04:23
Assigned to:Anonymous» Owen Barton

Owen would likely review any patches that show up here. This is quite related to project update code.

#15

AdrianB - January 19, 2010 - 08:18

Subscribing. (I was thinking about opening an issue about drush self update notification when I found this.)

 
 

Drupal is a registered trademark of Dries Buytaert.