Fix build failure when retrying build at deconfiguring file /bin/hostname.

If you attempt a build and it fails for whatever reasons (say, a
configuration issue) and then you retry your build without calling
lh_clean, you can sometimes run into an issue with the
'deconfiguring file /bin/hostname' step. It'll try to move
chroot/bin/hostname.orig to chroot/bin/hostname but
chroot/bin/hostname.orig won't exist as chroot/bin/hostname hasn't
been moved aside like it expects (ie. the original file is still
chroot/bin/hostname). This is frustrating since if the error was
ignored, the build would be able to complete successfully and as
expected. So, let lh_chroot_hostname check if
'chroot/bin/hostname.orig' exists before attempting to
move it to 'chroot/bin/hostname'.
This commit is contained in:
Cody A.W. Somerville 2009-09-02 07:32:45 +02:00 committed by Daniel Baumann
parent 8f36b8bcbf
commit a55187778e
1 changed files with 4 additions and 1 deletions

View File

@ -73,7 +73,10 @@ EOF
Echo_message "Deconfiguring file /bin/hostname" Echo_message "Deconfiguring file /bin/hostname"
# Restore hostname file # Restore hostname file
mv chroot/bin/hostname.orig chroot/bin/hostname if [ -e chroot/bin/hostname.orig ]
then
mv chroot/bin/hostname.orig chroot/bin/hostname
fi
# Removing stage file # Removing stage file
rm -f .stage/chroot_hostname rm -f .stage/chroot_hostname