Bug 874905 (php-drush-drush)

Summary: Review Request: php-drush-drush - Command line shell and Unix scripting interface for Drupal
Product: [Fedora] Fedora Reporter: Shawn Iwinski <shawn>
Component: Package ReviewAssignee: Peter Borsa <peter.borsa>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: ansilva, fedora, notting, package-review, peter.borsa
Target Milestone: ---Flags: peter.borsa: fedora-review+
gwync: fedora-cvs+
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-04-17 00:26:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 874904    
Bug Blocks:    

Description Shawn Iwinski 2012-11-09 03:14:36 UTC
Spec URL: http://siwinski.fedorapeople.org/rpmbuild/SPECS/php-drush-drush.spec

SRPM URL: http://siwinski.fedorapeople.org/rpmbuild/SRPMS/php-drush-drush-5.7.0-1.fc17.src.rpm

Description:
Drush is a command line shell and Unix scripting interface for Drupal.  If
you are unfamiliar with shell scripting, reviewing the documentation for your
shell (e.g. man bash) or reading an online tutorial (e.g. search for "bash
tutorial") will help you get the most out of Drush.

Drush core ships with lots of useful commands for interacting with code like
modules/themes/profiles. Similarly, it runs update.php, executes sql queries
and DB migrations, and misc utilities like run cron or clear cache.

Works with Drupal 6, Drupal 7, and usually Drupal 8.


Fedora Account System Username: siwinski

Comment 1 Shawn Iwinski 2012-11-09 03:24:05 UTC
NOTE: This is a replacement package for "drupal6-drush" (http://pkgs.fedoraproject.org/cgit/drupal6-drush.git/) because "drupal6-drush" was only designed (and named) for Drupal version 6 while Drush itself can be used for multiple versions of Drupal.  The owner of the original "drupal6-drush" package (Anderson Silva <ansilva>) was contacted before submitting this package and agrees that this pkg should be its' successor.  This package also uses the upstream preferred PEAR install method and the latest stable version of Drush.

Comment 2 Anderson Silva 2012-11-13 16:15:21 UTC
Hey Shawn,

I am going to be a bit lazy here, but do you have an el6 version of this RPM? I would like to try to test replacing the current drupal6-drush package with your on a working system, and see how it goes... If not, no sweat, I will build it later this week.

AS

Comment 3 Shawn Iwinski 2012-11-13 20:15:30 UTC
(In reply to comment #2)
> Hey Shawn,
> 
> I am going to be a bit lazy here, but do you have an el6 version of this
> RPM? I would like to try to test replacing the current drupal6-drush package
> with your on a working system, and see how it goes... If not, no sweat, I
> will build it later this week.
> 
> AS

Sure, no problem...

SRPM: http://siwinski.fedorapeople.org/rpmbuild/SRPMS/php-drush-drush-5.7.0-1.el6_3.src.rpm

RPM: http://siwinski.fedorapeople.org/rpmbuild/RPMS/noarch/php-drush-drush-5.7.0-1.el6_3.noarch.rpm

Comment 4 Anderson Silva 2012-11-21 17:32:20 UTC
Output of when I ran on rhel 6, as a yum localinstall:

[root@ip-10-203-7-154 ~]# yum localimstall php-drush-drush-5.7.0-1.el6_3.noarch.rpm 
Loaded plugins: amazon-id, priorities, rhui-lb, security
No such command: localimstall. Please use /usr/bin/yum --help
[root@ip-10-203-7-154 ~]# yum localinstall php-drush-drush-5.7.0-1.el6_3.noarch.rpm 
Loaded plugins: amazon-id, priorities, rhui-lb, security
Setting up Local Package Process
Examining php-drush-drush-5.7.0-1.el6_3.noarch.rpm: php-drush-drush-5.7.0-1.el6_3.noarch
Marking php-drush-drush-5.7.0-1.el6_3.noarch.rpm to be installed
Zend                                                                                                                                                                      | 2.6 kB     00:00     
Zend_noarch                                                                                                                                                               | 2.6 kB     00:00     
devenv                                                                                                                                                                    | 3.1 kB     00:00     
epel                                                                                                                                                                      | 4.3 kB     00:00     
passenger                                                                                                                                                                 |  951 B     00:00     
qpid                                                                                                                                                                      | 2.6 kB     00:00     
rhui-us-east-1-client-config-server-6                                                                                                                                     | 2.6 kB     00:00     
rhui-us-east-1-client-config-server-6-jbeap6                                                                                                                              | 2.3 kB     00:00     
rhui-us-east-1-client-config-server-6-jbews1                                                                                                                              | 2.3 kB     00:00     
rhui-us-east-1-jbeap-6-rhui-rhel-6-rpms                                                                                                                                   | 3.9 kB     00:00     
rhui-us-east-1-jbeap-6-rhui-rhel-6-srpms                                                                                                                                  | 2.6 kB     00:00     
rhui-us-east-1-rhel-server-6-jbews1                                                                                                                                       | 3.7 kB     00:00     
rhui-us-east-1-rhel-server-6-jbews1-srpms                                                                                                                                 | 2.6 kB     00:00     
rhui-us-east-1-rhel-server-releases                                                                                                                                       | 3.7 kB     00:00     
rhui-us-east-1-rhel-server-releases-i386                                                                                                                                  | 3.7 kB     00:00     
rhui-us-east-1-rhel-server-releases-i386/primary_db                                                                                                                       |  15 MB     00:00     
rhui-us-east-1-rhel-server-releases-optional                                                                                                                              | 3.5 kB     00:00     
rhui-us-east-1-rhel-server-releases-optional-i386                                                                                                                         | 3.5 kB     00:00     
rhui-us-east-1-rhel-server-releases-optional-i386/primary_db                                                                                                              | 1.7 MB     00:00     
Resolving Dependencies
--> Running transaction check
---> Package drupal6-drush.noarch 0:4.1-3.el6_2 will be obsoleted
---> Package php-drush-drush.noarch 0:5.7.0-1.el6_3 will be obsoleting
--> Processing Dependency: php-channel(pear.drush.org) for package: php-drush-drush-5.7.0-1.el6_3.noarch
--> Processing Dependency: php-pear(Console_Table) for package: php-drush-drush-5.7.0-1.el6_3.noarch
--> Running transaction check
---> Package php-drush-drush.noarch 0:5.7.0-1.el6_3 will be obsoleting
--> Processing Dependency: php-channel(pear.drush.org) for package: php-drush-drush-5.7.0-1.el6_3.noarch
---> Package php-pear-Console-Table.noarch 0:1.1.4-1.el6.2 will be installed
--> Processing Dependency: php-pear(Console_Color) for package: php-pear-Console-Table-1.1.4-1.el6.2.noarch
--> Running transaction check
---> Package php-drush-drush.noarch 0:5.7.0-1.el6_3 will be obsoleting
--> Processing Dependency: php-channel(pear.drush.org) for package: php-drush-drush-5.7.0-1.el6_3.noarch
---> Package php-pear-Console-Color.noarch 0:1.0.3-1.el6 will be installed
--> Finished Dependency Resolution
Error: Package: php-drush-drush-5.7.0-1.el6_3.noarch (/php-drush-drush-5.7.0-1.el6_3.noarch)
           Requires: php-channel(pear.drush.org)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

Comment 5 Anderson Silva 2012-11-21 17:36:34 UTC
Also, doing a yum search php-pear, it seems the packages naming convention seems yo be: php-pear-Module, it may make sense to name this RPM: php-pear-Drush (just a suggestion)

AS

Comment 6 Remi Collet 2012-11-21 17:38:38 UTC
@Anderson : no, naming convention is php-<channelname>-<extensionname>
http://fedoraproject.org/wiki/Packaging:PHP#Naming_scheme

Comment 7 Shawn Iwinski 2012-11-21 17:44:59 UTC
(In reply to comment #4)
> Error: Package: php-drush-drush-5.7.0-1.el6_3.noarch
> (/php-drush-drush-5.7.0-1.el6_3.noarch)
>            Requires: php-channel(pear.drush.org)

Ooops, sorry.  I forgot to give you that required RPM.  Here it is: http://kojipkgs.fedoraproject.org//packages/php-channel-drush/1.3/1.el6/noarch/php-channel-drush-1.3-1.el6.noarch.rpm

Comment 8 Anderson Silva 2012-11-21 19:25:07 UTC
1. sorry, for some reason I read the package name to be: php-pear-drush... but it is php-drush-drush.
2. Installing the php-channel-drush allowed me to finish the isntallation.
3. But the isntall is not working for me:'

I see: 

[root@ip-10-203-7-154 drush]# rpm -ql php-drush-drush | grep bin
/usr/bin/drush
/usr/bin/drush.bat

But when I run drush:

[root@ip-10-203-7-154 default]# pwd
/usr/share/drupal6/sites/default
[root@ip-10-203-7-154 default]# drush cc all -u 1
-bash: /usr/bin/drush: No such file or directory
[root@ip-10-203-7-154 default]# /usr/bin/drush cc all -u 1
-bash: /usr/bin/drush: No such file or directory

4. Do we really want to drop the .bat file on the file system?

I am taking off for the holidays, I will be back on monday and I can provide more feedback if needed.

I hope this helps.

AS

Comment 9 Shawn Iwinski 2012-11-26 21:26:17 UTC
(In reply to comment #8)

There has to be some sort of cache somewhere.  I had a system with drush custom installed in /usr/local/bin and /usr/share/drush.  I removed the custom install, installed these RPMS, and get the same type error you are seeing (except showing that it is trying to point to the old location):

# which drush
/usr/bin/drush
# drush --version
-bash: /usr/local/bin/drush: No such file or directory
# /usr/bin/drush --version
drush version 5.7

I found "~/.drush" and "/tmp/drush-env".  I removed both directories but the test result was the same.  I rebooted the VM and then the drush command worked perfectly fine.  I need to figure out a way to make it work without a reboot...

Also, version 5.8.0 was released so I need to update the RPM to that version too.

Comment 10 Anderson Silva 2012-11-26 22:22:54 UTC
For what is worth:

I have spin up a new host and:

Manually removed drual6-drush
yum locallinstall php-drush-drush (and the other rpm)

I did this w/o running a drush cc all -u 1 (with the old package)

And the new drush worked.

I will play some more with it.

AS

Comment 11 Anderson Silva 2012-11-26 22:40:19 UTC
So, here is my theory:

The SPEC on drupal6-drush does a postun: unlink /usr/bin/drush and the "erasing" of drupal6-drush is happening after installation of php-drush-drush rpm.

So, postun is doing an unlink on a good /usr/bin/drush

.....



Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : php-channel-drush-1.3-1.el6.noarch                                                                                                                                            1/3 
PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EST/-5.0/no DST' instead in /usr/share/pear/PEAR/Registry.php on line 1012
  Installing : php-drush-drush-5.7.0-1.el6_3.noarch                                                                                                                                          2/3 
  Erasing    : drupal6-drush-4.1-3.el6_2.noarch                                                                                                                                              3/3 
  Verifying  : php-channel-drush-1.3-1.el6.noarch                                                                                                                                            1/3 
  Verifying  : php-drush-drush-5.7.0-1.el6_3.noarch                                                                                                                                          2/3 
  Verifying  : drupal6-drush-4.1-3.el6_2.noarch                                                                                                                                              3/3 

Installed:
  php-channel-drush.noarch 0:1.3-1.el6                                                           php-drush-drush.noarch 0:5.7.0-1.el6_3                                                          

Replaced:
  drupal6-drush.noarch 0:4.1-3.el6_2                                                                                                                                                             

Complete!

Comment 12 Remi Collet 2012-11-27 15:43:11 UTC
> So, postun is doing an unlink on a good /usr/bin/drush
Yes... :(

A workaround could be to add a trigger to restore this file using a 
%triggerpostun -- drupal6-drush


Ugly...

Comment 13 Shawn Iwinski 2012-11-27 16:28:48 UTC
Anderson --

I believe it would be cleaner (and "better") to fix drupal6-drush's bin soft link instead of me adding a %triggerpostun to this package.  Would you mind releasing an update to drupal6-drush?  I forked the Fedora repo, made changes these changes to the spec, and tested them successfully:
https://github.com/siwinski/drupal6-drush/commit/f4f62edafdd96f082676f7181107ebc742f55f92

This will not fix users who do not update their drupal6-drush pkgs before upgrading to php-drush-drush though.  Perhaps I will still need to add a %triggerpostun? -- Remi?

Comment 14 Anderson Silva 2012-11-27 16:37:49 UTC
I can absolutely put that out there... I do wonder how many people actually use this package :-)

Comment 15 Anderson Silva 2012-11-27 17:27:23 UTC
http://koji.fedoraproject.org/koji/taskinfo?taskID=4734177 ... I will test it on my server later today, and then get other branches built as well

Comment 16 Anderson Silva 2012-11-27 19:09:08 UTC
Here we go: https://admin.fedoraproject.org/updates/drupal6-drush

I tested the changes on rhel6 (replacing with php-drush-drush) and it seemed to have worked well.

Comment 17 Remi Collet 2012-11-27 19:12:41 UTC
(In reply to comment #13)

> This will not fix users who do not update their drupal6-drush pkgs before
> upgrading to php-drush-drush though.  Perhaps I will still need to add a
> %triggerpostun? -- Remi?

Could be a good idea.
I have one in php-pear for some time for such an issue.

Btw, rpm --verify will report a corrupted installation, and yum reinstall is a workaround...

Comment 18 Shawn Iwinski 2012-11-27 21:24:36 UTC
(In reply to comment #17)
> Btw, rpm --verify will report a corrupted installation, and yum reinstall is
> a workaround...

I would prefer to just put a note in the description about the replacement of drupal6-drush and to use "yum reinstall" if there is an issue with the drush command.  Not sure there are tons of installs for this package as compared to PEAR ;)  Is this acceptable?

Comment 19 Shawn Iwinski 2013-03-16 23:29:38 UTC
(In reply to comment #9)
> Also, version 5.8.0 was released so I need to update the RPM to that version
> too.

Apparently I updated the spec and created the SRPM for latest stable version 5.8.0 a while ago but never posted it yet.


SPEC URL: http://siwinski.fedorapeople.org/rpmbuild/SPECS/php-drush-drush.spec

SRPM URL: http://siwinski.fedorapeople.org/rpmbuild/SRPMS/php-drush-drush-5.8.0-1.fc18.src.rpm


Anderson, here's the RHEL 6 RPM: http://siwinski.fedorapeople.org/rpmbuild/RPMS/php-drush-drush-5.8.0-1.el6_3.noarch.rpm

Comment 20 Peter Borsa 2013-03-17 09:28:12 UTC
Hey,

I successfully rebuilt it a few minutes ago but got some messages. Here is the results of rpmlint:

$ rpmlint php-drush-drush.spec ../SRPMS/php-drush-drush-5.8.0-1.fc18.src.rpm ../RPMS/noarch/php-drush-drush-5.8.0-1.fc18.noarch.rpm

php-drush-drush.src: W: spelling-error %description -l en_US sql -> sq, sol, sq l
php-drush-drush.src: W: spelling-error %description -l en_US cron -> corn, con, crone
php-drush-drush.noarch: W: spelling-error %description -l en_US cron -> corn, con, crone
php-drush-drush.noarch: E: script-without-shebang /usr/bin/drush.bat
php-drush-drush.noarch: W: wrong-file-end-of-line-encoding /usr/share/doc/pear/drush/examples/sandwich.txt
php-drush-drush.noarch: W: no-manual-page-for-binary drush.bat
php-drush-drush.noarch: W: no-manual-page-for-binary drush
2 packages and 1 specfiles checked; 1 errors, 6 warnings.

Comment 21 Shawn Iwinski 2013-03-18 00:54:57 UTC
- Removed drush.bat
- Fixed rpmlint wrong-file-end-of-line-encoding warning
- Added man page


SPEC URL: http://siwinski.fedorapeople.org/rpmbuild/SPECS/php-drush-drush.spec

SRPM URL: http://siwinski.fedorapeople.org/rpmbuild/SRPMS/php-drush-drush-5.8.0-2.fc18.src.rpm

Comment 22 Peter Borsa 2013-03-18 11:49:46 UTC
Hey Shawn,

I rebuilt it again but did not get any warnings or errors, so here is the result:

$ rpmlint php-drush-drush.spec ../SRPMS/php-drush-drush-5.8.0-2.fc18.src.rpm ../RPMS/noarch/php-drush-drush-5.8.0-2.fc18.noarch.rpm

php-drush-drush.src: W: spelling-error %description -l en_US sql -> sq, sol, sq l
php-drush-drush.src: W: spelling-error %description -l en_US cron -> corn, con, crone
php-drush-drush.noarch: W: spelling-error %description -l en_US cron -> corn, con, crone
2 packages and 1 specfiles checked; 0 errors, 3 warnings.

It looks good to me nevertheless I can see there are a few upstream issue which need to be fixed. Do you want to push it or wait for upstream so as to they fix those issues?

Comment 23 Shawn Iwinski 2013-03-18 15:13:38 UTC
(In reply to comment #22)
> It looks good to me nevertheless I can see there are a few upstream issue
> which need to be fixed. Do you want to push it or wait for upstream so as to
> they fix those issues?

Peter -- Upstream seems to be pretty slow with incorporating fixes so I would prefer to move ahead with this package and the manual fixes it contains.  When upstream fixes the issues I will update the spec and remove the manual fixes.

Comment 24 Peter Borsa 2013-03-18 15:36:31 UTC
Shawn,

I see then I'm going to review it officially a few hours later.

Comment 25 Peter Borsa 2013-03-19 06:24:40 UTC
Good:

- rpmlint checks return:

$ rpmlint php-drush-drush.spec ../SRPMS/php-drush-drush-5.8.0-2.fc18.src.rpm ../RPMS/noarch/php-drush-drush-5.8.0-2.fc18.noarch.rpm

php-drush-drush.src: W: spelling-error %description -l en_US sql -> sq, sol, sq l
php-drush-drush.src: W: spelling-error %description -l en_US cron -> corn, con, crone
php-drush-drush.noarch: W: spelling-error %description -l en_US cron -> corn, con, crone
2 packages and 1 specfiles checked; 0 errors, 3 warnings.

- package meets naming guidelines
- package meets packaging guidelines
- license ( GPLv2+ ) OK, text in %doc, matches source
- spec file legible, in am. english
- source matches upstream

$ md5sum drush-5.8.0.tgz ; curl -s -o - http://pear.drush.org/get/drush-5.8.0.tgz | md5sum -
00d01f69bbd356245cf608a3a81d99e6  drush-5.8.0.tgz
00d01f69bbd356245cf608a3a81d99e6  -

- package compiles on devel (x86)
- no missing BR
- no unnecessary BR
- no locales
- not relocatable
- owns all directories that it creates
- no duplicate files
- permissions ok
- %clean ok
- macro use consistent
- code, not content
- no need for -docs
- nothing in %doc affects runtime
- no need for .desktop file

APPROVED.

Comment 26 Shawn Iwinski 2013-03-19 15:36:49 UTC
THANKS for the review!


New Package SCM Request
=======================
Package Name: php-drush-drush
Short Description: Command line shell and Unix scripting interface for Drupal
Owners: siwinski
Branches: f18 f19 el6
InitialCC:

Comment 27 Gwyn Ciesla 2013-03-19 15:42:59 UTC
Git done (by process-git-requests).

Comment 28 Fedora Update System 2013-04-06 00:03:41 UTC
php-drush-drush-5.8.0-4.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/php-drush-drush-5.8.0-4.fc19

Comment 29 Fedora Update System 2013-04-06 00:03:55 UTC
php-drush-drush-5.8.0-4.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/php-drush-drush-5.8.0-4.fc18

Comment 30 Fedora Update System 2013-04-06 00:04:07 UTC
php-drush-drush-5.8.0-4.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/php-drush-drush-5.8.0-4.el6

Comment 31 Fedora Update System 2013-04-06 16:54:52 UTC
php-drush-drush-5.8.0-4.fc19 has been pushed to the Fedora 19 testing repository.

Comment 32 Fedora Update System 2013-04-17 00:26:32 UTC
php-drush-drush-5.8.0-4.fc18 has been pushed to the Fedora 18 stable repository.

Comment 33 Fedora Update System 2013-04-20 19:26:13 UTC
php-drush-drush-5.8.0-4.fc19 has been pushed to the Fedora 19 stable repository.

Comment 34 Fedora Update System 2013-04-21 18:46:58 UTC
php-drush-drush-5.8.0-4.el6 has been pushed to the Fedora EPEL 6 stable repository.