summaryrefslogtreecommitdiffstats
path: root/share/hooks/pre-create.git-pull.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2018-02-18 15:12:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2018-02-18 15:13:09 +0000
commit6dfbd8d9b0b55ebe052f91ae5823d8108799983a (patch)
tree896756a156d905f4374cedb73a03fc8b73ba67ce /share/hooks/pre-create.git-pull.sh
parentReleasing debian version 20180118-1. (diff)
downloadopen-infrastructure-compute-tools-6dfbd8d9b0b55ebe052f91ae5823d8108799983a.tar.xz
open-infrastructure-compute-tools-6dfbd8d9b0b55ebe052f91ae5823d8108799983a.zip
Merging upstream version 20180218.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'share/hooks/pre-create.git-pull.sh')
-rwxr-xr-xshare/hooks/pre-create.git-pull.sh35
1 files changed, 20 insertions, 15 deletions
diff --git a/share/hooks/pre-create.git-pull.sh b/share/hooks/pre-create.git-pull.sh
index 3719d43..cee7d8c 100755
--- a/share/hooks/pre-create.git-pull.sh
+++ b/share/hooks/pre-create.git-pull.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# container-tools - Manage systemd-nspawn containers
-# Copyright (C) 2014-2017 Daniel Baumann <daniel.baumann@open-infrastructure.net>
+# Copyright (C) 2014-2018 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
# SPDX-License-Identifier: GPL-3.0+
#
@@ -20,23 +20,28 @@
set -e
-if [ -e /etc/container-tools/debconf/.git ] && [ -e /usr/bin/git ]
-then
- echo "Updating /etc/container-tools/debconf..."
+DIRECTORIES="/etc/container-tools/debconf /etc/container-tools/debconf/*/"
- if [ -e /etc/default/container-tools ]
+for DIRECTORY in ${DIRECTORIES}
+do
+ if [ -e "${DIRECTORY}/.git" ] && [ -e /usr/bin/git ]
then
- . /etc/default/container-tools
- fi
+ echo "Updating ${DIRECTORY}..."
+
+ if [ -e /etc/default/container-tools ]
+ then
+ . /etc/default/container-tools
+ fi
- DEBCONF_ID="${DEBCONF_ID:-HEAD}"
+ DEBCONF_ID="${DEBCONF_ID:-HEAD}"
- cd /etc/container-tools/debconf
+ cd "${DIRECTORY}"
- git clean -dfx
- git checkout -f ${DEBCONF_ID}
- git pull --rebase
- echo
+ git clean -dfx
+ git checkout -f ${DEBCONF_ID}
+ git pull --rebase
+ echo
- cd "${OLDPWD}"
-fi
+ cd "${OLDPWD}"
+ fi
+done