r2650 - in dists/trunk/live-helper: functions helpers
daniel at alioth.debian.org
daniel at alioth.debian.org
Mon Jul 30 06:54:04 UTC 2007
Author: daniel
Date: 2007-07-30 06:54:03 +0000 (Mon, 30 Jul 2007)
New Revision: 2650
Modified:
dists/trunk/live-helper/functions/packages.sh
dists/trunk/live-helper/helpers/lh_chroot_localization
Log:
Reapplying r2634 and r2635 from matth.
Modified: dists/trunk/live-helper/functions/packages.sh
===================================================================
--- dists/trunk/live-helper/functions/packages.sh 2007-07-29 21:11:40 UTC (rev 2649)
+++ dists/trunk/live-helper/functions/packages.sh 2007-07-30 06:54:03 UTC (rev 2650)
@@ -14,38 +14,16 @@
FILE="${1}"
PACKAGE="${2}"
- case "${LIVE_CHROOT_BUILD}" in
- enabled)
- for ITEM in ${PACKAGE}
- do
- if ! `Chroot "dpkg-query -s ${ITEM}"`
- then
- PACKAGES="${PACKAGES} ${ITEM}"
- fi
- done
- ;;
+ Check_installed "${FILE}" "${PACKAGE}"
- disabled)
- if `which dpkg-query`
- then
- for ITEM in ${PACKAGE}
- do
- if ! `dpkg-query -s ${ITEM}`
- then
- PACKAGES="${PACKAGES} ${ITEM}"
- fi
- done
- else
- FILE="`echo ${FILE} | sed -e 's/chroot//'`"
-
- if [ ! -f "${FILE}" ] && [ ! -d "${FILE}" ]
- then
- Echo_error "You need to install ${PACKAGE} on your host system."
- exit 1
- fi
- fi
- ;;
- esac
+ if [ ${INSTALL_STATUS} -eq 1 ]
+ then
+ PACKAGES="${PACKAGES} ${PACKAGE}"
+ elif [ ${INSTALL_STATUS} -eq 2 ]
+ then
+ Echo_error "You need to install ${PACKAGE} on your host system."
+ exit 1
+ fi
}
Install_package ()
@@ -79,3 +57,46 @@
esac
fi
}
+
+# Check_installed
+# uses as return value global var INSTALL_STATUS
+# INSTALL_STATUS : 0 if package is installed
+# 1 if package isn't installed and we're in an apt managed system
+# 2 if package isn't installed and we aren't in an apt managed system
+Check_installed ()
+{
+ FILE="${1}"
+ PACKAGE="${2}"
+
+ case "${LIVE_CHROOT_BUILD}" in
+ enabled)
+ if Chroot "dpkg-query -s ${PACKAGE}" > /dev/null 2>&1
+ then
+ INSTALL_STATUS=0
+ else
+ INSTALL_STATUS=1
+ fi
+ ;;
+ disabled)
+ if which dpkg-query > /dev/null 2>&1
+ then
+ if Chroot "dpkg-query -s ${PACKAGE}" > /dev/null 2>&1
+ then
+ INSTALL_STATUS=0
+ else
+ INSTALL_STATUS=1
+ fi
+ else
+ FILE="`echo ${FILE} | sed -e 's/chroot//'`"
+
+ if [ ! -f "${FILE}" ]
+ then
+ INSTALL_STATUS=2
+ else
+ INSTALL_STATUS=0
+ fi
+ fi
+ ;;
+ esac
+}
+
Modified: dists/trunk/live-helper/helpers/lh_chroot_localization
===================================================================
--- dists/trunk/live-helper/helpers/lh_chroot_localization 2007-07-29 21:11:40 UTC (rev 2649)
+++ dists/trunk/live-helper/helpers/lh_chroot_localization 2007-07-30 06:54:03 UTC (rev 2650)
@@ -613,33 +613,33 @@
do
case "${LOCALIZATION}" in
iceape)
- Check_package chroot/usr/bin/iceape iceweasel-l10n-"${ICEAPE}"
+ Check_installed chroot/usr/bin/iceape iceape || Check_package iceweasel-l10n-"${ICEAPE}"
;;
icedove)
- Check_package chroot/usr/bin/icedove icedove-locale-"${ICEDOVE}"
+ Check_installed chroot/usr/bin/icedove icedove || Check_package icedove-locale-"${ICEDOVE}"
;;
iceweasel)
- Check_package chroot/usr/bin/iceweasel iceweasel-l10n-"${ICEWEASEL}"
+ Check_installed chroot/usr/bin/iceweasel iceweasel || Check_package iceweasel-l10n-"${ICEWEASEL}"
;;
kde)
- Check_package chroot/usr/bin/kstart kde-i18n-"${KDE}"
+ Check_installed chroot/usr/bin/kstart kdebase-bin || Check_package kde-i18n-"${KDE}"
;;
koffice)
- Check_package chroot/usr/bin/usr/bin/koconverter koffice-i18n-"${KOFFICE}"
+ Check_installed chroot/usr/bin/koconverter koffice || Check_package koffice-i18n-"${KOFFICE}"
;;
openoffice)
- Check_package chroot/usr/bin/ooffice openoffice.org-l10n-"${OPENOFFICE}"
+ Check_installed chroot/usr/bin/ooffice openoffice.org-common || Check_package openoffice.org-l10n-"${OPENOFFICE}"
;;
esac
done
- Check_package chroot/usr/bin/gwenview gwenview-i18n
- Check_package chroot/usr/bin/k3b k3b-i18n
+ Check_installed chroot/usr/bin/gwenview gwenview || Check_package gwenview-i18n
+ Check_installed chroot/usr/bin/k3b k3b || Check_package k3b-i18n
# Restoring cache
Restore_cache cache/packages_localization
More information about the debian-live-changes
mailing list