LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Possible bug or strange feature of upgradepkg? (http://www.linuxquestions.org/questions/slackware-14/possible-bug-or-strange-feature-of-upgradepkg-747523/)

w1k0 08-14-2009 09:15 AM

Possible bug or strange feature of upgradepkg?
 
I use Slackware 12.2 on two machines. Today fan in my primary machine broke down so I started my secondary machine. I didn't use it for a few months, so I decided to upgrade all out of date packages. I put into the directory with the patches sixteen new packages from USB flash drive. Among them there were newer versions of six packages already existing in that directory: bind, mozilla-firefox, mozilla-thunderbird, ntp, samba, and seamonkey. In result I had in that directory these six packages in two versions each:

bind-9.4.3_P3-i486-1_slack12.2
bind-9.4.3_P1-i486-1_slack12.2
mozilla-firefox-3.0.6-i686-1
mozilla-firefox-3.0.13-i686-1
mozilla-thunderbird-2.0.0.22-i686-1
mozilla-thunderbird-2.0.0.19-i686-1
ntp-4.2.4p7-i486-1_slack12.2
ntp-4.2.4p6-i486-1_slack12.2
samba-3.2.7-i486-1_slack12.2
samba-3.2.13-i486-1_slack12.2
seamonkey-1.1.17-i486-1_slack12.2
seamonkey-1.1.14-i486-1_slack12.2

Then I run the command:

Code:

upgradepkg *.tgz
During the update process I observed that upgradepkg program had problems with mentioned packages. Instead of simply upgrade all the packages it did strange things. In the case of bind, mozilla-thunderbird, ntp, and seamonkey it first downgraded these packages and then upgraded them. In the case of mozilla-firefox and samba it first upgraded these packages and then downgraded them. So it did a lot of unnecessary work and after the upgrade process I remained with the old versions of mozilla-firefox and samba.

This is concise abstract from upgradepkg log:

Code:

Upgrading bind-9.4.3_P3-i486-1_slack12.2 package using ./bind-9.4.3_P1-i486-1_slack12.2.tgz
Upgrading bind-9.4.3_P1-i486-1_slack12.2 package using ./bind-9.4.3_P3-i486-1_slack12.2.tgz
Upgrading mozilla-firefox-3.0.6-i686-1 package using ./mozilla-firefox-3.0.13-i686-1.tgz
Upgrading mozilla-firefox-3.0.13-i686-1 package using ./mozilla-firefox-3.0.6-i686-1.tgz
Upgrading mozilla-thunderbird-2.0.0.22-i686-1 package using ./mozilla-thunderbird-2.0.0.19-i686-1.tgz
Upgrading mozilla-thunderbird-2.0.0.19-i686-1 package using ./mozilla-thunderbird-2.0.0.22-i686-1.tgz
Upgrading ntp-4.2.4p7-i486-1_slack12.2 package using ./ntp-4.2.4p6-i486-1_slack12.2.tgz
Upgrading ntp-4.2.4p6-i486-1_slack12.2 package using ./ntp-4.2.4p7-i486-1_slack12.2.tgz
Upgrading samba-3.2.7-i486-1_slack12.2 package using ./samba-3.2.13-i486-1_slack12.2.tgz
Upgrading samba-3.2.13-i486-1_slack12.2 package using ./samba-3.2.7-i486-1_slack12.2.tgz
Upgrading seamonkey-1.1.17-i486-1_slack12.2 package using ./seamonkey-1.1.14-i486-1_slack12.2.tgz
Upgrading seamonkey-1.1.14-i486-1_slack12.2 package using ./seamonkey-1.1.17-i486-1_slack12.2.tgz

This is longer log including all packages skipped and updated:

Code:


+==============================================================================
| Skipping package apr-1.3.8-i486-1_slack12.2 (already installed)
+==============================================================================


+==============================================================================
| Skipping package apr-util-1.3.9-i486-1_slack12.2 (already installed)
+==============================================================================


+==============================================================================
| Upgrading bind-9.4.3_P3-i486-1_slack12.2 package using ./bind-9.4.3_P1-i486-1_slack12.2.tgz
+==============================================================================

Pre-installing package bind-9.4.3_P1-i486-1_slack12.2...

Removing package /var/log/packages/bind-9.4.3_P3-i486-1_slack12.2-upgraded-2009-08-14,13:37:47...
.
.
.

Installing package bind-9.4.3_P1-i486-1_slack12.2...
.
.
.

Package bind-9.4.3_P3-i486-1_slack12.2 upgraded with new package ./bind-9.4.3_P1-i486-1_slack12.2.tgz.

+==============================================================================
| Upgrading bind-9.4.3_P1-i486-1_slack12.2 package using ./bind-9.4.3_P3-i486-1_slack12.2.tgz
+==============================================================================

Pre-installing package bind-9.4.3_P3-i486-1_slack12.2...

Removing package /var/log/packages/bind-9.4.3_P1-i486-1_slack12.2-upgraded-2009-08-14,13:37:56...
.
.
.

Installing package bind-9.4.3_P3-i486-1_slack12.2...
.
.
.

Package bind-9.4.3_P1-i486-1_slack12.2 upgraded with new package ./bind-9.4.3_P3-i486-1_slack12.2.tgz.

+==============================================================================
| Skipping package dhcp-3.1.2p1-i486-1_slack12.2 (already installed)
+==============================================================================


+==============================================================================
| Skipping package fetchmail-6.3.11-i486-1_slack12.2 (already installed)
+==============================================================================


+==============================================================================
| Skipping package ghostscript-8.63-i486-3_slack12.2 (already installed)
+==============================================================================


+==============================================================================
| Skipping package httpd-2.2.12-i486-2_slack12.2 (already installed)
+==============================================================================


+==============================================================================
| Skipping package libpng-1.2.37-i486-1_slack12.2 (already installed)
+==============================================================================


+==============================================================================
| Skipping package mkinitrd-1.3.3-i486-1_slack12.2 (already installed)
+==============================================================================


+==============================================================================
| Upgrading mozilla-firefox-3.0.6-i686-1 package using ./mozilla-firefox-3.0.13-i686-1.tgz
+==============================================================================

Pre-installing package mozilla-firefox-3.0.13-i686-1...

Removing package /var/log/packages/mozilla-firefox-3.0.6-i686-1-upgraded-2009-08-14,13:38:02...
.
.
.

Installing package mozilla-firefox-3.0.13-i686-1...
.
.
.

Package mozilla-firefox-3.0.6-i686-1 upgraded with new package ./mozilla-firefox-3.0.13-i686-1.tgz.

+==============================================================================
| Upgrading mozilla-firefox-3.0.13-i686-1 package using ./mozilla-firefox-3.0.6-i686-1.tgz
+==============================================================================

Pre-installing package mozilla-firefox-3.0.6-i686-1...

Removing package /var/log/packages/mozilla-firefox-3.0.13-i686-1-upgraded-2009-08-14,13:38:14...
.
.
.

Installing package mozilla-firefox-3.0.6-i686-1...
.
.
.

Package mozilla-firefox-3.0.13-i686-1 upgraded with new package ./mozilla-firefox-3.0.6-i686-1.tgz.

+==============================================================================
| Upgrading mozilla-thunderbird-2.0.0.22-i686-1 package using ./mozilla-thunderbird-2.0.0.19-i686-1.tgz
+==============================================================================

Pre-installing package mozilla-thunderbird-2.0.0.19-i686-1...

Removing package /var/log/packages/mozilla-thunderbird-2.0.0.22-i686-1-upgraded-2009-08-14,13:38:23...
.
.
.

Installing package mozilla-thunderbird-2.0.0.19-i686-1...
.
.
.

Package mozilla-thunderbird-2.0.0.22-i686-1 upgraded with new package ./mozilla-thunderbird-2.0.0.19-i686-1.tgz.

+==============================================================================
| Upgrading mozilla-thunderbird-2.0.0.19-i686-1 package using ./mozilla-thunderbird-2.0.0.22-i686-1.tgz
+==============================================================================

Pre-installing package mozilla-thunderbird-2.0.0.22-i686-1...

Removing package /var/log/packages/mozilla-thunderbird-2.0.0.19-i686-1-upgraded-2009-08-14,13:38:33...
.
.
.

Installing package mozilla-thunderbird-2.0.0.22-i686-1...
.
.
.

Package mozilla-thunderbird-2.0.0.19-i686-1 upgraded with new package ./mozilla-thunderbird-2.0.0.22-i686-1.tgz.

+==============================================================================
| Upgrading ntp-4.2.4p7-i486-1_slack12.2 package using ./ntp-4.2.4p6-i486-1_slack12.2.tgz
+==============================================================================

Pre-installing package ntp-4.2.4p6-i486-1_slack12.2...

Removing package /var/log/packages/ntp-4.2.4p7-i486-1_slack12.2-upgraded-2009-08-14,13:38:43...
.
.
.

Installing package ntp-4.2.4p6-i486-1_slack12.2...
.
.
.

Package ntp-4.2.4p7-i486-1_slack12.2 upgraded with new package ./ntp-4.2.4p6-i486-1_slack12.2.tgz.

+==============================================================================
| Upgrading ntp-4.2.4p6-i486-1_slack12.2 package using ./ntp-4.2.4p7-i486-1_slack12.2.tgz
+==============================================================================

Pre-installing package ntp-4.2.4p7-i486-1_slack12.2...

Removing package /var/log/packages/ntp-4.2.4p6-i486-1_slack12.2-upgraded-2009-08-14,13:38:51...
.
.
.

Installing package ntp-4.2.4p7-i486-1_slack12.2...
.
.
.

Package ntp-4.2.4p6-i486-1_slack12.2 upgraded with new package ./ntp-4.2.4p7-i486-1_slack12.2.tgz.

+==============================================================================
| Skipping package openssl-0.9.8i-i486-2_slack12.2 (already installed)
+==============================================================================


+==============================================================================
| Skipping package openssl-solibs-0.9.8i-i486-2_slack12.2 (already installed)
+==============================================================================


+==============================================================================
| Skipping package php-5.2.10-i486-2_slack12.2 (already installed)
+==============================================================================


+==============================================================================
| Skipping package ruby-1.8.7_p174-i486-1_slack12.2 (already installed)
+==============================================================================


+==============================================================================
| Upgrading samba-3.2.7-i486-1_slack12.2 package using ./samba-3.2.13-i486-1_slack12.2.tgz
+==============================================================================

Pre-installing package samba-3.2.13-i486-1_slack12.2...

Removing package /var/log/packages/samba-3.2.7-i486-1_slack12.2-upgraded-2009-08-14,13:38:56...
.
.
.

Installing package samba-3.2.13-i486-1_slack12.2...
.
.
.

Package samba-3.2.7-i486-1_slack12.2 upgraded with new package ./samba-3.2.13-i486-1_slack12.2.tgz.

+==============================================================================
| Upgrading samba-3.2.13-i486-1_slack12.2 package using ./samba-3.2.7-i486-1_slack12.2.tgz
+==============================================================================

Pre-installing package samba-3.2.7-i486-1_slack12.2...

Removing package /var/log/packages/samba-3.2.13-i486-1_slack12.2-upgraded-2009-08-14,13:39:23...
.
.
.

Installing package samba-3.2.7-i486-1_slack12.2...
.
.
.

Package samba-3.2.13-i486-1_slack12.2 upgraded with new package ./samba-3.2.7-i486-1_slack12.2.tgz.

+==============================================================================
| Upgrading seamonkey-1.1.17-i486-1_slack12.2 package using ./seamonkey-1.1.14-i486-1_slack12.2.tgz
+==============================================================================

Pre-installing package seamonkey-1.1.14-i486-1_slack12.2...

Removing package /var/log/packages/seamonkey-1.1.17-i486-1_slack12.2-upgraded-2009-08-14,13:39:41...
.
.
.

Installing package seamonkey-1.1.14-i486-1_slack12.2...
.
.
.

Package seamonkey-1.1.17-i486-1_slack12.2 upgraded with new package ./seamonkey-1.1.14-i486-1_slack12.2.tgz.

+==============================================================================
| Upgrading seamonkey-1.1.14-i486-1_slack12.2 package using ./seamonkey-1.1.17-i486-1_slack12.2.tgz
+==============================================================================

Pre-installing package seamonkey-1.1.17-i486-1_slack12.2...

Removing package /var/log/packages/seamonkey-1.1.14-i486-1_slack12.2-upgraded-2009-08-14,13:40:21...
.
.
.

Installing package seamonkey-1.1.17-i486-1_slack12.2...
.
.
.

Package seamonkey-1.1.14-i486-1_slack12.2 upgraded with new package ./seamonkey-1.1.17-i486-1_slack12.2.tgz.

+==============================================================================
| Skipping package subversion-1.5.7-i486-1_slack12.2 (already installed)
+==============================================================================


+==============================================================================
| Skipping package svgalib_helper-1.9.25_2.6.27.7-i486-2_slack12.2 (already installed)
+==============================================================================


+==============================================================================
| Skipping package xdg-utils-1.0.2-noarch-3_slack12.2 (already installed)
+==============================================================================

Is it a bug or a ``feature'' of upgradepkg? Have I report it to Patrick or just remember to manually remove older package's sources before updating to the newer ones?

GazL 08-14-2009 09:46 AM

It's always done that. Caught me out a long while ago too, when I used to manually download all the patches (nowadays I use a rsync mirror so I don't see the duplicates). Upgradepkg doesn't make any distinctions about whether the version is newer than the installed version or not. Probably best to think of it as 'replacepkg'.

