2010-01-25 15:08:29 +00:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
#Framework, welches ein komplettes Linux System aus den Sourcen erstellt
|
|
|
|
|
#dieses Framework wird im CVS Repository
|
|
|
|
|
#:pserver:cvs.compuextreme.de:/Data/cvs zur Verf<72>gung gestellt
|
|
|
|
|
#
|
|
|
|
|
#Lage dieser Datei im Archiv: $HeadURL: svn://svn.compuextreme.de/Viitor/V962/ViitorMake/Scripts/GenInstallcfg $
|
|
|
|
|
#
|
|
|
|
|
#(c) 2003 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.
|
|
|
|
|
#
|
|
|
|
|
#Script:
|
|
|
|
|
#
|
|
|
|
|
#Letzte <20>nderung von: $Author: kueller $
|
|
|
|
|
#Datum der letzten <20>nderung: $Date: 2010-01-19 12:27:40 +0100 (Di, 19 Jan 2010) $
|
|
|
|
|
#Version der Datei: $Revision: 5134 $
|
|
|
|
|
#
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
export PKGLIST=.pkglist
|
|
|
|
|
|
|
|
|
|
WDIR=`pwd`
|
|
|
|
|
|
|
|
|
|
PKGLISTING=$1
|
|
|
|
|
TMPFILE=`mktemp`
|
|
|
|
|
TMPFILE2=`mktemp`
|
|
|
|
|
rm $TMPFILE
|
|
|
|
|
rm $TMPFILE2
|
|
|
|
|
NUMDEPSOLD=0
|
|
|
|
|
NUMDEPSNEW=0
|
|
|
|
|
|
|
|
|
|
GenDeps() {
|
|
|
|
|
PKGNAME=$1
|
|
|
|
|
echo >&2 "Generating Dependics for $PKGNAME"
|
|
|
|
|
PKGFILE=`grep "SN=$PKGNAME;" $DISTTARGET/$PKGLIST|\
|
|
|
|
|
awk -F";" '{print $2}'|sed -e "s/PF=//"`
|
|
|
|
|
PKGPATH=`grep "PF=$PKGFILE;" $DISTTARGET/$PKGLIST|\
|
|
|
|
|
awk -F";" '{print $3}'|\
|
|
|
|
|
sed -e "s/PP=//"`
|
|
|
|
|
extractvarchive $DISTTARGET/$PKGPATH/$PKGFILE dep >$TMPFILE
|
|
|
|
|
echo "WARN $PKGNAME" >>$TMPFILE
|
|
|
|
|
NUMDEPSOLD=`cat $TMPFILE|wc -l`
|
|
|
|
|
while [ ! $NUMDEPSOLD == $NUMDEPSNEW ]; do
|
|
|
|
|
NUMDEPSOLD=$NUMDEPSNEW
|
|
|
|
|
exec 3<$TMPFILE
|
|
|
|
|
while read <&3 FLAG SHNAME; do
|
|
|
|
|
grep "SN=$SHNAME;" $DISTTARGET/$PKGLIST|awk -F";" '{print $2}'|sed -e "s/PF=//"
|
|
|
|
|
done > $TMPFILE2
|
|
|
|
|
exec 3>&-
|
|
|
|
|
for i in `cat $TMPFILE2`; do
|
|
|
|
|
PKGPATH=`grep "PF=$i;" $DISTTARGET/$PKGLIST|\
|
|
|
|
|
awk -F";" '{print $3}'|\
|
|
|
|
|
sed -e "s/PP=//"`
|
|
|
|
|
extractvarchive $DISTTARGET/$PKGPATH/$i dep
|
|
|
|
|
done >>$TMPFILE
|
|
|
|
|
rm $TMPFILE2
|
|
|
|
|
cat $TMPFILE |sort -u >$TMPFILE2
|
|
|
|
|
mv $TMPFILE2 $TMPFILE
|
|
|
|
|
NUMDEPSNEW=`cat $TMPFILE|wc -l`
|
|
|
|
|
done
|
|
|
|
|
cat $TMPFILE
|
|
|
|
|
rm $TMPFILE
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
USAGE="Usage: $0 -d <Path to Distribution Packages> -f <Path to cfg in file>"
|
|
|
|
|
while getopts :d:f: opt_char; do
|
|
|
|
|
case $opt_char in
|
|
|
|
|
d)
|
|
|
|
|
DISTTARGET=$OPTARG
|
|
|
|
|
;;
|
|
|
|
|
f)
|
|
|
|
|
CFGFILE=$OPTARG
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
echo $USAGE
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
if [ ! -d $DISTTARGET ]; then
|
|
|
|
|
echo "$DISTTARGET ist not a directory"
|
|
|
|
|
echo $USAGE
|
|
|
|
|
exit 10
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ ! -f $CFGFILE ]; then
|
|
|
|
|
echo "$CFGFILE does not exist"
|
|
|
|
|
echo $USAGE
|
|
|
|
|
exit 10
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
for i in `cat $CFGFILE`; do
|
|
|
|
|
GenDeps $i >>/tmp/DepsList$$
|
|
|
|
|
done
|
|
|
|
|
cat /tmp/DepsList$$|sort -u >/tmp/DepsListSort$$
|
|
|
|
|
rm /tmp/DepsList$$
|
|
|
|
|
cat $DISTTARGET/../install/BaseDevel.cfg
|
|
|
|
|
exec 3<$DISTTARGET/../install/All.cfg
|
|
|
|
|
while read <&3 CDROM PKGPATH MODNAME; do
|
2010-02-02 15:29:19 +00:00
|
|
|
|
if egrep -q "$MODNAME$" /tmp/DepsListSort$$; then
|
|
|
|
|
if ! egrep -q "$MODNAME$" $DISTTARGET/../install/BaseDevel.cfg; then
|
2010-01-25 15:08:29 +00:00
|
|
|
|
echo "$CDROM $PKGPATH $MODNAME"
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
rm /tmp/DepsListSort$$
|