Page 1 of 1

upgradepkg allows to install packages with invalid names

Posted: 3. Jun 2012, 08:10
by zAchAry
(I do not know to where else to report this bug at)

When I first used the edited SlackBuild file, the new part was as follows:

Code: Select all

install -m 755 -p -D peg-e $PKG/usr/bin/peg-e

mkdir -p $PKG/usr/share/{applications,pixmaps,translations}
cp  icons/peg-e.png  $PKG/usr/share/pixmaps/peg-e.png
cp  icons/peg-e.desktop  $PKG/usr/share/applications/peg-e.desktop

# Add translations
mkdir -p $PKG/usr/share/peg-e/translations
cp -a  translations/pege_he_IL.qm
$PKG/usr/share/peg-e/translations/pege_he_IL.qm cp -a
translations/pege_en.qm $PKG/usr/share/peg-e/translations/pege_en.qm

# Add documentation files: readme, changelog and so on
I could be wrong, maybe it was a bit different.


The result of # upgradepkg --install-new <package_name> was this:

From GUI:

Code: Select all

Common
  Name: peg-e-1.1.0-i486-5sl-upgraded
  Description: e)
  Version: 2012-06-02,19:22:47
 
Description
  peg-e: Peg-E (QT4 Solitaire Game)
  peg-e:
  peg-e: Peg-E is a peg solitaire game in  which you jump over pieces in order
  peg-e: to remove them from the board, ultimately trying to eliminate all but
  peg-e: one. The boards are randomly generated, with 100 levels of difficulty
  peg-e: The game auto-saves, and  has undo-redo  capability. Pieces  can move
  peg-e: horizontally, vertically, and diagonally.
  peg-e:
  peg-e:
  peg-e:
  peg-e:
 
File
  /usr/
  /usr/bin/
  /usr/bin/peg-e
  /usr/share/
  /usr/share/pixmaps/
  /usr/share/pixmaps/peg-e.png
  /usr/share/applications/
  /usr/share/applications/peg-e.desktop
  /usr/doc/
  /usr/doc/peg-e-1.1.0/
  /usr/doc/peg-e-1.1.0/ChangeLog
  /usr/doc/peg-e-1.1.0/README
  /usr/doc/peg-e-1.1.0/SlackBuild/
  /usr/doc/peg-e-1.1.0/SlackBuild/slack-desc
  /usr/doc/peg-e-1.1.0/SlackBuild/peg-e.SlackBuild
  /usr/doc/peg-e-1.1.0/COPYING
The text file:

Code: Select all

PACKAGE NAME:     peg-e-1.1.0-i486-5sl
COMPRESSED PACKAGE SIZE:     60K
UNCOMPRESSED PACKAGE SIZE:     170K
PACKAGE LOCATION: /home/etf/peg-e-1.1.0-i486-5sl.txz
PACKAGE DESCRIPTION:
peg-e: Peg-E (QT4 Solitaire Game)
peg-e:
peg-e: Peg-E is a peg solitaire game in  which you jump over pieces in order
peg-e: to remove them from the board, ultimately trying to eliminate all but
peg-e: one. The boards are randomly generated, with 100 levels of difficulty
peg-e: The game auto-saves, and  has undo-redo  capability. Pieces  can move
peg-e: horizontally, vertically, and diagonally.
peg-e:
peg-e:
peg-e:
peg-e:
FILE LIST:
./
usr/
usr/bin/
usr/bin/peg-e
usr/share/
usr/share/pixmaps/
usr/share/pixmaps/peg-e.png
usr/share/applications/
usr/share/applications/peg-e.desktop
usr/doc/
usr/doc/peg-e-1.1.0/
usr/doc/peg-e-1.1.0/ChangeLog
usr/doc/peg-e-1.1.0/README
usr/doc/peg-e-1.1.0/SlackBuild/
usr/doc/peg-e-1.1.0/SlackBuild/slack-desc
usr/doc/peg-e-1.1.0/SlackBuild/peg-e.SlackBuild
usr/doc/peg-e-1.1.0/COPYING
install/
install/slack-desc
install/slack-required
install/doinst.sh
The name of the entry file (got renamed to a strange string)