w1k0 08-14-2009 10:07 AM

So what you do you think of that: is it a bug or a feature? Report it or live with it?

rworkman 08-14-2009 10:11 AM

Notabug

Alien Bob 08-14-2009 10:14 AM

It is a feature, not a bug!
The slackware package tools do not work with the concept of "older" or "newer", only with the concept of "different". So, using upgradepkg you can just as easily downgrade a package to an earlier version as upgrade to a newer version.

It is you, the admin of the Slackware system, who is being forced to do some housekeeping.

Eric

w1k0 08-14-2009 11:20 AM

I only wonder why upgradepkg used with the wildcard such as *.tgz or mozilla-firefox-* doesn't try to inspect the entire directory and doesn't try to recognize the newest packages.

If someone has in the directory the packages:

Code:

mozilla-firefox-3.0.6-i686-1.tgz
mozilla-firefox-3.0.13-i686-1.tgz
mozilla-thunderbird-2.0.0.22-i686-1.tgz
mozilla-thunderbird-2.0.0.19-i686-1.tgz

and uses the command:

Code:

upgradepkg mozilla-firefox-3.0.6-i686-1.tgz mozilla-thunderbird-2.0.0.19-i686-1.tgz
he explicitly decides to downgrade both these programs.

But if he uses wildcarded commands such as:

