--- trunk/mage/usr/lib/mage/mage4.functions.sh 2007/03/27 16:35:57 449 +++ trunk/mage/usr/lib/mage/mage4.functions.sh 2011/01/28 21:46:34 1214 @@ -1,6 +1,6 @@ #!/bin/bash # Magellan Linux Installer Functions (mage.functions.sh) -# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/mage4.functions.sh,v 1.29 2007-03-27 16:35:57 niro Exp $ +# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/mage4.functions.sh,v 1.38 2008-10-05 10:32:24 niro Exp $ mage_setup() { @@ -198,10 +198,11 @@ is_config_protected "${pathto}" retval="$?" - # 0 - not protected # - # 1 - error # - # 2 - protected # - # 3 - protected but masked # + # 0 - not protected # + # 1 - error # + # 2 - protected # + # 3 - protected but masked # + # 4 - protected but ignored # case ${retval} in # file is not protected - (over)write it @@ -252,6 +253,18 @@ (( MAGE_PROTECT_COUNTER++ )) export MAGE_PROTECT_COUNTER ;; + + # file is protected but ignored, delete the update/do nothing + 4) + if [[ ${VERBOSE} = on ]] + then + echo -en "${COLRED}" + echo -n "! ignr " + echo -en "${COLDEFAULT}" + echo " === FILE: ${MROOT}${pathto}" + fi + # simply do nothing here + ;; esac done < ${BUILDDIR}/${pkgname}/.files @@ -298,19 +311,19 @@ ln -snf "${link}" "${MROOT}${pathto}" - # fix mtime and db - fix_descriptor ${pkgname}/.symlinks \ - "${pathto}" \ - "${posix}" \ - "${link}" \ - "$(fix_mtime "${BUILDDIR}/${pkgname}"/.mtime \ - "${MROOT}${pathto}")" +# # fix mtime and db +# fix_descriptor ${pkgname}/.symlinks \ +# "${pathto}" \ +# "${posix}" \ +# "${link}" \ +# "$(fix_mtime "${BUILDDIR}/${pkgname}"/.mtime \ +# "${MROOT}${pathto}")" done < ${BUILDDIR}/${pkgname}/.symlinks - # now copy the fixed file over the old one - [ -f ${BUILDDIR}/${pkgname}/.symlinks_fixed ] && \ - cp -f ${BUILDDIR}/${pkgname}/.symlinks{_fixed,} +# # now copy the fixed file over the old one +# [ -f ${BUILDDIR}/${pkgname}/.symlinks_fixed ] && \ +# cp -f ${BUILDDIR}/${pkgname}/.symlinks{_fixed,} # very important: unsetting the '§' fieldseperator IFS=$'\n' @@ -326,6 +339,8 @@ local pkgname="$1" local pathto local posix + local user + local group local IFS # sanity checks; abort if not given @@ -339,12 +354,17 @@ # sets fieldseperator to "§" instead of " " IFS=§ - while read pathto posix + while read pathto posix user group do [ -z "${pathto}" ] && continue [[ ${VERBOSE} = on ]] && echo -e "\t>>> PIPE: ${MROOT}${pathto}" - mkfifo -m "${posix}" "${MROOT}$pathto" + mkfifo -m "${posix}" "${MROOT}${pathto}" + # make it optional atm !! + if [[ ! -z ${user} ]] && [[ ! -z ${group} ]] + then + chown "${user}:${group}" "${MROOT}${pathto}" + fi done < ${BUILDDIR}/${pkgname}/.pipes # very important: unsetting the '§' fieldseperator @@ -363,6 +383,8 @@ local posix local major local minor + local user + local group local IFS # sanity checks; abort if not given @@ -376,23 +398,68 @@ # sets fieldseperator to "§" instead of " " IFS=§ - while read pathto posix major minor + while read pathto posix major minor user group do [ -z "${pathto}" ] && continue [[ ${VERBOSE} = on ]] && echo -e "\t>>> CHAR: ${MROOT}${pathto}" mknod -m ${posix} "${MROOT}${pathto}" c ${major} ${minor} + + # make it optional atm !! + if [[ ! -z ${user} ]] && [[ ! -z ${group} ]] + then + chown "${user}:${group}" "${MROOT}${pathto}" + fi done < ${BUILDDIR}/${pkgname}/.char # very important: unsetting the '§' fieldseperator IFS=$'\n' } +################################################### +# function install_fifos # +# install_fifos $PKGNAME # +################################################### +install_fifos() +{ + local pkgname="$1" + local pathto + local posix + local user + local group + local IFS + + # sanity checks; abort if not given + [ -z "${pkgname}" ] && die "install_fifos() \$pkgname not given." + + # check needed global vars + [ -z "${BUILDDIR}" ] && die "install_fifos() \$BUILDDIR not set." + + # make it optional atm !! + #[ ! -f ${BUILDDIR}/${pkgname}/.fifo ] && die "install_fifos() .fifo not found" + [ ! -f ${BUILDDIR}/${pkgname}/.fifo ] && return + + # sets fieldseperator to "§" instead of " " + IFS=§ + + while read pathto posix user group + do + [ -z "${pathto}" ] && continue + [[ ${VERBOSE} = on ]] && echo -e "\t>>> FIFO: ${MROOT}${pathto}" + + mkfifo -m "${posix}" "${MROOT}${pathto}" + chown "${user}:${group}" "${MROOT}${pathto}" + done < ${BUILDDIR}/${pkgname}/.fifo + + # very important: unsetting the '§' fieldseperator + IFS=$'\n' +} + ################################################### # function build_doinstall # # build_doinstall $PKGNAME # -# NOTE: this is an wrapper do install packages # +# NOTE: this is an wrapper to install packages # ################################################### build_doinstall() { @@ -415,6 +482,7 @@ install_symlinks ${pkgname} || die "install symlinks ${pkgname}" install_blockdevices ${pkgname} || die "install blockdevices ${pkgname}" install_characterdevices ${pkgname} || die "install chardevices ${pkgname}" + install_fifos ${pkgname} || die "install fifos ${pkgname}" } @@ -476,7 +544,7 @@ # create fake file descriptors # used by virtual and source packages - for i in .dirs .symlinks .files .pipes .char + for i in .dirs .symlinks .files .pipes .char .fifo do touch ${dbrecorddir}/${i} done @@ -494,10 +562,13 @@ # normal packages needs these files local i - for i in .char .dirs .files .pipes .symlinks + for i in .char .dirs .files .pipes .symlinks .fifo do - install -m 0644 ${BUILDDIR}/${pkgname}/${i} \ - ${dbrecorddir}/${i} + # make .fifo optional atm + if [[ -f ${BUILDDIR}/${pkgname}/${i} ]] + then + install -m 0644 ${BUILDDIR}/${pkgname}/${i} ${dbrecorddir}/${i} + fi done ;; esac @@ -772,10 +843,10 @@ done # sanity checks; abort if not given - [ -z "${pcat}" ] && die "remove_symlinks() \$pcat not given." - [ -z "${pname}" ] && die "remove_symlinks() \$pname not given." - [ -z "${pver}" ] && die "remove_symlinks() \$pver not given." - [ -z "${pbuild}" ] && die "remove_symlinks() \$pbuild not given." + [ -z "${pcat}" ] && die "remove_files() \$pcat not given." + [ -z "${pname}" ] && die "remove_files() \$pname not given." + [ -z "${pver}" ] && die "remove_files() \$pver not given." + [ -z "${pbuild}" ] && die "remove_files() \$pbuild not given." pfull="${pcat}/${pname}-${pver}-${pbuild}" # check needed global vars @@ -809,10 +880,11 @@ is_config_protected "${pathto}" retval="$?" - # 0 - not protected # - # 1 - error # - # 2 - protected # - # 3 - protected but masked # + # 0 - not protected # + # 1 - error # + # 2 - protected # + # 3 - protected but masked # + # 4 - protected but ignored # case ${retval} in # file is not protected - delete it @@ -831,6 +903,18 @@ echo " === FILE: ${MROOT}${pathto}" fi ;; + + # file is protected but ignored, delete the update/do nothing + 4) + if [[ ${VERBOSE} = on ]] + then + echo -en "${COLRED}" + echo -n "! ignr " + echo -en "${COLDEFAULT}" + echo " === FILE: ${MROOT}${pathto}" + fi + # simply do nothing here + ;; esac ;; 1) @@ -853,6 +937,8 @@ { local pathto local posix + local user + local group local IFS local pcat local pname @@ -876,10 +962,10 @@ done # sanity checks; abort if not given - [ -z "${pcat}" ] && die "remove_symlinks() \$pcat not given." - [ -z "${pname}" ] && die "remove_symlinks() \$pname not given." - [ -z "${pver}" ] && die "remove_symlinks() \$pver not given." - [ -z "${pbuild}" ] && die "remove_symlinks() \$pbuild not given." + [ -z "${pcat}" ] && die "remove_blockdevices() \$pcat not given." + [ -z "${pname}" ] && die "remove_blockdevices() \$pname not given." + [ -z "${pver}" ] && die "remove_blockdevices() \$pver not given." + [ -z "${pbuild}" ] && die "remove_blockdevices() \$pbuild not given." pfull="${pcat}/${pname}-${pver}-${pbuild}" # check needed global vars @@ -890,7 +976,7 @@ # sets fieldseperator to "§" instead of " " IFS=§ - while read pathto posix + while read pathto posix user group do [ -z "${pathto}" ] && continue @@ -911,6 +997,8 @@ { local pathto local posix + local user + local group local IFS local pcat local pname @@ -934,10 +1022,10 @@ done # sanity checks; abort if not given - [ -z "${pcat}" ] && die "remove_symlinks() \$pcat not given." - [ -z "${pname}" ] && die "remove_symlinks() \$pname not given." - [ -z "${pver}" ] && die "remove_symlinks() \$pver not given." - [ -z "${pbuild}" ] && die "remove_symlinks() \$pbuild not given." + [ -z "${pcat}" ] && die "remove_characterdevices() \$pcat not given." + [ -z "${pname}" ] && die "remove_characterdevices() \$pname not given." + [ -z "${pver}" ] && die "remove_characterdevices() \$pver not given." + [ -z "${pbuild}" ] && die "remove_characterdevices() \$pbuild not given." pfull="${pcat}/${pname}-${pver}-${pbuild}" # check needed global vars @@ -948,7 +1036,7 @@ # sets fieldseperator to "§" instead of " " IFS=§ - while read pathto posix + while read pathto posix user group do [ -z "${pathto}" ] && continue @@ -962,6 +1050,68 @@ ################################################### +# function remove_fifos # +# remove_fifos $PKGNAME # +################################################### +remove_fifos() +{ + local pathto + local posix + local user + local group + local IFS + local pcat + local pname + local pver + local pbuild + local i + local pfull + + IFS=$'\n' + + # very basic getops + for i in $* + do + case $1 in + --pcat|-c) shift; pcat="$1" ;; + --pname|-n) shift; pname="$1" ;; + --pver|-v) shift; pver="$1" ;; + --pbuild|-b) shift; pbuild="$1" ;; + esac + shift + done + + # sanity checks; abort if not given + [ -z "${pcat}" ] && die "remove_fifos() \$pcat not given." + [ -z "${pname}" ] && die "remove_fifos() \$pname not given." + [ -z "${pver}" ] && die "remove_fifos() \$pver not given." + [ -z "${pbuild}" ] && die "remove_fifos() \$pbuild not given." + pfull="${pcat}/${pname}-${pver}-${pbuild}" + + # check needed global vars + [ -z "${BUILDDIR}" ] && die "remove_fifos() \$BUILDDIR not set." + + # make it optional atm !! + #[ ! -f ${MROOT}${INSTALLDB}/${pfull}/.fifo ] && die "remove_fifos() .fifo not found" + [ ! -f ${MROOT}${INSTALLDB}/${pfull}/.fifo ] && return + + # sets fieldseperator to "§" instead of " " + IFS=§ + + while read pathto posix user group + do + [ -z "${pathto}" ] && continue + + [[ ${VERBOSE} = on ]] && echo -e "\t<<< FIFO: ${MROOT}${pathto}" + rm "${MROOT}${pathto}" + done < ${MROOT}${INSTALLDB}/${pfull}/.fifo + + # very important: unsetting the '§' fieldseperator + IFS=$'\n' +} + + +################################################### # function remove_direcories # # remove_direcories $PKGNAME # ################################################### @@ -992,10 +1142,10 @@ done # sanity checks; abort if not given - [ -z "${pcat}" ] && die "remove_symlinks() \$pcat not given." - [ -z "${pname}" ] && die "remove_symlinks() \$pname not given." - [ -z "${pver}" ] && die "remove_symlinks() \$pver not given." - [ -z "${pbuild}" ] && die "remove_symlinks() \$pbuild not given." + [ -z "${pcat}" ] && die "remove_directories() \$pcat not given." + [ -z "${pname}" ] && die "remove_directories() \$pname not given." + [ -z "${pver}" ] && die "remove_directories() \$pver not given." + [ -z "${pbuild}" ] && die "remove_directories() \$pbuild not given." pfull="${pcat}/${pname}-${pver}-${pbuild}" # check needed global vars @@ -1049,7 +1199,7 @@ ################################################### # function build_douninstall # # build_douninstall $PKGNAME # -# NOTE: this is an wrapper do remove packages # +# NOTE: this is an wrapper to remove packages # ################################################### build_douninstall() { @@ -1083,7 +1233,7 @@ # !! we use § as field seperator !! # doing so prevent us to get errors by filenames with spaces - for i in symlinks files blockdevices characterdevices directories + for i in symlinks files blockdevices characterdevices directories fifos do remove_${i} \ --pcat "${pcat}" \ @@ -1153,10 +1303,7 @@ echo -e " fetching (${count_current}/${count_total}): ${pkg} ... " [[ ${VERBOSE} = off ]] && opt="--quiet" wget \ - --passive-ftp \ - --tries 3 \ - --continue \ - --progress bar \ + ${WGET_FETCH_OPTIONS} \ --directory-prefix=${PKGDIR} \ ${opt} ${mirr}/${PACKAGES_SERVER_PATH}/${pkg} if [[ $? = 0 ]] @@ -1199,10 +1346,89 @@ # clean up backup files (foo~) find ${MAGEDIR} -name *~ -exec rm '{}' ';' - # check if an newer mage version is available + # check if a newer mage version is available is_newer_mage_version_available } +syncmage_tarball() +{ + local latest_tarball + local latest_md5 + local temp="$(mktemp -d)" + local mirr mymirr + local opt + + # try to get the md5 marked as latest on the server + latest_md5="mage-latest.md5" + + # try to get the tarball marked as latest on the server + latest_tarball="mage-latest.tar.bz2" + + for mirr in ${MIRRORS} + do + # path without distribution + mymirr="${mirr%/*}" + + echo -ne "${COLBLUE} --- ${COLDEFAULT}" + echo "fetching latest md5 from ${mymirr} ..." + [[ ${VERBOSE} = off ]] && opt="--quiet" + wget \ + ${WGET_FETCH_OPTIONS} \ + --directory-prefix=${temp} \ + ${opt} ${mymirr}/rsync/tarballs/${latest_md5} + + echo -ne "${COLBLUE} --- ${COLDEFAULT}" + echo "fetching latest tarball from ${mymirr} ..." + wget \ + ${WGET_FETCH_OPTIONS} \ + --directory-prefix=${temp} \ + ${opt} ${mymirr}/rsync/tarballs/${latest_tarball} + if [[ $? = 0 ]] + then + break + else + continue + fi + done + + if [[ -f ${temp}/${latest_tarball} ]] + then + # check md5 + if [[ ! -f ${temp}/${latest_md5} ]] + then + die "md5 is missing ... aborting" + else + echo -ne "${COLBLUE} --- ${COLDEFAULT}" + echo -n "checking md5sum... " + ( cd ${temp}; md5sum --check ${latest_md5} ) || die "md5 for ${latest_tarball} failed" + fi + + if [[ -d ${MAGEDIR} ]] + then + echo -ne "${COLBLUE} --- ${COLDEFAULT}" + echo "cleaning old mage-tree ${MAGEDIR}..." + rm -rf ${MAGEDIR} + fi + + echo -ne "${COLBLUE} --- ${COLDEFAULT}" + echo "updating mage-tree from tarball ..." + # unpack in dirname of MAGEDIR, as the tarball has already the mage + tar xjmf ${temp}/${latest_tarball} -C ${MAGEDIR%/*} || die "Unpacking tarball" + + if [[ -d ${temp} ]] + then + echo -ne "${COLBLUE} --- ${COLDEFAULT}" + echo "cleaning temp-files ..." + rm -rf ${temp} + fi + + # check if a newer mage version is available + is_newer_mage_version_available + else + die "Could not fetch the latest tarball ... aborting" + fi +} + cleanpkg() { if [ -d "${PKGDIR}" ] @@ -1315,10 +1541,12 @@ local PNAME="$2" local magefile - for magefile in $(ls --format=single-column -v ${MAGEDIR}/${PCAT}/${PNAME}/*) + # do not list the content of a directory, only the name (-d) + for magefile in $(ls --format=single-column -v -d ${MAGEDIR}/${PCAT}/${PNAME}/*) do + [[ -z ${magefile} ]] && continue # we exclude subdirs (for stuff like a md5sum dir) - [ -d ${magefile} ] && continue + [[ -d ${magefile} ]] && continue if check_stable_package ${magefile} then HIGHEST_MAGEFILE=${magefile} @@ -1363,6 +1591,7 @@ # 1 - error # # 2 - protected # # 3 - protected but masked # +# 4 - protected but ignored # # # ################################################### is_config_protected() @@ -1371,34 +1600,46 @@ local TEST local PROTECTED local IFS + local i + local x EXPFILE="${MROOT}$1" # file does not exist; it can be written - [ ! -e ${EXPFILE} ] && return 0 + [[ ! -e ${EXPFILE} ]] && return 0 # to be safe; it may be '§' IFS=' ' - # check ob in config protect + # check if config protected for i in ${CONFIG_PROTECT} do - # ersetzen von $i nur wenn am anfang der variable + # only replace $i in the beginning of the variable TEST="${EXPFILE/#${MROOT}${i}/Protected}" - if [ "${TEST}" != "${EXPFILE}" ] + if [[ ${TEST} != ${EXPFILE} ]] then - # setzen das es protected ist + # file is config proteced PROTECTED=TRUE - # check ob nicht doch maskiert + # check if not masked for x in ${CONFIG_PROTECT_MASK} do TEST="${EXPFILE/#${MROOT}${x}/Protect_Masked}" - if [ "${TEST}" != "${EXPFILE}" ] + if [[ ${TEST} != ${EXPFILE} ]] then PROTECTED=MASKED fi done + + # check if not ignored + for x in ${CONFIG_PROTECT_IGNORE} + do + TEST="${EXPFILE/#${MROOT}${x}/Protect_Ignored}" + if [[ ${TEST} != ${EXPFILE} ]] + then + PROTECTED=IGNORED + fi + done fi done @@ -1413,6 +1654,10 @@ #echo "I'm protected, but masked - delete me" return 3 ;; + IGNORED) + #echo "I'm protected, but ignored - keep me, del update" + return 4 + ;; *) #echo "delete me" return 0 @@ -1430,7 +1675,29 @@ ################################################### count_protected_files() { - ${MLIBDIR}/writeprotected "$1" + local file="$1" + local dirname="${file%/*}" + local filename="${file##*/}" + local count + local output + local i + + declare -i count=0 + + # check if there are already protected files + for oldpretected in $(find ${dirname} -iname "._cfg????_${filename}" | + sed -e "s:\(^.*/\)\(._cfg*_\)\(/.*$\):\1\2\3\%\2\%\3:" | + sort -t'%' -k3 -k2 | cut -f1 -d'%') + do + count=$(echo ${oldpretected} | cut -d_ -f2 | sed -e "s:cfg::") + done + (( count ++ )) + + # fill output up with zeros + for (( i=${#count}; i < 4; i++ )); do output="${output}0"; done + output="${output}${count}" + + echo "${output}" } # call with @@ -1602,7 +1869,8 @@ #deletes pakages from virtual database #$1 virtualname; $2 pkgname -virtuals_del() { +virtuals_del() +{ local virtualname="$1" local pkgname="$2" @@ -2036,6 +2304,8 @@ local SDEPEND local PROVIDE local PKGTYPE + local MAGE_TARGETS + local SPLIT_PACKAGE_BASE local preinstall local postinstall local preremove @@ -2082,6 +2352,7 @@ local count_current local magefile local src_install + local i # very basic getops for i in $* @@ -2155,7 +2426,45 @@ echo B:${pbuild} fi - smage2file=${SMAGESCRIPTSDIR}/${pname}/${pname}-${pver}-${pbuild}.smage2 + if [[ -n ${MAGE_TARGETS} ]] + then + # basic svn compat + if [[ -d ${SMAGESCRIPTSDIR}/trunk ]] + then + for i in ${SMAGESCRIPTSDIR}/trunk/*/${pname/${MAGE_TARGETS}/}/${pname/${MAGE_TARGETS}/}-${pver}-${pbuild}.smage2 + do + smage2file="${i}" + done + else + smage2file=${SMAGESCRIPTSDIR}/${pname/${MAGE_TARGETS}/}/${pname/${MAGE_TARGETS}/}-${pver}-${pbuild}.smage2 + fi + + elif [[ -n ${SPLIT_PACKAGE_BASE} ]] + then + # basic svn compat + if [[ -d ${SMAGESCRIPTSDIR}/trunk ]] + then + for i in ${SMAGESCRIPTSDIR}/trunk/*/${SPLIT_PACKAGE_BASE}/${SPLIT_PACKAGE_BASE}-${pver}-${pbuild}.smage2 + do + smage2file="${i}" + done + else + smage2file=${SMAGESCRIPTSDIR}/${SPLIT_PACKAGE_BASE}/${SPLIT_PACKAGE_BASE}-${pver}-${pbuild}.smage2 + fi + + else + # basic svn compat + if [[ -d ${SMAGESCRIPTSDIR}/trunk ]] + then + for i in ${SMAGESCRIPTSDIR}/trunk/*/${pname}/${pname}-${pver}-${pbuild}.smage2 + do + smage2file="${i}" + done + else + smage2file=${SMAGESCRIPTSDIR}/${pname}/${pname}-${pver}-${pbuild}.smage2 + fi + fi + if [ -f "${smage2file}" ] then echo -e " ${COLBLUE}***${COLDEFAULT} building package from source ... " @@ -2431,7 +2740,7 @@ echo -ne "${COLBLUE}${pcat}/${COLDEFAULT}" echo -e "${COLRED}${pname}-${pver}-${pbuild}${COLDEFAULT}" - magefile="${INSTALLDB}/${pcat}/${pname}-${pver}-${pbuild}/${pname}-${pver}-${pbuild}.mage" + magefile="${MROOT}${INSTALLDB}/${pcat}/${pname}-${pver}-${pbuild}/${pname}-${pver}-${pbuild}.mage" source ${magefile} ## preremove scripts @@ -2499,7 +2808,8 @@ unset -f postremove } -show_etc_update_mesg() { +show_etc_update_mesg() +{ [ ${MAGE_PROTECT_COUNTER} -eq 0 ] && return 0 echo @@ -2530,6 +2840,12 @@ local ipver local ipbuild local latest_available + local depsfull + local sdepsfull + local deps + local sdeps + local dep + local sign # only names no versions result="$(find ${MAGEDIR} -mindepth 2 -maxdepth 2 -type d -name '*'${string}'*'| sed '/profiles/d' | sed '/includes/d')" @@ -2585,11 +2901,38 @@ latest_available="${COLRED}masked for this distribution.${COLDEFAULT}" fi + depsfull="$(get_value_from_magefile DEPEND ${magefile})" + sdepsfull="$(get_value_from_magefile SDEPEND ${magefile})" + + while read sign dep + do + case ${dep} in + "") continue;; + esac + + deps="${deps} $(basename ${dep%-*})" + done << EOF +${depsfull} +EOF + + while read sign dep + do + case ${dep} in + "") continue;; + esac + + sdeps="${sdeps} $(basename ${dep%-*})" + done << EOF +${sdepsfull} +EOF + echo -e "${state}${pcat}/${pname}"${COLDEFAULT} echo -e " Latest available: ${latest_available}" echo " Installed versions: ${all_installed}" echo " Description: ${description}" echo " Homepage: ${homepage}" + echo " Depends: ${deps}" + echo " SDepends: ${sdeps}" echo unset pcat @@ -2603,6 +2946,12 @@ unset all_installed unset ipver unset ipbuild + unset depsfull + unset sdepsfull + unset deps + unset sdeps + unset dep + unset sign done } @@ -2645,7 +2994,13 @@ [[ ${USE_UNSTABLE} = true ]] && local MAGE_DISTRIBUTION=unstable [[ ${USE_TESTING} = true ]] && local MAGE_DISTRIBUTION=testing - local EXCLUDED="${MROOT}/etc/mage-profile/package.blacklist-${ARCH}-${MAGE_DISTRIBUTION}" + # support both types for the moment + if [[ -f /etc/mage-profile/package.blacklist-${ARCH}-${MAGE_DISTRIBUTION} ]] + then + local EXCLUDED="/etc/mage-profile/package.blacklist-${ARCH}-${MAGE_DISTRIBUTION}" + else + local EXCLUDED="/etc/mage-profile/package.blacklist-${ARCH}" + fi # return 0 if the list not exist; nothin is masked [[ ! -f ${EXCLUDED} ]] && return 0