diff options
author | Daniil Baturin <daniil@baturin.org> | 2018-05-25 01:30:40 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-25 01:30:40 +0700 |
commit | 1033e7876a7f1f0be8150047852804a66ee4dd23 (patch) | |
tree | ee6d9c81387c90e3e59e18b35761052bf57c397b /tools | |
parent | 17de291859b87bfb7d477adbe1a40d19f3f61ae0 (diff) | |
parent | 20536aa5212baaa8b61944d5b3934222cfa9e2fb (diff) | |
download | vyos-build-1033e7876a7f1f0be8150047852804a66ee4dd23.tar.gz vyos-build-1033e7876a7f1f0be8150047852804a66ee4dd23.zip |
Merge pull request #15 from mtudosoiu/current
task #T555 && #T556 add tools/submod-mk and Dockerfile to vyos-build repository
Diffstat (limited to 'tools')
-rw-r--r-- | tools/submod-mk | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/tools/submod-mk b/tools/submod-mk new file mode 100644 index 00000000..eb61da18 --- /dev/null +++ b/tools/submod-mk @@ -0,0 +1,84 @@ +#!/bin/bash +# +# **** License **** +# +# Copyright (C) 2013 Vyatta, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +# **** End License **** + +progname=${0##*/} +shopt -s nullglob +shopt -s extglob +cd packages + +info=echo +trace= +noclean="-nc" +build="debuild -i -b -uc -us" + +declare -a submodule +declare -a debs +for debian in !(installer|linux-kernel-di-i386-2.6)/debian ; do + smod=${debian%/*} + debs=( ${smod}_*.deb ) + if [ ${#debs[@]} -eq 0 ] ; then + submodule+=( $smod ) + fi +done + +while [ $# -gt 0 ] ; do + case "$1" in + -h | --help ) + cat <<-EOF +Usage: $progname [Options] [ SUBMODULE... ] +Options: + -n | --do-nothing DonĀ“t actually remove or build anything, + just show what would be done + -q | --quiet Quiet, don't print progress info + -c | --clean Clean build + -b | --binary Skip source package build (default) + -s | --source Build binary and source packages + -S | --signed-source Build and sign packages + +If no SUBMODULE(s) given, build all checked-out submodules w/o debs. +EOF + exit 0;; + -n | --do-nothing ) + trace=echo + shift;; + -q | --quiet ) + info='#' + shift;; + -c | --clean ) + noclean= + shift;; + -b | --binary ) + shift ;; # default + -s | --source ) + build="git buildpackage -uc -us" + shift;; + -S | --signed-source ) + build="git buildpackage" + shift;; + * ) + submodule=( $@ ) + break;; + esac +done + +for (( i=0; i<${#submodule[@]}; i++)) ; do + eval $info P: ${submodule[i]} + ( cd ${submodule[i]} && eval $trace $build $noclean ) || exit $? +done |