Over the years of fiddeling with various slackware installations, I've compiled a bunch of tools (most of which hardly would be of use for anybody else) to assist me in breaking^Wadministering my systems. And since I finally decided to learn how to handle git, I might as well share some programs that someone might find useful.
git repo:
https://github.com/e5150/dst
tarball:
https://github.com/e5150/dst/archive/14.1.0.tar.gz (`make && make install`, or `make pkg && installpkg /tmp/darkstar-tools-*.tgz`, no ./configure)
For more detailed info, see the man pages (available as <prog>.md in the git repo).
mkslack-desc - make proper slack-desc
usage: mkslack-desc <package-name> <short-description>
reads (long) package description from stdin, prints properly formated slack-desc on stdout (given that the entire description fits on 11 lines)
darkstar-installed - querys the package database for installed packages
usage: darkstar-installed <package name> ...
<package name> can be a package filename ("/some/path/nc-1.10-x86_64-1.txz"), package basename ("xz-5.0.5-x86_64-1") or package name ("xz", "glibc-solibs").
Potentially useful example: darkstar-installed $MIRROR/slackware-current/a/*.t?z
darkstar-packcontent - prints content of installed packages. (Maybe useful for people who, like me, relentlessly removes /usr/share/locale and other "useless" stuff.)
usage: darkstar-packcontent [-vd] [-p|-c|-e|-m] /var/log/packages/<pkg [...]>
Prints package file list | checks for file presence | prints existing | prints missing files; according to "FILE LIST:" in the package database, compared to what's actually on the / filesystem. Should properly handle /lib{64,}/incoming, /etc/*.new and such.
usage: darkstar-packcontent -s /var/log/packages/<pkg [...]>
Computes the actuall installed size of a package, only counting files that are found on the system.
packcontent-derived:
darkstar-notinpkg - prints files that are present on the /, /opt or /usr filesystems, but don't belong to any package (ignoring /var/log/* and such).
darkstar-notonsys (symlink to noinpkg) - prints files that have been installed with some package, but aren't present on the system any longer.
darkstar-packname - print package name, e.g. "glibc" is returned for "glibc-2.17-x86_64-10_slack14.1.txz", and "glibc-zoneinfo" for "glibc-zoneinfo-2014j-noarch-1.txz". Does the same thing as the package_name() function in /sbin/installpkg, but, much quicker on bulk input (on my machine darkstar-packname parses slackware-14.1/*/*/*.txz in less than 100ms, while darkstar-packname-stock.sh (cut out from installpkg) takes 54s (yes, i know, some unreadable perl-one-liner could probably do it in less that 1s as well)).
usage: darkstar-packname [-v] <package [...]>
elfdeps <file [...]> - query ELF-files for needed libraries, and tries to locate them. Unlike ldd(1), it doesn't resolve library dependencies, but simply search input files for DT_NEEDED (like `objdump -p file | grep NEEDED`), and looks in {,/usr,/usr/local}/lib{,64} and the file's DT_RPATHs, if any, for the library. Each library directory is only read once, regardless of the number of input files, no recursive dependancies are "resolved". It is somewhat susceptible to false negatives.
Example, search / for files with "unresolved dependencies": find / -xdev -type f -perm -100 -exec elfdeps {} + 2>/dev/null | grep :missing$
cugfd - change user/group/file/directory ownership and permissions
cugfd [-KDq] [-u user] [-g group] [-f file-mode] [-d dir-mode] <path [...]>
Recursively changes ownership and/or permissions on files and directories. By default (unless -K), the executable bit will be kept for those with read access. Altough it is not technically slackware related, I tend to use it in my local *.SlackBuild scripts; `cugfd -u root -g root -f 644 -d 755 .`, rather than `chown -R root:root . ; find -L . \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) -exec chmod 755 {} \; -o \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \)
-exec chmod 644 {} \;`.