makedist-openmamba/platforms/packages-dvd/pre.inc.sh
2011-05-19 16:02:37 +02:00

53 lines
1.4 KiB
Bash

# produce packages container DVD
MEDIA_NAME=`media_name`
MEDIA_NAMES=()
DISTROMATIC_OPT=""
ALL_PACKAGES=(`eval more /var/makedist/distromatic/deps-i586 | grep ALL_PACKAGES`)
for i in $COMPLEMENTARY_TARGETS; do
. $TARGETDIR/platforms/$i/settings.inc
MEDIA_NAME=`PLATFORM=$i media_name`
. $LOCALSTATEDIR/.$MEDIA_NAME.distinfo
INST_PACKAGES="$INST_PACKAGES
$INSTALLED"
done
INSTALLED=(`echo "$INSTALLED"|sort|uniq`)
unset SELECTED_PACKAGES
i=0
for p in ${ALL_PACKAGES[*]}; do
while [[ ${INSTALLED[i]} < $p ]]; do
SELECTED_PACKAGES="$SELECTED_PACKAGES ${INSTALLED[i]}"
i=`expr $i + 1`
done
SELECTED_PACKAGES="$SELECTED_PACKAGES $p"
done
. $TARGETDIR/platforms/$PLATFORM/settings.inc
echo "Creating packages DVD..."
[ "$MOUNTDIR" ] && rm -rf $MOUNTDIR/*
[ "$EXTRA_PACKAGES" ] && {
echo "- installing repository with extra packages"
add_packages_to_repository $MOUNTDIR/RPMS/$arch "$SELECTED_PACKAGES $EXTRA_PACKAGES"
}
#for i in ${MEDIA_NAMES[*]}; do
# echo "- installing $i and repository"
# add_installed_packages_to_repository $i $MOUNTDIR/repositories/embedded
# cp $LOCALSTATEDIR/$i $MOUNTDIR
#done
# copy static files for specific platform
[ -e $TARGETDIR/platforms/$PLATFORM/root ] &&
cp -a $TARGETDIR/platforms/$PLATFORM/root/* $MOUNTDIR/
produce_media
echo "- generating MD5 sum for ${MEDIA_NAME}"
md5sum $LOCALSTATEDIR/$MEDIA_NAME > $LOCALSTATEDIR/.$MEDIA_NAME.MD5
exit 0