Code: Select all

$ ls /var/log/packages/peg*
peg-e-1.1.0-i486-5sl-upgraded-2012-06-02,19:22:47

Trying to remove the package will result to this output:

Code: Select all

# slapt-get --remove "peg-e-1.1.0-i486-5sl-upgraded-2012-06-02,19:22:47"
Reading Package Lists...Done
The following packages will be REMOVED:
  peg-e-1.1.0-i486-5sl-upgraded 
0 upgraded, 0 reinstalled, 0 newly installed, 1 to remove, 0 not upgraded.
After unpacking 170.0kB disk space will be freed.
Do you want to continue? [y/N] y

Removing package peg-e-1.1.0-i486-5sl-upgraded-2012-06-02,19:22:47...
ERROR: Package file name doesn't match with package name. (peg-e-1.1.0-i486-5sl-upgraded-2012-06-02,19:22:47 != peg-e-1.1.0-i486-5sl)
ERROR: Can't get package from the database. (peg-e-1.1.0-i486-5sl-upgraded-2012-06-02,19:22:47)
ERROR: Package removal failed!
Failed to execute command: [/sbin/spkg -d peg-e-1.1.0-i486-5sl-upgraded-2012-06-02,19:22:47]
And this:

Code: Select all

# spkg -d peg-e
ERROR: Package not found. (peg-e)
ERROR: Package removal failed!

Re: upgradepkg allows to install packages with invalid names

Posted: 5. Jun 2012, 11:27
by gapan
It's not upgradepkg's fault. The "-upgraded" part in the package name was appended because the upgrade/install procedure was interrupted for some reason (maybe you hit Ctrl-C? ). But why aren't you using spkg? It is much more robust than the original Slackware pkgtools.

Your problem is because of the "-upgraded" part in the package name, the name of the package is not "peg-e" anymore, it's "peg-e-1.1.0", the package version is "i486", the package arch is "5sl" and the package number is "upgraded". You see where everything goes south? To remove the package you should run one of the following:

Code: Select all

spkg -d peg-e-1.1.0
spkg -d /var/log/peg-e-1.1.0-i486-5sl-upgraded
or removepkg in exactly the same way.

Re: upgradepkg allows to install packages with invalid names

Posted: 21. Jun 2012, 16:57
by zAchAry
I don't recall what happened exactly, maybe it happened also because I have interrupted the installation of the package (since it seemed to be going nowhere because it seemed to be stuck, but still responsive. The name of the entry file was peg-e-1.1.0-i486-5sl-upgraded-2012-06-02,19:22:47 which could not be removed in the regular manner and that was the main problem.

Re: upgradepkg allows to install packages with invalid names

Posted: 21. Jun 2012, 17:24
by gapan
That's what you get if you hit Ctrl-C when installing a package.

Re: upgradepkg allows to install packages with invalid names

Posted: 21. Jun 2012, 19:11
by zAchAry
Or a power outage. There should be an undo feature for these sort of scenarios.

Re: upgradepkg allows to install packages with invalid names

Posted: 21. Jun 2012, 19:33
by gapan
There is. I explained it in this thread already.

Re: upgradepkg allows to install packages with invalid names

Posted: 22. Jun 2012, 01:20
by zAchAry
I will try and use spkg from now on.
As for why I did not used spkg... it is JRD to be blamed :P

Re: upgradepkg allows to install packages with invalid names

Posted: 22. Jun 2012, 07:02
by thenktor
zAchAry wrote:I will try and use spkg from now on.
As for why I did not used spkg... it is JRD to be blamed :P
At the time JRD has posted this upgradepkg in Salix just was a wrapper for spkg. Nowaydays we ship the original script based Slackware package tools (installpkg, upgradepkg, ...) beside spkg. Both usually work fine, but spkg is much faster and I'd recommend to always use it ;)

Re: upgradepkg allows to install packages with invalid names

Posted: 22. Jun 2012, 12:50
by JRD
thenktor wrote:At the time JRD has posted this upgradepkg in Salix just was a wrapper for spkg
Yes it was.
Replace "upgradepkg --install-new"
with "spkg --reinstall --install-new"