functions.inc.sh: added add_additional_defs_file to read pkggroups.db file from chroot target instead of makedist host

This commit is contained in:
Silvan Calarco 2013-03-07 17:28:54 +01:00
parent 1863bedc32
commit c205b7d34a
3 changed files with 23 additions and 12 deletions

View File

@ -15,5 +15,3 @@ REPOSITORY=(
/var/ftp/pub/openmamba/devel-makedist
/var/ftp/private/openmamba/private
)
ADDITIONAL_DEFS_FILE="/usr/share/openmamba/pkggroups.db"

View File

@ -189,12 +189,3 @@ done
> $LOCALSTATEDIR/.Makefile.inc
[ -e ${ADDITIONAL_DEFS_FILE} ] && {
. ${ADDITIONAL_DEFS_FILE}
cat ${ADDITIONAL_DEFS_FILE} | \
while read line; do
if [[ "$line" =~ ([A-Z0-9_]*)= ]]; then
echo "${BASH_REMATCH[1]}: ${!BASH_REMATCH[1]}" >> $LOCALSTATEDIR/.Makefile.inc
fi
done
}

View File

@ -51,6 +51,28 @@ function i18n_add_languages_from_file() {
echo
}
function add_additional_defs_file() {
local ADDITIONAL_DEFS_FILE=$1
[ -e ${MOUNTDIR}/${ADDITIONAL_DEFS_FILE} ] || return 1
echo "Adding additional defs file $1 from $MOUNTDIR to Makefile..."
local tmpfile=`mktemp -q -t makedist.XXXXXXXX.tmp`
chroot $MOUNTDIR sh -c "set > /tmp/set1; . $ADDITIONAL_DEFS_FILE; set > /tmp/set2"
awk 'FNR==NR{old[$0];next};!($0 in old)' ${MOUNTDIR}/tmp/set1 ${MOUNTDIR}/tmp/set2 > $tmpfile
rm -f $MOUNTDIR/tmp/set1 $MOUNTDIR/tmp/set2
. ${tmpfile}
cat ${tmpfile} | \
while read line; do
if [[ "$line" =~ ([A-Z0-9_]*)= ]]; then
echo "${BASH_REMATCH[1]}: ${!BASH_REMATCH[1]}" >> $LOCALSTATEDIR/.Makefile.inc
fi
done
rm -f ${tmpfile}
}
function create_rpm_database() {
# RPM database initialization
#
@ -515,7 +537,7 @@ function install_rpms_by_target() {
}
function exec_distromatic() {
distromatic -t distromatic -c ${LOCALSTATEDIR}/distromatic/distromatic.conf --gendatatables || {
distromatic -t distromatic -c ${LOCALSTATEDIR}/distromatic/distromatic.conf --gendatatables -a $arch || {
echo "Error executing distromatic; command was:"
echo "distromatic -t distromatic -c ${LOCALSTATEDIR}/distromatic/distromatic.conf --gendatatables -a $arch"
exit 1