From 48939b9ac9d2644580326e7d4c82d8189a22b9c5 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 19 Feb 2013 12:01:27 +0100 Subject: Harmonize handling of pre-existing gnupg dotfiles in chroot when handling fake signing keys for local repository. --- scripts/build/chroot_archives | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'scripts/build/chroot_archives') diff --git a/scripts/build/chroot_archives b/scripts/build/chroot_archives index af02739bd..b0d86a2b1 100755 --- a/scripts/build/chroot_archives +++ b/scripts/build/chroot_archives @@ -366,13 +366,12 @@ EOF if [ "${LB_APT_SECURE}" = "true" ] then - _LB_DOTGNUPG_EXISTED=0 - if [ -d chroot/root/.gnupg ] + if [ -e chroot/root/.gnupg ] then - _LB_DOTGNUPG_EXISTED=1 + mv chroot/root/.gnupg chroot/root/.gnupg.orig fi - # Ensure ~/.gnupg exists (required for gnupg >= ~1.4.9) + # Ensure ~/.gnupg exists mkdir -p chroot/root/.gnupg # Temporarily replace /dev/random with /dev/urandom so as not @@ -436,10 +435,11 @@ EOF mv chroot/dev/random.orig chroot/dev/random fi - # Remove /root/.gnupg if we created it during the signing process - if [ "${_LB_DOTGNUPG_EXISTED}" -eq 0 ] + rm -rf chroot/root/.gnupg + + if [ -e chroot/root/.gnupg.orig ] then - rm -rf chroot/root/.gnupg + mv chroot/root/.gnupg.orig chroot/root/.gnupg fi fi -- cgit v1.2.3