#!/bin/sh # # Copyright 2003 by Tony Brijeski # # Licensed under the GPL2 License # # # This little script is used to repackage a Slackware package # that is installed on your system back into the original tgz package. # # Main uses are for repacking your customizations or for making a backup # of the package before removing it from the system so you can reinstall # it if you wish (nobody is perfect!). # # This version only works on 1 package at a time # # lodir="`pwd`" if [ -a /tmp/retgz.tmp ]; then rm -f /tmp/retgz.tmp fi if [ "$1" = "" ]; then echo "Usage - retgz package-name " echo " " echo " package-name is the entry in /var/log/packages" echo " " exit 1 fi if [ -a /var/log/packages/$1 ]; then cd / mkdir /install if [ -a /var/log/scripts/$1 ]; then cp /var/log/scripts/$1 /install/doinst.sh fi cat /var/log/packages/$1 | grep ":" >>/install/slack-desc cat /var/log/packages/$1 | grep "/" >>/tmp/retgz.tmp if [ -a /install/doinst.sh ]; then tar cvpf $lodir/$1 ./install/doinst.sh ./install/slack-desc else tar cvpf $lodir/$1 ./install/slack-desc fi cat /tmp/retgz.tmp | while read LINE; do if [ ! "$LINE" = "" ]; then tst1=`echo "$LINE" | grep "doinst.sh"` tst2=`echo "$LINE" | grep "slack-desc"` tst3=`echo "$LINE" | awk -F/ '{print $NF}'` if [ "$tst1" = "" ] && [ "$tst2" = "" ]; then if [ ! "$tst3" = "" ]; then tar rvpf $lodir/$1 ./$LINE fi fi fi done else echo "Package $1 not installed" exit 1 fi rm -rf /install rm -f /tmp/retgz.tmp cd $lodir gzip -S .tgz $1 echo " Package $1.tgz is in $lodir " exit 0