summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2012-06-11 17:04:17 +0200
committerPierre Schmitz <pierre@archlinux.de>2012-06-11 17:04:17 +0200
commit8bedb89fd67a3bf1ea72e1ac9cddd835b50714b1 (patch)
tree80d8d1a063b4cbc5e6a220e091b7c678305f2ed2
parentc7cda4734292bca540402bb87d1a258f2e4a0eaa (diff)
Add a version number to each chroot so we can tell the user when a rebuild is needed
-rw-r--r--mkarchroot.in8
1 files changed, 5 insertions, 3 deletions
diff --git a/mkarchroot.in b/mkarchroot.in
index 1b02e0e..7dc8005 100644
--- a/mkarchroot.in
+++ b/mkarchroot.in
@@ -10,6 +10,8 @@
m4_include(lib/common.sh)
+CHROOT_VERSION='v2'
+
FORCE='n'
RUN=''
NOCOPY='n'
@@ -181,6 +183,8 @@ if [[ -n $RUN ]]; then
#Sanity check
if [[ ! -f "${working_dir}/.arch-chroot" ]]; then
die "'${working_dir}' does not appear to be a Arch chroot."
+ elif [[ $(cat "${working_dir}/.arch-chroot") != ${CHROOT_VERSION} ]]; then
+ die "'${working_dir}' is not compatible with ${APPNAME} version ${CHROOT_VERSION}. Please rebuild."
fi
chroot_lock
@@ -235,8 +239,6 @@ else
copy_hostconf
- if [[ ! -e "${working_dir}/.arch-chroot" ]]; then
- date +%s > "${working_dir}/.arch-chroot"
- fi
+ echo "${CHROOT_VERSION}" > "${working_dir}/.arch-chroot"
# }}}
fi