[Slackbuilds-users] extra files in $PKG/install

B. Watson urchlay at slackware.uk
Mon Apr 11 22:24:40 UTC 2022


Sorry, this turned out to be longer than I expected. But I think it
covers the issue in enough detail that it's worth it...

On Mon, 11 Apr 2022, Giancarlo Dessì wrote:

> I think this could be a singular issue in your system. I have built 
> hudrends of different slackbuilds but no files like these exist (I 
> searched in / and in /tmp/SBo). Sometimes I check and empty the 
> directory but I never found files like these.

You wouldn't have seen this on Slackware 14.2 or earlier; it's caused
by a change to installpkg that happened in 2018 (so you might have
seen it on pre-15.0 -current, if you ran that).

It's happened on two different 15.0 systems here. It's not a problem
with my setup, it's a problem with a few specific SlackBuilds. So far,
I've discovered it in:

multimedia/l-smash
network/ipxnet
system/freeipmi

To see what I'm talking about, build and install one of these
packages. Don't take my word for it, try it.... note that I'm not
pointing fingers at anyone: Two of those are maintained by me, so I'd
have to point at myself with both hands.

The reason for asking about it on the mailing list is that I'm trying
to find any other SBo builds that have the same problem, that people
might have run into.

What these builds all have in common: they put extra files in
$PKG/install (besides slack-desc and doinst.sh). I've fixed them in my
git branch, so if you want to test them, do it before the next update.

There are comments in /sbin/installpkg that explain the situation.
Starting from line 64:

# Tue Apr 17 17:26:44 UTC 2018
# Quit with the funny business in /install. Note however that /install still
# isn't a safe directory to use in a package for anything other than package
# metadata. Other files placed there are going to be left on the system in
# /installpkg-$(mcookie). That could be worked around, but we'll wait until
# someone reports there is a need. The main reason to do this is that /install
# was a collision point if more than one copy of installpkg was running at
# once. With this change, the pkgtools are (more or less) thread-safe.

"Other files placed there" include the README from l-smash:
the script incorrectly installed it in $PKG/install instead of
$PKG/usr/doc/$PRGNAM-$VERSION.

You could also edit any slackbuild in the repo and add a command like
"touch $PKG/install/somefile" before the makepkg command, to see what
happens.

You can also duplicate the problem with a 'skeleton' slackware package:

   rm -rf /tmp/foo
   mkdir -p /tmp/foo/{usr/bin,install}
   cd /tmp/foo
   touch usr/bin/foo install/slack-desc install/bad.file
   makepkg -l y -c n /tmp/foo-0.0-noarch-1.tgz

...if you then say "installpkg /tmp/foo-0.0-noarch-1.tgz", followed by
"ls /", you'll see a /installpkg-<hash> directory has been created. If
you remove the package, that directory doesn't get removed. If you
install it again, another directory (with a different hash) will get
created.

If you re-run that set of commands, without the "install/bad.file"
in the touch command, you *won't* get a /installpkg-<blah> directory
after the package is installed. (installpkg will create such a
directory, but it will then remove it).


More information about the SlackBuilds-users mailing list