#!/bin/sh # Regenerate hdlists for installation [and extra] CD. # distCD1_head should be the directory where you find # generally these files and subdirectories : # # COPYING Mandrake/ RPM-GPG-KEYS VERSION dosutils/ images/ lnx4win/ # misc/ # #distCD2_head should be the top of the extra CD where there is just the file #Manrdrake/ which contains Mandrake/RPMS2 if [ $# -eq 0 -o $# -gt 2 ];then echo "Usage: $(basename $0) /path/to/CD1/root_directory/ [/path/to/CD2/root_directory]" >&2 exit 1 fi CD1=`echo $1|awk ' $1 !~ /^\// {printf "'\`pwd\`'/"}{print $1}'` if [ ! -d $CD1/misc ]; then echo " RPM directory $CD1/misc does not exist" >&2 exit 1 fi if [ $# -eq 2 ]; then CD2=`echo $2|awk ' $1 !~ /^\// {printf "'\`pwd\`'/"}{print $1}'` if [ ! -d $CD2/Mandrake/RPMS2 ]; then echo RPM directory $CD2/Mandrake/RPMS2 does not exists >&2 exit 1 fi fi export PATH=$CD1/misc:$PATH export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CD1/Mandrake/mdkinst/lib/ echo Checking for libpopt if [ ! -f $CD1/Mandrake/mdkinst/lib/libpopt.so.0 ]; then if [ ! -f /lib/libpopt.so.0 ]; then rpm -Uhv --force $CD1/Mandrake/RPMS/libpopt* fi cp -p /lib/libpopt.so.0 $CD1/Mandrake/mdkinst/lib/libpopt.so.0 if [ ! -f $CD1/Mandrake/mdkinst/lib/libpopt.so.0 ]; then echo Cannot find or install required libpopt.so.0 >&2 exit 1 fi fi echo libpopt found #Now make the compressed files hdlist?.cz2 in Mandrake/base rm -rf /tmp/.build_hdlist/ $CD1/misc/genhdlist_cz2 -o $CD1/Mandrake/base/hdlist.cz2 $CD1/Mandrake/RPMS if [ $? -ne 0 ]; then echo Error in Processing hdlist.cz2 from $CD1/Mandrake/RPMS >&2 exit 1 fi if [ $# -eq 2 ]; then $CD1/misc/genhdlist_cz2 -o $CD1/Mandrake/base/hdlist2.cz2 $CD2/Mandrake/RPMS2 if [ $? -ne 0 ]; then echo Error in Processing hdlist2.cz2 from $CD2/Mandrake/RPMS2 >&2 exit 1 fi fi if [ $# -eq 1 ]; then $CD1/misc/gendepslist2 -o $CD1/Mandrake/base/depslist $CD1/Mandrake/base/hdlist.cz2 else $CD1/misc/gendepslist2 -o $CD1/Mandrake/base/depslist $CD1/Mandrake/base/hdlist.cz2 $CD1/Mandrake/base/hdlist2.cz2 fi EXIT=$? if [ ! "$EXIT" = "0" ]; then echo echo "Error in generating dependencies lists." fi chmod a+r $CD1/Mandrake/base/* rm -rf /tmp/.build_hdlist/ exit $EXIT