[opensuse-packaging] Packaging php-pear modules
Hi, i've a general question about packaging php-pear modules. If you install pear-module via the commandline tool, pear manages each module in its "own" packagemanagement (it takes care that all dependencies etc. are installed...). Now if you install a (suse) php-pear-* rpm package the pear packagemanager doesn't know that this certain packages is installed. What about registering this package by the pear packagemanager too? For example the following could be added to the spec files: %post # make the package known to the pear-packagemanager pear install --nodeps --register-only PACKAGE.xml %postun # remove the package from the pear-packagemanager pear uninstall --nodeps --register-only PACKAGE (maybe some arguments should be added to the pear call..). But this maybe leads to some problems too. One possible problem could be that the user removes the pear-package via the pear commandline tool but the package still exists in the rpm database..?! What do you think about this? Marcus --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
[CCing Ales as the maintainer of the pear packages] Marcus Hüwe wrote:
Now if you install a (suse) php-pear-* rpm package the pear packagemanager doesn't know that this certain packages is installed.
Yes, the pear packages leave much room for improvement. And yes, I admit authorship of the current spec files :-)
What about registering this package by the pear packagemanager too? For example the following could be added to the spec files:
%post # make the package known to the pear-packagemanager pear install --nodeps --register-only PACKAGE.xml
Good idea.
%postun # remove the package from the pear-packagemanager pear uninstall --nodeps --register-only PACKAGE
I'd wrap it with 'if test -x /usr/bin/pear; then ... fi', because rpm doesn't implement ordering of packages during uninstallation.
But this maybe leads to some problems too. One possible problem could be that the user removes the pear-package via the pear commandline tool but the package still exists in the rpm database..?!
I think this is a generic problem, it would be interesting to see how/whether is it solved in cpan or gems. Darix, Anicka, are you there? ;-) Michal --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On 2006-12-12 14:04:25 +0100, Michal Marek wrote:
%postun # remove the package from the pear-packagemanager pear uninstall --nodeps --register-only PACKAGE
I'd wrap it with 'if test -x /usr/bin/pear; then ... fi', because rpm doesn't implement ordering of packages during uninstallation.
i think a "Requires: php5-pear" should makre sure that php5-pear is uninstalled after the pear modules.
But this maybe leads to some problems too. One possible problem could be that the user removes the pear-package via the pear commandline tool but the package still exists in the rpm database..?!
I think this is a generic problem, it would be interesting to see how/whether is it solved in cpan or gems. Darix, Anicka, are you there? ;-)
i have the similar problem with my rubygem-* rpms. i thought about hacking the cmdline tool to check if the module was installed via rpm and error out in this case. so far i didnt find time to implement it. we could use a similar solution for pear. darix -- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Hi, (sorry for the late respone:/ ). On 2006-12-12 14:28:53 +0100, Marcus Rueckert wrote:
On 2006-12-12 14:04:25 +0100, Michal Marek wrote:
%postun # remove the package from the pear-packagemanager pear uninstall --nodeps --register-only PACKAGE
I'd wrap it with 'if test -x /usr/bin/pear; then ... fi', because rpm doesn't implement ordering of packages during uninstallation.
i think a "Requires: php5-pear" should makre sure that php5-pear is uninstalled after the pear modules.
No that doesn't work: linux:~ # rpm -ihv /home/marcus/packages/RPMS/i586/test2-1.2.3-0.i586.rpm Preparing... ########################################### [100%] 1:test2 ########################################### [100%] linux:~ # rpm -ihv /home/marcus/packages/RPMS/i586/test-1.2.3-0.i586.rpm Preparing... ########################################### [100%] 1:test ########################################### [100%] linux:~ # rpm -qR test test2 /bin/sh rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadIsBzip2) <= 3.0.5-1 linux:~ # rpm -e test2 error: Failed dependencies: test2 is needed by (installed) test-1.2.3-0.i586 linux:~ # rpm -ql test2 /usr/bin/test-script linux:~ # rpm -e test2 test /var/tmp/rpm-tmp.36822: line 1: /usr/bin/test-script: No such file or directory error: %postun(test-1.2.3-0.i586) scriptlet failed, exit status 127 linux:~ # rpm -q test test2 test-1.2.3-0 package test2 is not installed linux:~ # So it's the best to use an if-check around the %postun section.
But this maybe leads to some problems too. One possible problem could be that the user removes the pear-package via the pear commandline tool but the package still exists in the rpm database..?!
I think this is a generic problem, it would be interesting to see how/whether is it solved in cpan or gems. Darix, Anicka, are you there? ;-)
i have the similar problem with my rubygem-* rpms. i thought about hacking the cmdline tool to check if the module was installed via rpm and error out in this case. so far i didnt find time to implement it.
How do you want to find out if the module was installed via rpm or via the commandline tool? Marcus --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Marcus Hüwe wrote:
But this maybe leads to some problems too. One possible problem could be that the user removes the pear-package via the pear commandline tool but the package still exists in the rpm database..?! I think this is a generic problem, it would be interesting to see how/whether is it solved in cpan or gems. Darix, Anicka, are you there? ;-) i have the similar problem with my rubygem-* rpms. i thought about hacking the cmdline tool to check if the module was installed via rpm and error out in this case. so far i didnt find time to implement it.
How do you want to find out if the module was installed via rpm or via the commandline tool?
A) extend pear's database to hold that information OR B) run exec("rpm -q " . escapeshellarg($rpmname), $out, $ret) in the commandline tool A) would IMO be more difficult to implement, B) would cost some time to query the rpm database (probably feasible), plus it would require a consistent, machine deducible naming of the rpm packages (desirable anyway ;)). Either way, we would need to find all possible code paths wher a packages are manipulated, that is not only direct install/update/erasure of the package, but also install/update via dependencies. So the whole think might turn out to be way too difficult, esp. when this would probably never be accepted upstream. But the %post %postun scriplets look like a goot idea to me. Michal --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
participants (3)
-
Marcus Hüwe
-
Marcus Rueckert
-
Michal Marek