Code:

upgradepkg *.tgz
or:

Code:

upgradepkg mozilla-*
he obviously wants to update the packages to the newest versions.

Program upgradepkg interpreting wildcards in an intelligent way could be still used to downgrade the programs.

Alien Bob 08-14-2009 11:32 AM

Nope... upgradepkg is not intelligent, it just assumes that you know what you are doing. If you give it a wildcard list of packages to chew on, it will "upgrade" every single one of those.

Learn to live with it, it's the Slackware way ;-)

Eric

GazL 08-14-2009 11:36 AM

Quote:

Originally Posted by w1k0 (Post 3643292)
Program upgradepkg interpreting wildcards in an intelligent way could be still used to downgrade the programs.

except ofcourse, it's not upgradepkg that's doing the wildcard expansion. It's the shell.

upgradepkg is a simple tool designed to update a single package. The fact that it can be given a list of them is just a convenience to the user. Having it check for duplicates is probably outside of its scope, though if it really bothers you, it shouldn't be that hard for you to write a wrapper script that does what you want.

veeall 08-14-2009 11:56 AM

I propose because 3.0.6 is being considered higher number than 3.0.13 it downgrades firefox. Or am i mistaken?

GazL 08-14-2009 11:59 AM

Quote:

Originally Posted by veeall (Post 3643329)
I propose because 3.0.6 is being considered higher number than 3.0.13 it downgrades firefox. Or am i mistaken?

