summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2012-07-29 23:26:15 +0200
committerDaniel Baumann <daniel@debian.org>2012-07-29 23:26:31 +0200
commitecc1d7a0c239fa2d262e42dbbc0b0ac1893b71be (patch)
tree35b745e0df5024a4db9b0f92148b47677091825d /scripts
parent227ae768e6eb13bbd940b875b5b2a773ca88f459 (diff)
downloadvyos-live-build-ecc1d7a0c239fa2d262e42dbbc0b0ac1893b71be.tar.gz
vyos-live-build-ecc1d7a0c239fa2d262e42dbbc0b0ac1893b71be.zip
Adding possibility to specify a git branch when using lb config --config.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build/lb_config13
1 files changed, 11 insertions, 2 deletions
diff --git a/scripts/build/lb_config b/scripts/build/lb_config
index 9bc1f2a24..466f04f7c 100755
--- a/scripts/build/lb_config
+++ b/scripts/build/lb_config
@@ -42,7 +42,7 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\
\t [--cache-stages STAGE|\"STAGES\"]\n\
\t [--checksums md5|sha1|sha256|none]\n\
\t [--compression bzip2|gzip|lzip|xz|none]\n\
-\t [--config GIT_URL]\n\
+\t [--config GIT_URL::GIT_BRANCH]\n\
\t [--zsync true|false]\n\
\t [--build-with-chroot true|false]\n\
\t [--chroot-filesystem ext2|ext3|ext4|squashfs|jffs2|none]\n\
@@ -872,7 +872,16 @@ fi
if [ -n "${_CONFIG}" ]
then
- git clone ${_CONFIG} ./
+ _GIT_REPOSITORY="$(echo ${_CONFIG} | sed -e 's|::.*$||')"
+
+ git clone ${_GIT_REPOSITORY} ./
+
+ if [ "${_GIT_REPOSITORY}" != "${_CONFIG}" ]
+ then
+ _GIT_BRANCH="$(echo ${_CONFIG} | awk -F\:\: '{ print $NF }')"
+
+ git checkout ${_GIT_BRANCH}
+ fi
fi
# Read meta config