3. So what are tagfiles?

If you've ever browsed around on a Slackware install CD-Rom you must have noticed that the packages are organized in software series. For each of the software series there is a sub-directory in the /slackware directory. If you would put CD1 and CD2 together you would have a structure like this:

|-- a
|-- ap
|-- d
|-- e
|-- f
|-- gnome
|-- k
|-- kde
|-- kdei
|-- l
|-- n
|-- t
|-- tcl
|-- x
|-- xap
`-- y

Each of these directories contains the packages belonging to that serie, and each of these directories has an extra file named tagfile. The tagfile is used by the package manager to decide if a package is required, recommended, optional or should be skipped. In the file there is a line for each of the packages in the serie. I.e. the original tagfile for the "a" software serie (Slackware 10.1.0) looks like this:

# This is a Slackware Installation Tagfile.
# This one comes from disk: A1 (Base Linux series)
# and a backup copy called "tagfile.org" can be found on the same disk. You
# should never edit the "tagfile.org" copy, only the one called "tagfile". Use
# the "tagfile.org" only if you want to restore original installation defaults
# by copying it over the top of "tagfile".
# It is used to automate software installation. 
# There are two labels that you can use: ADD and SKP.
# If the PROMPT option is used during installation, this file will be checked
# to determine the installation default. First, all the lines beginning with
# <package_name>: 
# will be extracted. Then, the last line in the extracted segment will be 
# checked for the flags ADD, REC, OPT and SKP.
# If ADD is found, then a priority of [required] will be displayed, and the
# package will be automatically installed. 
# If SKP is found, then a priority of [skip] will be displayed, and
# the package will be automatically skipped.
# All other packages will be prompted for. There are two optional flags you
# can use to change the package priority level shown when the user is 
# prompted: REC and OPT. If REC is found, the priority shown will be
# [recommended], while if OPT is found, the user sees priority [optional].
# If no flags are found for a given package, the user is shown priority
# [unknown], and is prompted for whether the package should be installed.
# If you mess this file up beyond recognition, just restore from "tagfile.org"
aaa_base: ADD
aaa_elflibs: ADD
acpid: REC
apmd: REC
bash: ADD
bin: ADD
bzip2: ADD
coreutils: ADD
cpio: ADD
cups: REC
cxxlibs: ADD
dcron: ADD
devs: ADD
e2fsprogs: ADD
elvis: ADD
etc: ADD
findutils: ADD
floppy: ADD
gawk: ADD
genpower: OPT
gettext: REC
getty-ps: OPT
glibc-solibs: ADD
glibc-zoneinfo: ADD
gpm: REC
grep: ADD
gzip: ADD
hdparm: ADD
hotplug: ADD
infozip: ADD
isapnptools: OPT
jfsutils: OPT
kbd: REC
kernel-ide: REC
kernel-modules: ADD
less: ADD
lilo: ADD
loadlin: REC
logrotate: ADD
minicom: REC
mkinitrd: REC
module-init-tools: ADD
openssl-solibs: ADD
pciutils: OPT
pcmcia-cs: REC
pkgtools: ADD
procps: ADD
reiserfsprogs: ADD
sed: ADD
shadow: ADD
slocate: ADD
smartmontools: ADD
sysklogd: ADD
syslinux: ADD
sysvinit: ADD
tar: ADD
tcsh: REC
udev: ADD
umsdos-progs: ADD
usbutils: ADD
utempter: REC
util-linux: ADD
xfsprogs: OPT

Beware: The comments in this file are not up to date. There is no "A1" serie anymore, there are no tagfile.org files anymore. But the rest of the comments explain quite a bit about the format of this file.

To summarize this info:

The SKP option is kinda funny. What use is a package in a series if you must skip it? Well actually, if you would inspect the default tagfiles you would not find a package with the SKP option. The SKP option is there so that we can make our own tagfiles to do an automatic packages install via the "tagpath" option in the Slackware installer, it gives us the means not to install a package.

Just like the SKP option for an interactive installer, the REC and OPT options are without meaning for an automated install. They both require the user to decide wether or not to install the package.

So what we would need is a set of tagfiles, organized like the original tagfiles in a directory per serie, with one line for each package, just using the ADD or SKP option. While it is not a difficult task to make such a structure of files, you can take them from the Slackware CD-Rom, editing them to reflect the proper choices is tedious job in which errors are easialy made.

I decided to automate these processes and wrote two scripts to do this work for me. The first script wil make a directory structure filled with the tagfiles from a Slackware CD-Rom (or from an other location if you want). The second script will use an allready installed system as a guideline to write new tagfiles. By using the new tagfiles for a new install I would get a system with exactly the same packages as the model system.