As I understand it, it'll just do them in the order listed and alpha-numerically 3.0.13 will come first and then get overwritten by 3.0.6.

brianL 08-14-2009 12:17 PM

Wouldn't you have been better off using slackpkg?

allend 08-14-2009 12:39 PM

Quote:

Wouldn't you have been better off using slackpkg?
Not all of us enjoy fast downloads and generous download limits. I regularly update my desktop using slackpkg but have the downloads saved rather than deleted (DELALL=off in slackpkg.conf). Then I can copy the contents of /var/cache/packages to a usb key for updating my laptop. Plug the key, change to the directory holding the copied contents, su to root and then 'upgradepkg ./*/*/*.t?z'. This works well for me, but I do need to remember to be careful of multiple versions of packages and also to check for .new files with 'slackpkg new-config'.

sahko 08-14-2009 03:06 PM

Quote:

Originally Posted by veeall (Post 3643329)
I propose because 3.0.6 is being considered higher number than 3.0.13 it downgrades firefox. Or am i mistaken?

Just like Alien BOB said before, upgradepkg doesnt care about versions.
If you point it to a file which has a different version than the one you have installed, it will "upgrade" it even if its in essense a downgrade.
It wouldnt matter even if the file was firefox-2.1.
So you are mistaking, yes.

Remember, this is Slackware. The package manager is the admin.

w1k0 08-14-2009 04:31 PM

Quote:

Originally Posted by Alien Bob (Post 3643301)
Learn to live with it, it's the Slackware way ;-)

I'm learning to live with it for nine years. So far I always removed old packages from the directory including updates before I started upgradepkg. Today I was forced to use the other machine and I was in a rush so I just copied newer packages from USB flash drive to the directory with the updates and I started upgradepkg immediately. In result I observed that strange feature of that program. It isn't strange for those who know about it -- it was strange for me because I saw it for the first time.

Just the same as allend I always download new packages only once and then ``clone'' them on two other machines: my secondary and mine friend's primary. As a matter of fact I have ``fast downloads and generous download limits'' but I don't like to generate unwanted traffic. Perhaps I'm slightly old-fashioned.


All times are GMT -5. The time now is 11:50 AM.