[Slackbuilds-users] template idea: --no-same-owner

B. Watson urchlay at slackware.uk
Sun Aug 9 21:28:13 UTC 2026


So the templates all do this:

rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .

...but looking at the tar man page, there's this:

   --no-same-owner
          Extract files as yourself (default for ordinary users).

...which would extract the tarball and set the ownership to root:root
in one step. I don't know when this option got added to tar, but it
seems like using it would simplify things (do the same job in less
code).

So the template would look something like:

rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz --no-same-owner
cd $PRGNAM-$VERSION

There's also this:

--no-same-permissions
        Apply the user's umask when extracting permissions from the archive (default for or‐
        dinary users).

...which might substitute for (or at least simplify) the find/chmod stuff.

Thoughts?


More information about the SlackBuilds-users mailing list