#!/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=$CD1/Mandrake/mdkinst/lib/:$LD_LIBRARY_PATH: 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?.cz in Mandrake/base rm -rf /tmp/.build_hdlist/ cd $1/Mandrake/base rm provides hdlist1.cz hdlist2.cz mv hdlists hdlists.$$ echo "hdlist1.cz Mandrake/RPMS CD 1 Installation CD (x86)">hdlists if [ $# -eq 2 ]; then echo "hdlist2.cz Mandrake/RPMS2 CD 2 Extention CD (x86)">>hdlists ln -sf $CD2/Mandrake/RPMS2 ../RPMS2 fi $CD1/misc/genhdlists --distrib $CD1 if [ $? -ne 0 ]; then echo Error in Processing hdlist.cz2 from $CD1/Mandrake/RPMS >&2 exit 1 fi if [ $# -eq 1 ]; then $CD1/misc/genbasefiles $CD1/Mandrake/base/ $CD1/Mandrake/base/hdlist1.cz else $CD1/misc/genbasefiles $CD1/Mandrake/base/ $CD1/Mandrake/base/hdlist1.cz $CD1/Mandrake/base/hdlist2.cz 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