Quote:
Originally Posted by pghvlaans
Do you have a sample package to share? I'm not sure it's even possible for makepkg to generate something without a ./ directory.
|
Yes, I am fairly certain that the makepkg script will always include the "./" directory. The issue involves packages generated in other ways. Since pkgtools tries hard to work with such packages, it seems to me that the issue identified here ought to be addressed, especially since (as far as I can tell) it can be fixed with the addition of a single character (a "^") to the fgrep argument. To be honest, I think this ought to be done for consistency anyway since it is "^./" that sed ends up looking for by vitue of what TRIGGER is set to. The fgrep is checking for the existence of the token that will ultimately be passed to sed, so it ought to search for the exact same regex.
As to a sample package, it's fairly easy to create one:
Code:
cd /tmp
mkdir -p foo/opt/test
touch foo/opt/test/file
cd foo
tar cfz ../foo-1-x86_64-1.tgz --owner=root --group=root *
If you install this package using
Code:
installpkg foo-1-x86_64-1.tgz
then it will be correctly removed using
However, if installation of the exact same package includes "./" anywhere in the name, then removepkg won't remove the package's files. Examples which will cause removepkg to fail:
Code:
installpkg ./foo-1-x86_64-1.tgz
installpkg /tmp/./foo-1-x86_64-1.tgz
Since pkgtools accept tarballs for installation without the "./" entry, it is reasonable to expect that they will uninstall. Having different behaviour at removal time just because "./" was used in the path to the package at installation is more than a little surprising.
The inconsistency is perhaps as important here as ideology. Leaving this issue unfixed on the grounds that it only affects mal-formed packages would be fair if installpkg rejected such packages. As it stands, installpkg is able to deal with packages which lack the "./" entry, and removepkg has a specific workaround for them too. It's just that the incomplete fgrep argument used as part of removepkg's workaround doesn't always work correctly for the reasons stated.
The packages I discovered this with are locally created using tar, not makepkg. makepkg is not used since running as root during package creation is awkward in the circumstances, and tar generally does the job. There's just this corner case that's triggered if one happens to use "./" in the path to the package at installation time.