Indent cleanup

This commit is contained in:
Steve McIntyre 2015-02-03 02:15:20 +00:00
parent 6ada498416
commit a46cc618f8
1 changed files with 89 additions and 90 deletions

View File

@ -54,9 +54,9 @@ case "$MKISOFS" in
XORRISO_VER=$(xorriso_version)
;;
*)
echo "ERROR: debian-cd now depends on xorriso for making x86 bootable CDs."
exit 1;
;;
echo "ERROR: debian-cd now depends on xorriso for making x86 bootable CDs."
exit 1;
;;
esac
cd $CDDIR/..
@ -76,109 +76,109 @@ INSTALLDIR_i386="install.386"
INSTALLDIR_amd64="install.amd"
if [ "$ARCH" = i386 ]; then
INSTALLDIR="$INSTALLDIR_i386"
INSTALLDIR="$INSTALLDIR_i386"
else
INSTALLDIR="$INSTALLDIR_amd64"
INSTALLDIR="$INSTALLDIR_amd64"
fi
BOOT_IMAGES="cdrom/initrd.gz cdrom/vmlinuz cdrom/debian-cd_info.tar.gz"
# Download boot images.
for image in $BOOT_IMAGES; do
if [ ! -e "$image" ]; then
dir=$(dirname $image)
mkdir -p $dir
if [ -n "$LOCAL" -a -f "${LOCALDEBS:-$MIRROR}/dists/$DI_DIST/local/installer-$ARCH/current/images/$image" ]; then
cp "${LOCALDEBS:-$MIRROR}/dists/$DI_DIST/local/installer-$ARCH/current/images/$image" "$image"
elif [ ! "$DI_WWW_HOME" ];then
if [ ! "$DI_DIR" ];then
DI_DIR="$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images"
fi
# echo "Copying images from $DI_DIR"
cp "$DI_DIR/$image" "$image"
else
wget "$DI_WWW_HOME/$image" -O "$image"
fi
fi
if [ ! -e "$image" ]; then
dir=$(dirname $image)
mkdir -p $dir
if [ -n "$LOCAL" -a -f "${LOCALDEBS:-$MIRROR}/dists/$DI_DIST/local/installer-$ARCH/current/images/$image" ]; then
cp "${LOCALDEBS:-$MIRROR}/dists/$DI_DIST/local/installer-$ARCH/current/images/$image" "$image"
elif [ ! "$DI_WWW_HOME" ];then
if [ ! "$DI_DIR" ];then
DI_DIR="$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images"
fi
# echo "Copying images from $DI_DIR"
cp "$DI_DIR/$image" "$image"
else
wget "$DI_WWW_HOME/$image" -O "$image"
fi
fi
done
# Images that are not really required or may be unavailable.
for image in $DISK_IMAGES $EXTRA_DISK_IMAGES; do
if [ ! -e "$image" ]; then
dir=$(dirname $image)
mkdir -p $dir
if [ -n "$LOCAL" -a -f "${LOCALDEBS:-$MIRROR}/dists/$DI_DIST/local/installer-$ARCH/current/images/$image" ]; then
cp "${LOCALDEBS:-$MIRROR}/dists/$DI_DIST/local/installer-$ARCH/current/images/$image" "$image"
elif [ ! "$DI_WWW_HOME" ];then
if [ ! "$DI_DIR" ];then
DI_DIR="$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images"
fi
cp "$DI_DIR/$image" "$image" || true
else
wget "$DI_WWW_HOME/$image" -O "$image" || rm -f "$image"
fi
fi
if [ ! -e "$image" ]; then
dir=$(dirname $image)
mkdir -p $dir
if [ -n "$LOCAL" -a -f "${LOCALDEBS:-$MIRROR}/dists/$DI_DIST/local/installer-$ARCH/current/images/$image" ]; then
cp "${LOCALDEBS:-$MIRROR}/dists/$DI_DIST/local/installer-$ARCH/current/images/$image" "$image"
elif [ ! "$DI_WWW_HOME" ];then
if [ ! "$DI_DIR" ];then
DI_DIR="$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images"
fi
cp "$DI_DIR/$image" "$image" || true
else
wget "$DI_WWW_HOME/$image" -O "$image" || rm -f "$image"
fi
fi
done
# Only disk one gets the extra files installed
if [ "$NN" = "1" ]; then
# populate the install directory as well
for disk in $DISK_IMAGES $EXTRA_DISK_IMAGES; do
if [ -e "$disk" ]; then
dir=$(dirname $disk)
mkdir -p $CDDIR/$INSTALLDIR/$dir
cp -lf $disk $CDDIR/$INSTALLDIR/$dir
fi
done
# populate the install directory as well
for disk in $DISK_IMAGES $EXTRA_DISK_IMAGES; do
if [ -e "$disk" ]; then
dir=$(dirname $disk)
mkdir -p $CDDIR/$INSTALLDIR/$dir
cp -lf $disk $CDDIR/$INSTALLDIR/$dir
fi
done
if [ -e "$MIRROR/tools" ] && \
[ ! -e $CDDIR/tools ] && \
[ "$OMIT_DOC_TOOLS" != "1" ] ; then
echo " Adding tools to CD1"
$BASEDIR/tools/add_files $CDDIR $MIRROR tools
# Remove the win32-loader/ subdirectory from tools, as d-i already installs setup.exe
rm -Rf $CDDIR/tools/win32-loader
fi
if [ -e "$MIRROR/tools" ] && \
[ ! -e $CDDIR/tools ] && \
[ "$OMIT_DOC_TOOLS" != "1" ] ; then
echo " Adding tools to CD1"
$BASEDIR/tools/add_files $CDDIR $MIRROR tools
# Remove the win32-loader/ subdirectory from tools, as d-i already installs setup.exe
rm -Rf $CDDIR/tools/win32-loader
fi
fi
extra_image () {
image=$1
doppelgangers="$2"
dir=$(dirname "$image")
image=$1
doppelgangers="$2"
dir=$(dirname "$image")
mkdir -p $CDDIR/$INSTALLDIR/$dir
if [ ! -e $CDDIR/$INSTALLDIR/"$image" ] ; then
if [ ! "$DI_WWW_HOME" ] ; then
if [ ! "$DI_DIR" ] ; then
DI_DIR="$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images"
fi
cp "$DI_DIR/cdrom/$image" $CDDIR/$INSTALLDIR/"$image"
else
wget "$DI_WWW_HOME/cdrom/$image" -O $CDDIR/$INSTALLDIR/"$image"
fi
fi
for doppelganger in $doppelgangers ; do
if [ -f "$CDDIR/$INSTALLDIR/$dir/$doppelganger" ] &&
cmp -s $CDDIR/$INSTALLDIR/"$image" $CDDIR/$INSTALLDIR/"$dir"/"$doppelganger" ; then
echo " $image identical to $doppelganger. Linking"
ln -nf $CDDIR/$INSTALLDIR/"$dir"/"$doppelganger" $CDDIR/$INSTALLDIR/"$image"
break
fi
done
mkdir -p $CDDIR/$INSTALLDIR/$dir
if [ ! -e $CDDIR/$INSTALLDIR/"$image" ] ; then
if [ ! "$DI_WWW_HOME" ] ; then
if [ ! "$DI_DIR" ] ; then
DI_DIR="$MIRROR/dists/$DI_DIST/main/installer-$ARCH/current/images"
fi
cp "$DI_DIR/cdrom/$image" $CDDIR/$INSTALLDIR/"$image"
else
wget "$DI_WWW_HOME/cdrom/$image" -O $CDDIR/$INSTALLDIR/"$image"
fi
fi
for doppelganger in $doppelgangers ; do
if [ -f "$CDDIR/$INSTALLDIR/$dir/$doppelganger" ] &&
cmp -s $CDDIR/$INSTALLDIR/"$image" $CDDIR/$INSTALLDIR/"$dir"/"$doppelganger" ; then
echo " $image identical to $doppelganger. Linking"
ln -nf $CDDIR/$INSTALLDIR/"$dir"/"$doppelganger" $CDDIR/$INSTALLDIR/"$image"
break
fi
done
}
case "$DESKTOP" in
$UNSPEC_DESKTOP_DEFAULT)
# default from tasksel
DESKTOP=
;;
# default from tasksel
DESKTOP=
;;
all)
# default from tasksel
DESKTOP=
;;
# default from tasksel
DESKTOP=
;;
light)
DESKTOP=xfce
;;
DESKTOP=xfce
;;
esac
# desktop boot parameter gets set separately through DESKTOP variable
KERNEL_PARAMS="$(echo "$KERNEL_PARAMS" | sed -r "s/desktop=[^ ]* ?//")"
@ -187,7 +187,7 @@ mkdir -p $CDDIR/$INSTALLDIR
cp -lf cdrom/vmlinuz $CDDIR/$INSTALLDIR/
cp -lf cdrom/initrd.gz $CDDIR/$INSTALLDIR/
if [ -e $CDDIR/tools/loadlin.exe ]; then
echo "\\tools\\loadlin.exe vmlinuz initrd=initrd.gz" | todos > $CDDIR/$INSTALLDIR/install.bat
echo "\\tools\\loadlin.exe vmlinuz initrd=initrd.gz" | todos > $CDDIR/$INSTALLDIR/install.bat
fi
# In case of a multi-arch CD the script will be called two times. The
@ -198,8 +198,8 @@ fi
MULTIARCH=
if [ -e boot$N/isolinux/isolinux.cfg ]; then
MULTIARCH=1
rm -r boot$N/isolinux
MULTIARCH=1
rm -r boot$N/isolinux
fi
mkdir -p boot$N/isolinux
@ -238,7 +238,6 @@ EOF
@exit
EOF
fi
rm -f boot$N/isolinux/isolinux.cfg.with*
# Common mkisofs options when creating CDs
add_mkisofs_opt $CDDIR/../$N.mkisofs_opts "-J -joliet-long"
@ -283,7 +282,6 @@ if [ "$BOOT_BIOS" = 1 ] ; then
cp -f $CDDIR/../syslinux/usr/lib/syslinux/modules/bios/ldlinux.c32 boot$N/isolinux/
cp -f $CDDIR/../syslinux/usr/lib/syslinux/modules/bios/libcom32.c32 boot$N/isolinux/
cp -f $CDDIR/../syslinux/usr/lib/syslinux/modules/bios/libutil.c32 boot$N/isolinux/
fi
# If we don't have grub stuff from d-i, tell xorriso to add a
# partition offset for the isohybrid code
@ -339,14 +337,15 @@ if variant_enabled "xen" ; then
extra_image xen/vmlinuz "../vmlinuz ../gtk/vmlinuz"
extra_image xen/initrd.gz "../initrd.gz ../gtk/initrd.gz"
extra_image xen/debian.cfg || extra_image xen/xm-debian.cfg
fi
if [ -z "$MULTIARCH" ]; then
# Set up isolinux dir for only the current arch
grep -lr '%install%' boot$N/isolinux/* | xargs -r sed -i "s|%install%|$INSTALLDIR|"
# Set up isolinux dir for only the current arch
grep -lr '%install%' boot$N/isolinux/* | xargs -r sed -i "s|%install%|$INSTALLDIR|"
# Remove the amd*.cfg files to avoid them being loaded on a
# disc that does not have both amd64 and i386 dirs.
find boot$N/isolinux/ -name "amd*.cfg" -delete
# Remove the amd*.cfg files to avoid them being loaded on a disc
# that does not have both amd64 and i386 dirs.
find boot$N/isolinux/ -name "amd*.cfg" -delete
else
# Set up isolinux dir for multi-arch
grep -lr '%install[-amd]*%' boot$N/isolinux/* | xargs -r sed -i -e "s|%install%|$INSTALLDIR_i386|" -e "s|%install-amd%|$INSTALLDIR_amd64|"