diff options
author | Daniel Baumann <daniel@debian.org> | 2013-02-19 12:01:27 +0100 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2013-04-09 05:40:16 +0200 |
commit | 4259fcac5d3b3650cfa66f50b52413f0b9ec2182 (patch) | |
tree | 1669e37884a87b07b3d0b0dca645c80c15b050f0 /scripts | |
parent | dd6f9b7cfae47067f86a39827e40475883432331 (diff) | |
download | vyos-live-build-4259fcac5d3b3650cfa66f50b52413f0b9ec2182.tar.gz vyos-live-build-4259fcac5d3b3650cfa66f50b52413f0b9ec2182.zip |
Harmonize handling of pre-existing gnupg dotfiles in chroot when handling fake signing keys for local repository.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build/chroot_archives | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/scripts/build/chroot_archives b/scripts/build/chroot_archives index 06e16fb78..6e464ec4d 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 |