2008-05-03 17:01:13 +00:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
#Framework, welches ein komplettes Linux System aus den Sourcen erstellt
|
|
|
|
|
#dieses Framework wird im CVS Repository
|
|
|
|
|
#:pserver:cvs.tramp-bbs.de:/opt/cvs zur Verf<72>gung gestellt
|
|
|
|
|
#
|
|
|
|
|
#Lage dieser Datei im Archiv: $HeadURL$
|
|
|
|
|
#
|
|
|
|
|
#(c) 2007 Harald Kueller, Germany
|
|
|
|
|
#This program is free software; you can redistribute it and/or
|
|
|
|
|
#modify ist under the terms of the GNU General Public License
|
|
|
|
|
#as published by the Free Software Foundation; either version
|
|
|
|
|
#2 of the License, or (at your option) any later version.
|
|
|
|
|
#
|
|
|
|
|
#This program is distributed in the hope that it will be useful,
|
|
|
|
|
#but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
#See the GNU General Public License for more details.
|
|
|
|
|
#
|
|
|
|
|
#You should have received a copy of the GNU General Public License
|
|
|
|
|
#along with this program; if not write to the Free Software Foundation,
|
|
|
|
|
#Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
#
|
|
|
|
|
#Beschreibung:
|
|
|
|
|
#Funktionssammlung f<>r genpkg script des ViitorMake Frameworks
|
|
|
|
|
#
|
|
|
|
|
#checkError():
|
|
|
|
|
#Beschreibung: Ueberpruefen des zuletzt gelaufenen Befehls. Bei Erfolgreicher
|
|
|
|
|
# Beendigung des Befehls wir keine Aktion vorgenommen.
|
|
|
|
|
# Ansonsten Ausgabe der Fehlermeldung <MESSAGE>, Aufr<66>umen mit
|
|
|
|
|
# cleanup Funktion, und Beenden des Scriptes
|
|
|
|
|
#Argumente: MESSAGE
|
|
|
|
|
#MESSAGE : Auszugebene Fehlermeldung
|
|
|
|
|
#
|
|
|
|
|
#
|
|
|
|
|
#CleanUp():
|
|
|
|
|
#Beschreibung: Aufr<66>umen des Systemes nach Erstellung eines Packetes, oder
|
|
|
|
|
#bei Abbruch des genpkg scriptes
|
|
|
|
|
#
|
|
|
|
|
#Argumente: Keine
|
|
|
|
|
#Steuervariablen: Diese Variablen muessen zum Aufrufzeitpunkt gesetzt sein
|
|
|
|
|
# und haben folgende Bedeutung:
|
|
|
|
|
#CLEANUP_FLAGS : 1=MAKEDIR aufr<66>umen
|
|
|
|
|
# 2=TMPROOT aufr<66>umen
|
|
|
|
|
#PROGNAME : Name des Programmpacketes, welches gerade
|
|
|
|
|
# erstellt wurde
|
|
|
|
|
#TMPROOT : Verzeichniss in welchem die bin<69>r
|
|
|
|
|
# Dateien zur Erstellung von Packeten
|
|
|
|
|
# erstellt werden.
|
|
|
|
|
#MAKEDIR : Verzeichniss in welchem die Sourcen
|
|
|
|
|
# Entpackt und <20>bersetzt werden
|
|
|
|
|
#
|
|
|
|
|
#
|
|
|
|
|
#GetSuffix()
|
|
|
|
|
#
|
|
|
|
|
#Beschreibung : Ermittlung des Datei Suffixes. Datei Suffix wird auf
|
|
|
|
|
# : stdout ausgegeben
|
|
|
|
|
#
|
|
|
|
|
#Argumente : FILENAME
|
|
|
|
|
#FILENAME : Name des Files, von welchem der Datei Suffix ermittelt
|
|
|
|
|
# : werden soll
|
|
|
|
|
#
|
|
|
|
|
#
|
|
|
|
|
#SrcPatch()
|
|
|
|
|
#Beschreibung : Anwenden eines Patches auf ein Verzeichniss (Recursiv)
|
|
|
|
|
#Argumente : DSTPATH, PATCHFILE
|
|
|
|
|
#DSTPATH : Verzeichniss in welchem der Patch angewendet werden soll
|
|
|
|
|
#PATCHFILE : Patchdatei die verwendet werden soll (nicht, gzip oder bzip2
|
|
|
|
|
# : comprimiert)
|
|
|
|
|
#
|
|
|
|
|
#UnPack()
|
|
|
|
|
#Beschreibung : Entpacken von tar Archiven. Dabei wird automatisch erkannt
|
|
|
|
|
# ob die Archive gzip, bzip2 oder gar nicht comprimiert sind
|
|
|
|
|
# und die entsprechend notwendigen Tar Optionen ermittelt
|
|
|
|
|
#Argumente : DSTPATH; FILENAME
|
|
|
|
|
#DSTPATH : Zielverzeichniss, in welchem das Archiv <FILENAME> entpackt
|
|
|
|
|
# werden soll.
|
|
|
|
|
#FILENAME : Dateiname des Archives welches nach <DSTPATH> entpackt werden
|
|
|
|
|
# soll
|
|
|
|
|
#
|
|
|
|
|
#ArchiveName()
|
|
|
|
|
#Beschreibung : Generiert den pkgname aus den Namen eines source Archives
|
|
|
|
|
# Der pkgname wird auf stdout ausgegeben
|
|
|
|
|
#Argumente : $FILENAME
|
|
|
|
|
#FILENAME : Name des SOURCE Archives
|
|
|
|
|
#
|
|
|
|
|
#
|
|
|
|
|
#GetSVN()
|
|
|
|
|
#Beschreibung : Einspielen eines SVN Projectes (Add On zu erstellten pkgs)
|
|
|
|
|
# in den pkgtree
|
|
|
|
|
#Steuervariablen: SVNURL
|
|
|
|
|
#CVSROOT : Angabe des Repositorys in welchem das Project zu finden ist
|
|
|
|
|
#
|
|
|
|
|
#Argumente : CVSPROJ, PKGROOT
|
|
|
|
|
#CVSPROJ : Name eines Projectes
|
|
|
|
|
#PKGROOT : Zielverzeichniss, in welchem das pkg entpackt vorliegt
|
|
|
|
|
#
|
|
|
|
|
#Argumente : CVSPROJ, PKGROOT
|
|
|
|
|
#CVSPROJ : Name eines Projectes
|
|
|
|
|
#PKGROOT : Zielverzeichniss, in welchem das pkg entpackt vorliegt
|
|
|
|
|
#
|
|
|
|
|
#
|
|
|
|
|
#GenDependics()
|
|
|
|
|
#Beschreibung : Abh<62>ngigkeiten zu anderen Programmpacketen ermitteln
|
|
|
|
|
# mit ldd werden s<>mtliche executable Dateien eines
|
|
|
|
|
# PKGROOT Verzeichnisses auf Abh<62>ngigkeiten untersucht. Aus
|
|
|
|
|
# Anhand der Ermittelten Dateien wird mittels der Filelisten
|
|
|
|
|
# unter /var/install ermittelt welche Packete diese Dateien
|
|
|
|
|
# enthalten, und so eine liste der Packete von welchen
|
|
|
|
|
# die files unter PKGROOT abh<62>ngig sind, erstellt.
|
|
|
|
|
#Argumente : PKGROOT
|
|
|
|
|
#PKGROOT : Verzeichniss in welchem die Abh<62>ngigkeiten ermittelt werden
|
|
|
|
|
# sollen
|
|
|
|
|
#
|
|
|
|
|
#StripPkg()
|
|
|
|
|
#Beschreibung : Entfernt unn<6E>tigen debugging overhead aus frisch <20>bersetzten
|
|
|
|
|
# binarys. Die Funktion wirkt auf alle in einem Verzeichniss
|
|
|
|
|
# befindlichen executable files.
|
|
|
|
|
#Argumente : PKGPATH
|
|
|
|
|
#PKGPATH Verzeichniss in welchem die Binarys "gestript" werden sollen
|
|
|
|
|
#
|
|
|
|
|
#GetFlags()
|
|
|
|
|
#Beschreibung : rechnet einen ASCI Rechte String (drwsrwsrwt) in die
|
|
|
|
|
# entsprechende 4 stellige Octalziffer um
|
|
|
|
|
#Argumente : Rechte String in ASCII
|
|
|
|
|
#
|
|
|
|
|
#Letzte <20>nderung von: $Author$
|
|
|
|
|
#Datum der letzten <20>nderung: $Date$
|
|
|
|
|
#Version der Datei: $Revision$
|
|
|
|
|
#
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
CheckError() {
|
|
|
|
|
MESSAGE=$1
|
|
|
|
|
|
|
|
|
|
if [ ! "$?" == 0 ]; then
|
|
|
|
|
echo $MESSAGE
|
|
|
|
|
CleanUp
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CleanUp() {
|
|
|
|
|
(( TESTFLAG = $CLEANUP_FLAGS & 1 ))
|
|
|
|
|
if [ ! "$TESTFLAG" == "0" ]; then
|
2009-12-23 18:04:46 +00:00
|
|
|
|
rm -rf $MAKEDIR/$SRCDIR*
|
2008-05-03 17:01:13 +00:00
|
|
|
|
fi
|
|
|
|
|
(( TESTFLAG = $CLEANUP_FLAGS & 2 ))
|
|
|
|
|
if [ ! "$TESTFLAG" == "0" ]; then
|
2009-12-23 18:04:46 +00:00
|
|
|
|
rm -rf $TMPROOT
|
2008-05-03 17:01:13 +00:00
|
|
|
|
if [ -d "$MANTMPROOT" ]; then
|
2009-12-23 18:04:46 +00:00
|
|
|
|
rm -rf $MANTMPROOT
|
2008-05-03 17:01:13 +00:00
|
|
|
|
fi
|
|
|
|
|
if [ -d "$DEVTMPROOT" ]; then
|
2009-12-23 18:04:46 +00:00
|
|
|
|
rm -rf $DEVTMPROOT
|
2008-05-03 17:01:13 +00:00
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
(( TESTFLAG = $CLEANUP_FLAGS & 4 ))
|
|
|
|
|
if [ ! "$TESTFLAG" == "0" ]; then
|
|
|
|
|
InstallOldKernelh 0
|
|
|
|
|
fi
|
|
|
|
|
(( TESTFLAG = $CLEANUP_FLAGS & 8 ))
|
|
|
|
|
if [ ! "$TESTFLAG" == "0" ]; then
|
|
|
|
|
UseOldGcc 0
|
|
|
|
|
fi
|
|
|
|
|
(( TESTFLAG = $CLEANUP_FLAGS & 16 ))
|
|
|
|
|
if [ ! "$TESTFLAG" == "0" ]; then
|
2009-12-23 18:04:46 +00:00
|
|
|
|
rm -f /usr/X11R6
|
2008-05-03 17:01:13 +00:00
|
|
|
|
fi
|
2010-12-20 09:05:10 +00:00
|
|
|
|
#(( TESTFLAG = $CLEANUP_FLAGS & 32 ))
|
|
|
|
|
#if [ ! "$TESTFLAG" == "0" ]; then
|
|
|
|
|
#Fix_Input_h 0
|
|
|
|
|
#fi
|
2008-05-03 17:01:13 +00:00
|
|
|
|
(( TESTFLAG = $CLEANUP_FLAGS & 64 ))
|
|
|
|
|
if [ ! "$TESTFLAG" == "0" ]; then
|
|
|
|
|
PKG_CONFIG_PATH=$STOREPKG_CONFIG_PATH
|
|
|
|
|
fi
|
|
|
|
|
if [ -d /usr/include/linux.orig ]; then
|
2009-12-23 18:04:46 +00:00
|
|
|
|
rm -f /usr/include/linux
|
2008-05-03 17:01:13 +00:00
|
|
|
|
mv /usr/include/linux.orig /usr/include/linux
|
|
|
|
|
fi
|
|
|
|
|
return 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GetSuffix() {
|
|
|
|
|
FILENAME=$1
|
|
|
|
|
|
|
|
|
|
echo $1|awk -F. '{ print $NF }'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SrcPatch() {
|
|
|
|
|
DSTPATH=$1
|
|
|
|
|
PATCHFILE=$2
|
|
|
|
|
|
|
|
|
|
cd $DSTPATH
|
|
|
|
|
SUFFIX=`GetSuffix $PATCHFILE`
|
|
|
|
|
PATCHNAME=`echo $PATCHFILE|sed -e "s/\.$SUFFIX.*$//"`
|
|
|
|
|
case $SUFFIX in
|
|
|
|
|
gz)
|
|
|
|
|
gzip -d $PATCHFILE
|
|
|
|
|
CheckError "Could not ungzip $PATCHFILE"
|
|
|
|
|
;;
|
|
|
|
|
bz2)
|
|
|
|
|
bzip2 -d $PATCHFILE
|
|
|
|
|
CheckError "Could not unbzip2 $PATCHFILE"
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
PATCHNAME=$PATCHFILE
|
|
|
|
|
SUFFIX=bzip2
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
patch -Np1 -i $PATCHNAME
|
|
|
|
|
CheckError "Patch $PATCHNAME failed"
|
|
|
|
|
case $SUFFIX in
|
|
|
|
|
gz)
|
|
|
|
|
gzip $PATCHNAME
|
|
|
|
|
CheckError "Compression of $PATCHNAME with gzip failed"
|
|
|
|
|
;;
|
|
|
|
|
bz2)
|
|
|
|
|
bzip2 $PATCHNAME
|
|
|
|
|
CheckError "Compression of $PATCHNAME with bzip2 failed"
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
cd -
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UnPack() {
|
|
|
|
|
DSTPATH=$1
|
|
|
|
|
FILENAME=$2
|
|
|
|
|
|
|
|
|
|
SUFFIX=`GetSuffix $FILENAME`
|
|
|
|
|
if [ "$SUFFIX" ]; then
|
|
|
|
|
case "$SUFFIX" in
|
|
|
|
|
gz|tgz|Z)
|
|
|
|
|
TAROPTS="zxvf"
|
|
|
|
|
;;
|
|
|
|
|
bz2|tbz)
|
|
|
|
|
if ( tar --version|grep 1.13.25 >/dev/null 2>&1 ); then
|
|
|
|
|
TAROPTS="jxvf"
|
|
|
|
|
else
|
|
|
|
|
TAROPTS="jxvf"
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
tar)
|
|
|
|
|
TAROPTS="xvf"
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
echo "Unknown Suffix for unpack()"
|
|
|
|
|
return 1
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
cd $DSTPATH
|
|
|
|
|
tar $TAROPTS $FILENAME
|
|
|
|
|
CheckError "Unpack of $FILENAME failed"
|
|
|
|
|
cd - >/dev/null
|
|
|
|
|
fi
|
|
|
|
|
return 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ArchiveName() {
|
|
|
|
|
FILENAME=$1
|
2009-07-15 20:24:02 +00:00
|
|
|
|
if [ "$2" == "1" ]; then
|
2009-07-14 04:49:30 +00:00
|
|
|
|
FLAG=$2
|
|
|
|
|
else
|
|
|
|
|
FLAG=""
|
|
|
|
|
fi
|
2008-05-03 17:01:13 +00:00
|
|
|
|
|
|
|
|
|
SUFFIX=`GetSuffix $FILENAME`
|
|
|
|
|
BASENAME=`echo $FILENAME|sed -e "s/\.$SUFFIX.*$//"`
|
|
|
|
|
SUFFIX=`GetSuffix $BASENAME`
|
|
|
|
|
if [ "$SUFFIX" == "tar" ]; then
|
|
|
|
|
BASENAME=`echo $BASENAME|sed -e "s/\.$SUFFIX.*$//"`
|
|
|
|
|
fi
|
|
|
|
|
BASENAME=`basename $BASENAME`
|
2009-07-15 20:24:02 +00:00
|
|
|
|
if [ ! "$FLAG" == "1" ]; then
|
2009-07-14 04:49:30 +00:00
|
|
|
|
ARCHIVENAME=`echo $BASENAME|sed -e "s/src/bin/"|sed -e "s/SRC/BIN/"| \
|
|
|
|
|
sed -e "s/source/binary/"|sed -e "s/SOURCE/BINARY/"`
|
|
|
|
|
else
|
|
|
|
|
ARCHIVENAME=$BASENAME
|
|
|
|
|
fi
|
2009-10-22 16:57:26 +00:00
|
|
|
|
echo $ARCHIVENAME.vpg
|
2008-05-03 17:01:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GetSVN() {
|
|
|
|
|
CDIR=`pwd`
|
|
|
|
|
SVNPROJ=$1
|
|
|
|
|
PKGROOT=$2
|
|
|
|
|
|
|
|
|
|
export ADDONPROJEKT=$1
|
|
|
|
|
mkdir /tmp/svntmp$$
|
|
|
|
|
cd /tmp/svntmp$$
|
|
|
|
|
if [ "$CVSASK" ]; then
|
|
|
|
|
echo "Zugriff auf $SVNURL wird ben<65>tigt"
|
|
|
|
|
echo "Bitte Internetverbindung herstellen"
|
|
|
|
|
echo "und beliebige Taste dr<64>cken"
|
|
|
|
|
read
|
|
|
|
|
fi
|
2010-08-12 12:13:59 +00:00
|
|
|
|
svn export $SVNURL/$SVNPROJ
|
2008-05-03 17:01:13 +00:00
|
|
|
|
cd $SVNPROJ
|
2010-08-12 12:13:59 +00:00
|
|
|
|
ADDONVERSION=`svn info $SVNURL/$SVNPROJ|grep Revision|awk '{print $2}'`
|
2008-05-03 17:01:13 +00:00
|
|
|
|
for i in `find . -type d`; do
|
|
|
|
|
case $i in
|
|
|
|
|
./etc)
|
|
|
|
|
chmod 644 `find etc -type f`
|
|
|
|
|
;;
|
|
|
|
|
./etc/init.d)
|
|
|
|
|
chmod 755 `find etc/init.d -type f`
|
|
|
|
|
;;
|
|
|
|
|
./etc/sysconfig)
|
|
|
|
|
chmod 644 `find etc/sysconfig -type f`
|
|
|
|
|
;;
|
|
|
|
|
./etc/sysconfig/profile.d)
|
|
|
|
|
chmod 755 `find etc/sysconfig/profile.d -type f`
|
|
|
|
|
;;
|
|
|
|
|
./locale)
|
|
|
|
|
for i in locale/*; do
|
|
|
|
|
BASE=`basename $i|cut -d "." -f 1`
|
|
|
|
|
CO=`basename $i|cut -d "." -f 3`
|
|
|
|
|
DSTDIR=$PKGROOT/usr/share/locale/$CO/LC_MESSAGES
|
|
|
|
|
if [ ! -d $DSTDIR ]; then
|
|
|
|
|
mkdir -p $DSTDIR
|
|
|
|
|
fi
|
|
|
|
|
msgfmt $i -o $DSTDIR/$BASE.mo
|
|
|
|
|
done
|
2009-12-23 18:04:46 +00:00
|
|
|
|
rm -rf locale
|
2008-05-03 17:01:13 +00:00
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
done
|
|
|
|
|
if [ -f init/genpkg ]; then
|
|
|
|
|
source init/genpkg
|
2009-12-23 18:04:46 +00:00
|
|
|
|
rm -rf init
|
2008-05-03 17:01:13 +00:00
|
|
|
|
fi
|
|
|
|
|
cp -rp * $PKGROOT
|
|
|
|
|
cd $CDIR
|
2009-12-23 18:04:46 +00:00
|
|
|
|
rm -rf /tmp/svntmp$$
|
2008-05-03 17:01:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GenDependics() {
|
|
|
|
|
PKGROOT=$1
|
|
|
|
|
|
|
|
|
|
cd $PKGROOT
|
|
|
|
|
if [ -f /tmp/lddlist$$ ]; then
|
2009-12-23 18:04:46 +00:00
|
|
|
|
rm -f /tmp/lddlist$$
|
2008-05-03 17:01:13 +00:00
|
|
|
|
fi
|
2009-11-19 19:53:02 +00:00
|
|
|
|
for execfile in `find $PKGROOT -type f ! -type l -perm -u+rx,g+rx`; do
|
2008-05-03 17:01:13 +00:00
|
|
|
|
if file $execfile |grep "LSB executable" &>/dev/null; then
|
|
|
|
|
ldd $execfile|\
|
|
|
|
|
sed -e "/not a dynamic/d"|\
|
2009-10-23 13:35:00 +00:00
|
|
|
|
awk '{print $1}'
|
2008-05-03 17:01:13 +00:00
|
|
|
|
elif file $execfile|grep "LSB shared object" &>/dev/null; then
|
|
|
|
|
ldd $execfile|\
|
|
|
|
|
sed -e "/not a dynamic/d"|\
|
2009-10-23 13:35:00 +00:00
|
|
|
|
awk '{print $1}'
|
2008-05-03 17:01:13 +00:00
|
|
|
|
fi
|
2009-10-23 13:35:00 +00:00
|
|
|
|
done |sort -u >/tmp/lddlist$$
|
|
|
|
|
if [ -f /tmp/lddlist$$ ]; then
|
2008-05-03 17:01:13 +00:00
|
|
|
|
for i in `cat /tmp/lddlist$$`; do
|
2009-12-23 07:58:47 +00:00
|
|
|
|
grep "$i;" $ROOT/var/install/contents|awk -F";" '{print $1}'|sed -e "s/PN=//"
|
2009-10-23 13:35:00 +00:00
|
|
|
|
done|sort -u
|
2009-12-23 18:04:46 +00:00
|
|
|
|
rm -f /tmp/lddlist$$
|
2008-05-03 17:01:13 +00:00
|
|
|
|
fi
|
|
|
|
|
cd - >/dev/null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
StripPkg() {
|
|
|
|
|
PKGROOT=$1
|
|
|
|
|
|
|
|
|
|
cd $PKGROOT
|
|
|
|
|
for checkfile in `find . -perm -1 -type f `; do
|
|
|
|
|
if file $checkfile|grep "LSB executable" &>/dev/null; then
|
|
|
|
|
strip --strip-all $checkfile
|
|
|
|
|
elif file $checkfile|grep "LSB shared object" &>/dev/null; then
|
|
|
|
|
strip $checkfile
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
cd -
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ClearHostSysNameing32() {
|
|
|
|
|
DESTDIR=$1
|
|
|
|
|
|
|
|
|
|
CURDIR=`pwd`
|
|
|
|
|
cd $DESTDIR
|
|
|
|
|
for i in `find . -name "$TARGET32*"`; do
|
|
|
|
|
NEWNAME=`basename $i`
|
|
|
|
|
PATHNAME=`dirname $i`
|
|
|
|
|
NEWNAME=`echo $NEWNAME|sed -e "s/$TARGET32-//"`
|
|
|
|
|
mv $i $PATHNAME/$NEWNAME
|
|
|
|
|
done
|
|
|
|
|
find . -type l -ls|grep $TARGET32 >/tmp/linklist$$
|
|
|
|
|
exec 3</tmp/linklist$$
|
|
|
|
|
read <&3 LINE
|
|
|
|
|
while [ "$LINE" ]; do
|
|
|
|
|
LINKTO=`echo $LINE|awk '{print $13}'|sed -e "s/$TARGET32-//"`
|
|
|
|
|
LINKFROM=`echo $LINE|awk '{print $11}'`
|
|
|
|
|
FILELINK=`basename $LINKFROM`
|
|
|
|
|
DIRLINK=`dirname $LINKFROM`
|
|
|
|
|
cd $DIRLINK
|
2009-12-23 18:04:46 +00:00
|
|
|
|
rm -f $FILELINK
|
2008-05-03 17:01:13 +00:00
|
|
|
|
ln -s $LINKTO $FILELINK
|
|
|
|
|
cd -
|
|
|
|
|
read <&3 LINE
|
|
|
|
|
done
|
|
|
|
|
exec 3>&-
|
2009-12-23 18:04:46 +00:00
|
|
|
|
rm -f /tmp/linklist$$
|
2008-05-03 17:01:13 +00:00
|
|
|
|
for i in `find . -type l -ls|grep $HOSTSYS`; do
|
|
|
|
|
LINTO=`echo $i|awk '{print $10}'`
|
|
|
|
|
echo $LINTO
|
|
|
|
|
done
|
|
|
|
|
cd $CURDIR
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ClearHostSysNameing() {
|
|
|
|
|
DESTDIR=$1
|
|
|
|
|
|
|
|
|
|
CURDIR=`pwd`
|
|
|
|
|
cd $DESTDIR
|
|
|
|
|
for i in `find . -name "$TARGET*"`; do
|
|
|
|
|
NEWNAME=`basename $i`
|
|
|
|
|
PATHNAME=`dirname $i`
|
|
|
|
|
NEWNAME=`echo $NEWNAME|sed -e "s/$TARGET-//"`
|
|
|
|
|
mv $i $PATHNAME/$NEWNAME
|
|
|
|
|
done
|
|
|
|
|
find . -type l -ls|grep $TARGET >/tmp/linklist$$
|
|
|
|
|
exec 3</tmp/linklist$$
|
|
|
|
|
read <&3 LINE
|
|
|
|
|
while [ "$LINE" ]; do
|
|
|
|
|
LINKTO=`echo $LINE|awk '{print $13}'|sed -e "s/$TARGET-//"`
|
|
|
|
|
LINKFROM=`echo $LINE|awk '{print $11}'`
|
|
|
|
|
FILELINK=`basename $LINKFROM`
|
|
|
|
|
DIRLINK=`dirname $LINKFROM`
|
|
|
|
|
cd $DIRLINK
|
2009-12-23 18:04:46 +00:00
|
|
|
|
rm -f $FILELINK
|
2008-05-03 17:01:13 +00:00
|
|
|
|
ln -s $LINKTO $FILELINK
|
|
|
|
|
cd -
|
|
|
|
|
read <&3 LINE
|
|
|
|
|
done
|
|
|
|
|
exec 3>&-
|
2009-12-23 18:04:46 +00:00
|
|
|
|
rm -f /tmp/linklist$$
|
2008-05-03 17:01:13 +00:00
|
|
|
|
for i in `find . -type l -ls|grep $HOSTSYS`; do
|
|
|
|
|
LINTO=`echo $i|awk '{print $10}'`
|
|
|
|
|
echo $LINTO
|
|
|
|
|
done
|
|
|
|
|
cd $CURDIR
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MakeCheck() {
|
|
|
|
|
if [ "$CHECK" == "true" ]; then
|
|
|
|
|
make $*
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CleanTextFiles() {
|
|
|
|
|
cd $TMPROOT
|
|
|
|
|
for i in `find . -type f`; do
|
2009-05-04 11:34:19 +00:00
|
|
|
|
sed -i -e "s%$TMPROOT%%" $i
|
2008-05-03 17:01:13 +00:00
|
|
|
|
done
|
|
|
|
|
cd -
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CheckFlag() {
|
|
|
|
|
FLAG=$1
|
|
|
|
|
CHECK=$2
|
|
|
|
|
|
|
|
|
|
(( CHECKFLAG = $FLAG & $CHECK ))
|
|
|
|
|
if [ $CHECKFLAG == 0 ]; then
|
|
|
|
|
return 1
|
|
|
|
|
else
|
|
|
|
|
return 0
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GetFlags() {
|
|
|
|
|
RightString=$1
|
|
|
|
|
ReadBit[1]=`echo $1|cut -c2`
|
|
|
|
|
WriteBit[1]=`echo $1|cut -c3`
|
|
|
|
|
ExecBit[1]=`echo $1|cut -c4`
|
|
|
|
|
ReadBit[2]=`echo $1|cut -c5`
|
|
|
|
|
WriteBit[2]=`echo $1|cut -c6`
|
|
|
|
|
ExecBit[2]=`echo $1|cut -c7`
|
|
|
|
|
ReadBit[3]=`echo $1|cut -c8`
|
|
|
|
|
WriteBit[3]=`echo $1|cut -c9`
|
|
|
|
|
ExecBit[3]=`echo $1|cut -c10`
|
|
|
|
|
unset SetUID
|
|
|
|
|
for i in 1 2; do
|
|
|
|
|
if [ "${ExecBit[$i]}" == "s" ]; then
|
|
|
|
|
SetUID[$i]=1
|
|
|
|
|
ExecBit[$i]="x"
|
|
|
|
|
fi
|
|
|
|
|
if [ "${ExecBit[$i]}" == "S" ]; then
|
|
|
|
|
SetUID[$i]=1
|
|
|
|
|
ExecBit[$i]="-"
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
if [ "${ExecBit[3]}" == "t" ]; then
|
|
|
|
|
SetUID[3]=1
|
|
|
|
|
ExecBit[3]="x"
|
|
|
|
|
fi
|
|
|
|
|
if [ "${ExecBit[3]}" == "T" ]; then
|
|
|
|
|
SetUID[3]=1
|
|
|
|
|
ExecBit[3]="-"
|
|
|
|
|
fi
|
|
|
|
|
NumSUID=0
|
|
|
|
|
AddSUID=1
|
|
|
|
|
for i in 3 2 1; do
|
|
|
|
|
if [ "${SetUID[$i]}" == "1" ]; then
|
|
|
|
|
(( NumSUID = $NumSUID + $AddSUID ))
|
|
|
|
|
fi
|
|
|
|
|
(( AddSUID = $AddSUID + $AddSUID ))
|
|
|
|
|
done
|
|
|
|
|
NumUID=`Asc2Oct ${ReadBit[1]} ${WriteBit[1]} ${ExecBit[1]}`
|
|
|
|
|
NumGID=`Asc2Oct ${ReadBit[2]} ${WriteBit[2]} ${ExecBit[2]}`
|
|
|
|
|
NumOTH=`Asc2Oct ${ReadBit[3]} ${WriteBit[3]} ${ExecBit[3]}`
|
|
|
|
|
echo "$NumSUID$NumUID$NumGID$NumOTH"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Asc2Oct() {
|
|
|
|
|
ReadBit=$1
|
|
|
|
|
WriteBit=$2
|
|
|
|
|
ExecBit=$3
|
|
|
|
|
NumRight=0
|
|
|
|
|
|
|
|
|
|
if [ "$ExecBit" == "x" ]; then
|
|
|
|
|
(( NumRight = $NumRight + 1 ))
|
|
|
|
|
fi
|
|
|
|
|
if [ "$WriteBit" == "w" ]; then
|
|
|
|
|
(( NumRight = $NumRight + 2 ))
|
|
|
|
|
fi
|
|
|
|
|
if [ "$ReadBit" == "r" ]; then
|
|
|
|
|
(( NumRight = NumRight + 4 ))
|
|
|
|
|
fi
|
|
|
|
|
echo $NumRight
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MakeMgtFiles() {
|
2009-11-19 19:53:02 +00:00
|
|
|
|
FilePrefix=$1
|
2010-01-13 10:19:31 +00:00
|
|
|
|
TMPFILE=`mktemp`
|
2009-11-19 19:53:02 +00:00
|
|
|
|
PKGNAME=`echo $PKGNAME|sed -e "s/\.vpg$//"`
|
|
|
|
|
if [ "$SHORTNAME" ]; then
|
|
|
|
|
SHNAME=$SHORTNAME
|
|
|
|
|
else
|
|
|
|
|
SHNAME=`basename $MODULENAME`
|
2010-01-28 10:08:27 +00:00
|
|
|
|
if [ "$NoRewriteName" == "true" ]; then
|
|
|
|
|
SHNAME=`basename $MODULENAME`
|
|
|
|
|
else
|
|
|
|
|
SHNAME=`basename $MODULENAME|\
|
|
|
|
|
sed -e "s/src/bin/" |\
|
|
|
|
|
sed -e "s/SRC/BIN/" |\
|
|
|
|
|
sed -e "s/SOURCE/BINARY/" |\
|
|
|
|
|
sed -e "s/source/binary/" `
|
|
|
|
|
fi
|
2009-11-19 19:53:02 +00:00
|
|
|
|
fi
|
|
|
|
|
find . -type d -ls|\
|
|
|
|
|
awk '{ if ( $11 != "." ) print $3,$5,$6,$11 }' |\
|
2010-01-13 10:19:31 +00:00
|
|
|
|
sed -e "s/\.\//\//" >$TMPFILE
|
|
|
|
|
exec 3<$TMPFILE
|
2009-11-19 19:53:02 +00:00
|
|
|
|
while read <&3 RIGHTS USERID GROUPID NAME; do
|
|
|
|
|
echo "$NAME `GetFlags $RIGHTS` $USERID $GROUPID"
|
|
|
|
|
done >$TMPROOT/../$$/$FilePrefix.drg
|
|
|
|
|
exec 3>&-
|
2010-01-13 10:19:31 +00:00
|
|
|
|
rm -f $TMPFILE
|
2009-11-19 19:53:02 +00:00
|
|
|
|
find . ! -type d -ls|\
|
|
|
|
|
awk '{ print $3,$5,$6,$11 }'|\
|
2010-01-13 10:19:31 +00:00
|
|
|
|
sed -e "s/\.\//\//" >$TMPFILE
|
|
|
|
|
exec 3<$TMPFILE
|
2009-11-19 19:53:02 +00:00
|
|
|
|
while read <&3 RIGHTS USERID GROUPID NAME; do
|
|
|
|
|
TYPE=`echo $RIGHTS|cut -c1`
|
|
|
|
|
RIGHT=`echo $RIGHTS|GetFlags $RIGHTS`
|
|
|
|
|
if [ -f .$NAME ] && [ ! -h .$NAME ]; then
|
|
|
|
|
MDSUM=`md5sum .$NAME|cut -d" " -f1`
|
|
|
|
|
else
|
|
|
|
|
MDSUM=""
|
|
|
|
|
fi
|
|
|
|
|
case $TYPE in
|
|
|
|
|
"-")
|
2010-01-12 10:02:12 +00:00
|
|
|
|
FILETYPE="File"
|
2009-11-19 19:53:02 +00:00
|
|
|
|
;;
|
|
|
|
|
"l")
|
2010-01-12 10:02:12 +00:00
|
|
|
|
FILETYPE="Link"
|
2009-11-19 19:53:02 +00:00
|
|
|
|
;;
|
|
|
|
|
"d")
|
2010-01-12 10:02:12 +00:00
|
|
|
|
FILETYPE="Dir"
|
2009-11-19 19:53:02 +00:00
|
|
|
|
;;
|
|
|
|
|
"s")
|
2010-01-12 10:02:12 +00:00
|
|
|
|
FILETYPE="Socket"
|
2009-11-19 19:53:02 +00:00
|
|
|
|
;;
|
|
|
|
|
"c")
|
2010-01-12 10:02:12 +00:00
|
|
|
|
FILETYPE="DeviceC"
|
2009-11-19 19:53:02 +00:00
|
|
|
|
;;
|
|
|
|
|
"b")
|
2010-01-12 10:02:12 +00:00
|
|
|
|
FILETYPE="DeviceB"
|
2009-11-19 19:53:02 +00:00
|
|
|
|
;;
|
|
|
|
|
"p")
|
2010-01-12 10:02:12 +00:00
|
|
|
|
FILETYPE="Pipe"
|
2009-11-19 19:53:02 +00:00
|
|
|
|
;;
|
|
|
|
|
*)
|
2010-01-12 10:02:12 +00:00
|
|
|
|
FILETYPE="Unknown"
|
2009-11-19 19:53:02 +00:00
|
|
|
|
;;
|
|
|
|
|
esac
|
2010-02-22 13:49:59 +00:00
|
|
|
|
echo "PN=$SHNAME;FN=$NAME;FT=$FILETYPE;FR=$RIGHT;FO=$USERID;FG=$GROUPID;FS=$MDSUM;PK=$PKGNAME"
|
2009-11-19 19:53:02 +00:00
|
|
|
|
done >$TMPROOT/../$$/$FilePrefix.cont
|
|
|
|
|
exec 3>&-
|
2010-01-13 10:19:31 +00:00
|
|
|
|
rm -f $TMPFILE
|
2008-05-03 17:01:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
X11R7_Fix() {
|
|
|
|
|
(( CLEANUP_FLAGS = $CLEANUP_FLAGS | 16 ))
|
|
|
|
|
cd /usr
|
|
|
|
|
ln -s X11R7 X11R6
|
|
|
|
|
cd -
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SetConfig() {
|
|
|
|
|
SELECT=$1
|
|
|
|
|
|
|
|
|
|
case $SELECT in
|
|
|
|
|
32)
|
|
|
|
|
(( CLEANUP_FLAGS = $CLEANUP_FLAGS | 64 ))
|
|
|
|
|
STOREPKG_CONFIG_PATH=$PKG_CONFIG_PATH
|
|
|
|
|
PKG_CONFIG_PATH=`echo $STOREPKG_CONFIG_PATH|sed "s/lib64/lib/g"`
|
2009-04-28 13:53:56 +00:00
|
|
|
|
UARCH=32
|
2009-07-22 20:49:20 +00:00
|
|
|
|
LIBDIR=lib
|
2008-05-03 17:01:13 +00:00
|
|
|
|
;;
|
|
|
|
|
64)
|
|
|
|
|
(( CLEANUP_FLAGS = $CLEANUP_FLAGS | 64 ))
|
|
|
|
|
STOREPKG_CONFIG_PATH=$PKG_CONFIG_PATH
|
|
|
|
|
PKG_CONFIG_PATH=`echo $STOREPKG_CONFIG_PATH|sed "s/lib/lib64/g"`
|
2009-04-28 13:53:56 +00:00
|
|
|
|
UARCH=64
|
2009-07-22 20:49:20 +00:00
|
|
|
|
LIBDIR=lib64
|
2008-05-03 17:01:13 +00:00
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
PKG_CONFIG_PATH=$STOREPKG_CONFIG_PATH
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
}
|
|
|
|
|
|
2009-04-20 09:49:36 +00:00
|
|
|
|
MakeFifo() {
|
|
|
|
|
TMPFILE=`mktemp`
|
2009-12-23 18:04:46 +00:00
|
|
|
|
rm -f $TMPFILE
|
2009-04-20 09:49:36 +00:00
|
|
|
|
mkfifo --mode=600 $TMPFILE
|
|
|
|
|
echo $TMPFILE
|
|
|
|
|
return 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ExecCommand() {
|
2009-04-21 08:38:25 +00:00
|
|
|
|
CMDNUM=$1
|
|
|
|
|
echo "$CMDNUM" >&8
|
2009-04-20 09:49:36 +00:00
|
|
|
|
while true; do
|
2009-04-21 08:38:25 +00:00
|
|
|
|
COMMAND=`cat ${CMDF[${CMDNUM}]}`
|
2009-04-21 13:16:27 +00:00
|
|
|
|
IFS=";"
|
|
|
|
|
for i in `echo $COMMAND|awk -F" && " '{print $1";"$2";"$3";"$4";"$5";"$6 }'`; do
|
|
|
|
|
unset IFS
|
|
|
|
|
if [[ "$i" == *wshutdown* ]]; then
|
2009-12-23 18:04:46 +00:00
|
|
|
|
rm -f ${CMDF[${CMDNUM}]}
|
2009-04-21 13:16:27 +00:00
|
|
|
|
return 0
|
|
|
|
|
fi
|
|
|
|
|
$i
|
2009-04-20 09:49:36 +00:00
|
|
|
|
IFS=";"
|
2009-04-21 13:16:27 +00:00
|
|
|
|
done
|
2009-04-21 08:38:25 +00:00
|
|
|
|
echo "$CMDNUM" >&8
|
2009-04-20 09:49:36 +00:00
|
|
|
|
done
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
InitDispatch() {
|
|
|
|
|
FREEF=`MakeFifo`
|
|
|
|
|
exec 8<>$FREEF
|
|
|
|
|
EXECPROCNUM=$NUMCPU
|
2009-04-20 17:43:33 +00:00
|
|
|
|
if [ ! $EXECPROCNUM ]; then
|
|
|
|
|
EXECPROCNUM=1
|
|
|
|
|
fi
|
2009-04-20 09:49:36 +00:00
|
|
|
|
NUMCMD=1
|
|
|
|
|
while [ ${NUMCMD} -le $EXECPROCNUM ]; do
|
2009-04-21 08:38:25 +00:00
|
|
|
|
CMDF[$NUMCMD]=`MakeFifo`
|
|
|
|
|
ExecCommand $NUMCMD&
|
2009-04-20 09:49:36 +00:00
|
|
|
|
(( NUMCMD++ ))
|
|
|
|
|
done
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DispatchCMD() {
|
|
|
|
|
read <&8 FREE
|
|
|
|
|
NUM=1
|
|
|
|
|
while [ "$1" ]; do
|
|
|
|
|
if [ "$NUM" == "1" ]; then
|
2009-04-21 08:38:25 +00:00
|
|
|
|
CMDALL="$1"
|
2009-04-20 09:49:36 +00:00
|
|
|
|
NUM=0
|
|
|
|
|
else
|
2009-04-21 08:38:25 +00:00
|
|
|
|
CMDALL=$CMDALL" && $1"
|
2008-05-03 17:01:13 +00:00
|
|
|
|
fi
|
2009-04-20 09:49:36 +00:00
|
|
|
|
shift
|
|
|
|
|
done
|
2009-04-21 08:38:25 +00:00
|
|
|
|
echo $CMDALL >${CMDF[${FREE}]}
|
2009-04-20 09:49:36 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
EndDispatch() {
|
2009-04-21 08:38:25 +00:00
|
|
|
|
NUMCMD=1
|
2009-04-20 09:49:36 +00:00
|
|
|
|
EXECPROCNUM=$NUMCPU
|
2009-11-19 19:53:02 +00:00
|
|
|
|
while [ "${NUMCMD}" -le "$EXECPROCNUM" ]; do
|
2009-04-21 08:38:25 +00:00
|
|
|
|
cat >${CMDF[${NUMCMD}]} <<EOF
|
2009-04-21 13:16:27 +00:00
|
|
|
|
|
2009-04-21 08:38:25 +00:00
|
|
|
|
wshutdown
|
|
|
|
|
EOF
|
2009-04-20 09:49:36 +00:00
|
|
|
|
(( NUMCMD++ ))
|
|
|
|
|
done
|
|
|
|
|
wait
|
|
|
|
|
exec 8<&-
|
2009-12-23 18:04:46 +00:00
|
|
|
|
rm -f $FREEF
|
2008-05-03 17:01:13 +00:00
|
|
|
|
}
|
2009-05-19 07:36:00 +00:00
|
|
|
|
|
|
|
|
|
GenDynLib32() {
|
|
|
|
|
STATLIB=$1
|
|
|
|
|
DYNLIBVER=$2
|
|
|
|
|
BASEVER=`echo $DYNLIBVER|awk -F"." '{print $1}'`
|
|
|
|
|
LIBNAME=`basename $1|sed -e "s/\.a$//"`
|
|
|
|
|
DYNLIBDIR=`dirname $STATLIB`
|
|
|
|
|
echo "Generating Dynamic Lib $LIBNAME.so.$DYNLIBVER. BaseVersion = $BASEVER"
|
|
|
|
|
mkdir /tmp/libgen$$
|
|
|
|
|
cd /tmp/libgen$$
|
|
|
|
|
ar -x $STATLIB
|
2009-05-19 17:24:04 +00:00
|
|
|
|
gcc $BUILDOPTIONS32 -shared -Wl,-soname,$LIBNAME.so.$BASEVER -o $DYNLIBDIR/$LIBNAME.so.$DYNLIBVER *.o
|
2009-05-19 07:36:00 +00:00
|
|
|
|
ln -s $LIBNAME.so.$DYNLIBVER $DYNLIBDIR/$LIBNAME.so.$BASEVER
|
|
|
|
|
ln -sf $LIBNAME.so.$DYNLIBVER $DYNLIBDIR/$LIBNAME.so
|
|
|
|
|
cd -
|
2009-12-23 18:04:46 +00:00
|
|
|
|
rm -rf /tmp/libgen$$
|
2009-05-19 07:36:00 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GenDynLib() {
|
|
|
|
|
STATLIB=$1
|
|
|
|
|
DYNLIBVER=$2
|
|
|
|
|
BASEVER=`echo $DYNLIBVER|awk -F"." '{print $1}'`
|
|
|
|
|
LIBNAME=`basename $1|sed -e "s/\.a$//"`
|
|
|
|
|
DYNLIBDIR=`dirname $STATLIB`
|
|
|
|
|
echo "Generating Dynamic Lib $LIBNAME.so.$DYNLIBVER. BaseVersion = $BASEVER"
|
|
|
|
|
mkdir /tmp/libgen$$
|
|
|
|
|
cd /tmp/libgen$$
|
|
|
|
|
ar -x $STATLIB
|
2009-05-19 17:24:04 +00:00
|
|
|
|
gcc $BUILDOPTIONS -shared -Wl,-soname,$LIBNAME.so.$BASEVER -o $DYNLIBDIR/$LIBNAME.so.$DYNLIBVER *.o
|
2009-05-19 07:36:00 +00:00
|
|
|
|
ln -s $LIBNAME.so.$DYNLIBVER $DYNLIBDIR/$LIBNAME.so.$BASEVER
|
|
|
|
|
ln -sf $LIBNAME.so.$DYNLIBVER $DYNLIBDIR/$LIBNAME.so
|
|
|
|
|
cd -
|
2009-12-23 18:04:46 +00:00
|
|
|
|
rm -rf /tmp/libgen$$
|
2009-05-19 07:36:00 +00:00
|
|
|
|
}
|
2009-10-22 16:57:26 +00:00
|
|
|
|
|
|
|
|
|
extractfile() {
|
|
|
|
|
ARCHIVE=$1
|
|
|
|
|
EFILE=$2
|
|
|
|
|
LINE=`head -n 1 $ARCHIVE`
|
|
|
|
|
case $EFILE in
|
|
|
|
|
dep)
|
|
|
|
|
LINE=`echo $LINE|cut -d" " -f 1-`
|
|
|
|
|
;;
|
|
|
|
|
meta)
|
|
|
|
|
LINE=`echo $LINE|cut -d" " -f 2-`
|
|
|
|
|
;;
|
|
|
|
|
bin.drg)
|
|
|
|
|
LINE=`echo $LINE|cut -d" " -f 3-`
|
|
|
|
|
;;
|
2009-11-19 19:53:02 +00:00
|
|
|
|
bin.cont)
|
2009-10-22 16:57:26 +00:00
|
|
|
|
LINE=`echo $LINE|cut -d" " -f 4-`
|
|
|
|
|
;;
|
2009-11-19 19:53:02 +00:00
|
|
|
|
bin.tar)
|
2009-10-22 16:57:26 +00:00
|
|
|
|
LINE=`echo $LINE|cut -d" " -f 5-`
|
|
|
|
|
;;
|
2009-11-19 19:53:02 +00:00
|
|
|
|
dev.drg)
|
2009-10-22 16:57:26 +00:00
|
|
|
|
LINE=`echo $LINE|cut -d" " -f 6-`
|
|
|
|
|
;;
|
2009-11-19 19:53:02 +00:00
|
|
|
|
dev.cont)
|
2009-10-22 16:57:26 +00:00
|
|
|
|
LINE=`echo $LINE|cut -d" " -f 7-`
|
|
|
|
|
;;
|
2009-11-19 19:53:02 +00:00
|
|
|
|
dev.tar)
|
2009-10-22 16:57:26 +00:00
|
|
|
|
LINE=`echo $LINE|cut -d" " -f 8-`
|
|
|
|
|
;;
|
2009-11-19 19:53:02 +00:00
|
|
|
|
man.drg)
|
2009-10-22 16:57:26 +00:00
|
|
|
|
LINE=`echo $LINE|cut -d" " -f 9-`
|
|
|
|
|
;;
|
2009-11-19 19:53:02 +00:00
|
|
|
|
man.cont)
|
2009-10-22 16:57:26 +00:00
|
|
|
|
LINE=`echo $LINE|cut -d" " -f 10-`
|
|
|
|
|
;;
|
|
|
|
|
man.tar)
|
2009-11-19 19:53:02 +00:00
|
|
|
|
LINE=`echo $LINE|cut -d" " -f 11-`
|
2009-10-22 16:57:26 +00:00
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
BEGSIZE=0
|
|
|
|
|
for i in $LINE; do
|
|
|
|
|
(( BEGSIZE = $BEGSIZE + $i ))
|
|
|
|
|
done
|
|
|
|
|
SIZE=`echo $LINE|cut -d" " -f1`
|
|
|
|
|
if [ "$SIZE" -gt "0" ]; then
|
|
|
|
|
tail -c $BEGSIZE $ARCHIVE | head -c `echo $LINE | cut -d" " -f1`|bzcat
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|