LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 10-17-2006, 09:47 AM   #1
TL_CLD
Member
 
Registered: Sep 2006
Posts: 342

Rep: Reputation: 34
Tagfiles - did someone do the hard work already?


Hey all,

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?

Regards,
Thomas
 
Old 10-18-2006, 05:14 AM   #2
danieldk
Member
 
Registered: Aug 2002
Posts: 150

Rep: Reputation: 15
This may be useful:
http://www.slackbasics.org/html/pkgm...gmgmt-tagfiles

This chapter also has a script that can build tagfiles based on the installed system. I used that in the past to make my initial tagfiles.
 
Old 10-18-2006, 05:26 AM   #3
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,384

Rep: Reputation: Disabled
There is also "tagger" which creates a set of tagfiles by inspecting an already installed system.
Look here: http://www.bilbos-stekkie.com/tagger/

Eric
 
Old 10-18-2006, 05:27 AM   #4
TL_CLD
Member
 
Registered: Sep 2006
Posts: 342

Original Poster
Rep: Reputation: 34
Exceptionally cool! Thanks a lot guys.


Thomas
 
Old 10-18-2006, 09:45 AM   #5
danieldk
Member
 
Registered: Aug 2002
Posts: 150

Rep: Reputation: 15
Quote:
Originally Posted by Alien Bob
There is also "tagger" which creates a set of tagfiles by inspecting an already installed system.
Look here: http://www.bilbos-stekkie.com/tagger/
Eric: the tagger in the Slack Basics book is based on the idea of Peter's (Bilbo) tagger. Though it is slightly cleaner.
 
Old 10-18-2006, 09:50 AM   #6
danieldk
Member
 
Registered: Aug 2002
Posts: 150

Rep: Reputation: 15
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!"

I'll put it online somewhere.
 
Old 10-18-2006, 11:26 AM   #7
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,384

Rep: Reputation: Disabled
Hi Daniel

I took your code and added commandline switches and some sanity checks to it, and uploaded the resulting script as tagfile_generator.sh
Free for all.

Cheers, Eric
 
Old 10-18-2006, 11:42 AM   #8
danieldk
Member
 
Registered: Aug 2002
Posts: 150

Rep: Reputation: 15
Great work Eric!
 
Old 10-18-2006, 07:02 PM   #9
pkn
LQ Newbie
 
Registered: Oct 2006
Location: Netherlands
Distribution: Slackware, CentOS and FC
Posts: 12

Rep: Reputation: 0
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....

Last edited by pkn; 10-18-2006 at 07:04 PM.
 
Old 10-19-2006, 03:54 PM   #10
IvanPro
LQ Newbie
 
Registered: Oct 2006
Location: Italia
Distribution: Slackware 11.0
Posts: 15

Rep: Reputation: 0
Hello Alien Bob

tried your script but it gives this error

Slackware source '/home/ftp/pub/Linux/Slackware/slackware-11.0/slackware' does not exist!

I've had a look to it in a text editor and noticed the line

SRCDIR=${SRCDIR:-~ftp/pub/Linux/Slackware/slackware-11.0/slackware}

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... ;->)

regards.

ivanpro.
 
Old 10-20-2006, 07:10 PM   #11
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: Tupelo, MS
Distribution: Gentoo
Posts: 6,926

Rep: Reputation: 124Reputation: 124
IvanPro,

In Eric's script
Code:
SRCDIR=${SRCDIR:-~ftp/pub/Linux/Slackware/slackware-11.0/slackware}
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:
Code:
SRCDIR=${SRCDIR:-/server2/ftp/pub/Linux/Slackware/slackware-current/slackware}
Nice script Peter, Daniel, and Eric.
 
Old 10-21-2006, 04:31 AM   #12
pkn
LQ Newbie
 
Registered: Oct 2006
Location: Netherlands
Distribution: Slackware, CentOS and FC
Posts: 12

Rep: Reputation: 0
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/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
No floppy drive, can I do tagfiles from HD? dustin_wielenga Slackware 0 02-13-2005 11:23 PM
tagfiles for Amigo? carolinus Amigo 1 02-04-2005 11:14 AM
Editing tagfiles for new kernel? Makaelin Slackware - Installation 1 12-18-2004 12:53 AM
Minimal Install Tagfiles --- Slack 10? Nitrox Slackware 5 10-12-2004 09:58 PM
creating tagfiles from existing installation abs Slackware 1 10-31-2003 07:14 PM


All times are GMT -5. The time now is 08:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration