[Fai-commit] r6690 - trunk/lib
Thomas Lange
lange at alioth.debian.org
Tue Oct 18 14:49:16 UTC 2011
Author: lange
Date: 2011-10-18 14:49:16 +0000 (Tue, 18 Oct 2011)
New Revision: 6690
Modified:
trunk/lib/subroutines
trunk/lib/updatebase
Log:
move code for loading apt keys into task_prepareapt
Modified: trunk/lib/subroutines
===================================================================
--- trunk/lib/subroutines 2011-10-17 13:38:03 UTC (rev 6689)
+++ trunk/lib/subroutines 2011-10-18 14:49:16 UTC (rev 6690)
@@ -884,7 +884,7 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
### BEGIN SUBROUTINE INFO
# Provides-Var: none
-# Requires-Var: $FAI_ROOT $FAI_ETC_DIR $FAI_ALLOW_UNSIGNED
+# Requires-Var: $classes $FAI $FAI_ROOT $FAI_ETC_DIR $FAI_ALLOW_UNSIGNED
# Suggests-Var:
# Short-Description: prepare package repository access
### END SUBROUTINE INFO
@@ -912,6 +912,31 @@
Aptitude::CmdLine::Ignore-Trust-Violations yes;
EOF
fi
+
+ # add apt keys for signed repositories
+
+ declare -A keys
+ # remember all available *.asc files
+ for f in `cd $FAI/package_config; ls *.asc 2>/dev/null`; do
+ keys["$f"]=1
+ done
+
+ # add apt keys for all classes
+ for keyfile in $classes; do
+ [ ! -f $FAI/package_config/$keyfile ] && continue
+ echo -n "Loading APT key from $keyfile "
+ cat $FAI/package_config/$keyfile | $ROOTCMD apt-key add -
+ unset keys["$keyfile"]
+ done
+
+ # print which *.asc files were not loaded
+ if [ ${#keys[@]} -ne 0 ]; then
+ echo "Following signatures are not loaded:"
+ for i in "${!keys[@]}"; do
+ echo "$i"
+ done
+ echo "You have to rename them to match a class name."
+ fi
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
task_updatebase() {
Modified: trunk/lib/updatebase
===================================================================
--- trunk/lib/updatebase 2011-10-17 13:38:03 UTC (rev 6689)
+++ trunk/lib/updatebase 2011-10-18 14:49:16 UTC (rev 6690)
@@ -8,29 +8,6 @@
echo "Updating base"
-# add apt keys for signed repositories
-
-declare -A keys
-# store all available *.asc files
-for f in `cd $FAI/package_config; ls *.asc 2>/dev/null`; do
- keys["$f"]=1
-done
-
-for keyfile in $classes; do
- [ ! -f $FAI/package_config/$keyfile ] && continue
- echo -n "Loading APT key from $keyfile "
- cat $FAI/package_config/$keyfile | $ROOTCMD apt-key add -
- unset keys["$keyfile"]
-done
-
-if [ ${#keys[@]} -ne 0 ]; then
- echo "Following signatures are not loaded:"
- for i in "${!keys[@]}"; do
- echo "$i"
- done
- echo "You have to rename them to match a class name."
-fi
-
# first setup the environment in /target
if [ "$FAI_ACTION" = "install" -o "$FAI_ACTION" = "dirinstall" ]; then
mount -t proc proc $FAI_ROOT/proc
More information about the Fai-commit
mailing list