debian-cd-clone/tools/add-bin-doc

94 lines
2.6 KiB
Bash
Executable File

#!/bin/bash
#set -x
set -e
BDIR=$TDIR/$CODENAME-$ARCH
ADIR=$APTTMP/$CODENAME-$ARCH
SDIR=$TDIR/$CODENAME-src
DEBMAINVER="`echo $DEBVERSION | sed -e 's/[ _r].*//'`"
if [ "$OMIT_RELEASE_NOTES"x = ""x ] ; then
OMIT_RELEASE_NOTES=0
fi
if [ "$OMIT_MANUAL"x = ""x ] ; then
OMIT_MANUAL=0
fi
for i in $BDIR/*.packages; do
dir=${i%%.packages}
DISK=${dir##$BDIR/}
dir=$BDIR/CD$DISK
cp -pdf $MIRROR/README* $dir/
if [ -f $dir/doc/dedication-$DEBMAINVER.txt ]; then
mv $dir/doc/dedication-$DEBMAINVER.txt $dir/dedication.txt
ln -s ../dedication.txt $dir/doc/dedication-$DEBMAINVER.txt
fi
rm -f $dir/README $dir/README.1ST \
$dir/README.CD-manufacture $dir/README.multicd \
$dir/README.pgp $dir/README.non-US ; \
cpp -traditional -undef -P -C -Wall -nostdinc -I$dir \
-D OMIT_MANUAL="$OMIT_MANUAL" \
-D OMIT_RELEASE_NOTES="$OMIT_RELEASE_NOTES" \
-D OUTPUTtext $BASEDIR/data/$CODENAME/README.html.in \
| sed -e 's/%%.//g' > $dir/README.html
lynx -dump -force_html $dir/README.html | todos \
> $dir/README.txt ; \
cpp -traditional -undef -P -C -Wall -nostdinc -I $dir/ \
-D OMIT_MANUAL="$OMIT_MANUAL" \
-D OMIT_RELEASE_NOTES="$OMIT_RELEASE_NOTES" \
-D OUTPUThtml $BASEDIR/data/$CODENAME/README.html.in \
| sed -e 's/%%.//g' > $dir/README.html
rm -f $dir/README.diskdefines
mkdir -p $dir/pics
cp -p $BASEDIR/data/pics/*.* $dir/pics/
if [ -e $MIRROR/dists/$CODENAME/main/Release-Notes ]; then
cp -pf $MIRROR/dists/$CODENAME/main/Release-Notes $dir/
fi
if [ "$INSTALLER_CD" = "0" ]; then
if [ -e $MIRROR/dists/$CODENAME/Contents-$ARCH.gz ]; then
cp -pf $MIRROR/dists/$CODENAME/Contents-$ARCH.gz $dir/dists/$CODENAME/
else
echo "WARNING: there's no Contents-$ARCH.gz file for $CODENAME !"
fi
fi
if [ -n "$NONUS" ]
then
if [ -e $NONUS/dists/$CODENAME/non-US/Contents-$ARCH.gz ]; then
cp -pf $NONUS/dists/$CODENAME/non-US/Contents-$ARCH.gz \
$dir/dists/$CODENAME/non-US/
else
echo "WARNING: there's no Content-$ARCH.gz file for $CODENAME/non-US !"
fi
fi
if [ -e $BASEDIR/data/$CODENAME/README.$ARCH ]; then
cp -pf $BASEDIR/data/$CODENAME/README.$ARCH $dir/
fi
if [ -e $BASEDIR/data/$CODENAME/README.1ST.$ARCH ]; then
rm -f $dir/README.1ST
echo "This disc is labelled :" > $dir/README.1ST
cat $dir/.disk/info >>$dir/README.1ST
echo -e "\n\n" >>$dir/README.1ST
cat $BASEDIR/data/$CODENAME/README.1ST.$ARCH > $dir/README.1ST
todos $dir/README.1ST
fi
if [ -e $BASEDIR/data/$CODENAME/README.multicd ]; then
cp -pf $BASEDIR/data/$CODENAME/README.multicd $dir/
fi
done