SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I've ventured into the realm of tagfile editing, because I would like to speed up the time it takes me to select what I want and what I don't want, but before I start messing around with the entire thing, I thought I would ask if someone here had already done all the hard work?
What I want is tagfiles for a barebones server. Network, SSH and the different developer tools for future compiling of software. And that's it.
Anybody who've already done such a bunch of tagfiles, and if so, would you be willing to share?
Ah, mind-f*ckup from my side. The new tagger was in the development version of the Slack Basics book. Since the book is pretty much in maintenance mode it was not added to the 10.2 book. So, here it is from the snapshot:
Tagfile copy:
Code:
#!/bin/sh
if [ ! $# -eq 1 ] ; then
echo "Syntax: $0 [directory]"
exit
fi
for tagfile in $1/*/tagfile; do
setdir=`echo ${tagfile} | egrep -o '\w+/tagfile$' | xargs dirname`
mkdir ${setdir}
cp ${tagfile} ${setdir}/tagfile.org
cp ${tagfile} ${setdir}
done
The tagger:
Code:
#!/bin/sh
if [ ! $# -eq 1 ] ; then
echo "Syntax: $0 [directory]"
exit
fi
for tforg in $1/*/tagfile.org ; do
tf=${tforg%.org}
rm -f ${tf}
for package in $(grep -v '^#' ${tforg} | cut -d ':' -f 1) ; do
if ls /var/log/packages/${package}-[0-9]* &> /dev/null ; then
echo "${package}: ADD" >> ${tf}
else
echo "${package}: SKP" >> ${tf}
fi
done
done
Subscript (from the book):
"With a simple script, it is also possible to build tagfiles based
on the packages that are installed on the current system. I owe
thanks to Peter Kaagman for coming up with this nifty idea!"
Funny to see these things pop up now and than, never realized that those little scripts would ever be of interest of anyone but myself..... wrote them - in my own clumsy style - to get a better grasp of the whole tagfile idea. And now someone with a real understanding of scripting makes something nice out of them....
what is the correct way to edit the line for my install (pretty much a standard slack11 install)? sorry if the question is st00pid, but I don't understand much about scripts and how they work (and besides, I'm a n00b... ;->)
is the location of your Slackware source directory (SRCDIR).
So if you don't have the sources on your computer you will
probably need to change that path to reflect a CD/DVD, or
copy the contents of the CD/DVD to a directory on your comp,
then change that line appropriately. I.e., my source is at:
For the origional script it was true you had to change it to point to the right source.... Eric made it a bit more sophisticated
Code:
# Parse the commandline options:
while getopts "hs:d:" Option
do
case $Option in
s ) SRCDIR=${OPTARG}
;;
d ) DSTDIR=${OPTARG}
;;
h|* ) echo "Parameters are:"
echo " -h This help."
echo " -s <slackdir> The slackware root directory, below which"
echo " you find the package directories a,ap,....y"
echo " -d <destdir> Destination directory for generating tagfiles"
exit
;; # DEFAULT
esac
done
Did not run the script.... yet... but it seems logical that the source dir is given in with the -s option.
What I am wondering about is this:
I made 2 separate scripts because there are 2 CDs.... the first script had to run 2 times to get all the origional tagfiles from the CDs. After that the second script would make the new tagfiles based on /var/log/packages.
But that is no biggy... I wil just try it out... and learn some more bash... thanks Eric \o/
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.