diff options
author | John Rigby <john.rigby@linaro.org> | 2011-06-02 12:44:57 -0600 |
---|---|---|
committer | John Rigby <john.rigby@linaro.org> | 2011-06-09 13:56:21 -0600 |
commit | f99546849e0f67fac9840cfd8422336e0ad7ccba (patch) | |
tree | 8b57fded2c4c75345d066d3bd71fd8514e5d6f27 /debian.linaro | |
parent | f9cb967d519ada211fb8e15c787d90cbfd3f2bde (diff) |
LINARO: add flavour splitting script and changes to use it
Signed-off-by: John Rigby <john.rigby@linaro.org>
Diffstat (limited to 'debian.linaro')
-rw-r--r-- | debian.linaro/control.d/flavour-control.stub | 2 | ||||
-rw-r--r-- | debian.linaro/control.stub.in | 2 | ||||
-rw-r--r-- | debian.linaro/rules.d/vars.mk | 1 | ||||
-rwxr-xr-x | debian.linaro/scripts/mkflavourbranches | 123 |
4 files changed, 126 insertions, 2 deletions
diff --git a/debian.linaro/control.d/flavour-control.stub b/debian.linaro/control.d/flavour-control.stub index 5ea910a5080..2a97b120d37 100644 --- a/debian.linaro/control.d/flavour-control.stub +++ b/debian.linaro/control.d/flavour-control.stub @@ -30,7 +30,7 @@ Pre-Depends: dpkg (>= 1.10.24) Depends: ${misc:Depends}, ${shlibs:Depends}, initramfs-tools (>= 0.36ubuntu6), coreutils | fileutils (>= 4.0), module-init-tools (>= 3.3-pre11-4ubuntu3), wireless-crda Conflicts: hotplug (<< 0.0.20040105-1) Recommends: BOOTLOADER -Suggests: fdutils, SRCPKGNAME-doc-PKGVER | SRCPKGNAME-source-PKGVER, SRCPKGNAME-tools +Suggests: fdutils, SRCPKGNAME-doc-PKGVER | SRCPKGNAME-source-PKGVER, COMMONSRCPKGNAME-tools Description: Linux kernel image for version PKGVER on DESC This package contains the Linux kernel image for version PKGVER on DESC. diff --git a/debian.linaro/control.stub.in b/debian.linaro/control.stub.in index ce74e04e5fd..47a2caf707f 100644 --- a/debian.linaro/control.stub.in +++ b/debian.linaro/control.stub.in @@ -19,7 +19,7 @@ Description: Header files related to Linux kernel version PKGVER that want the latest kernel headers. Please read /usr/share/doc/SRCPKGNAME-headers-PKGVER-ABINUM/debian.README.gz for details -Package: SRCPKGNAME-tools-PKGVER-ABINUM +Package: COMMONSRCPKGNAME-tools-PKGVER-ABINUM Architecture: armel Section: devel Priority: optional diff --git a/debian.linaro/rules.d/vars.mk b/debian.linaro/rules.d/vars.mk new file mode 100644 index 00000000000..37044bc3075 --- /dev/null +++ b/debian.linaro/rules.d/vars.mk @@ -0,0 +1 @@ +common_src_pkg_name = linux-linaro diff --git a/debian.linaro/scripts/mkflavourbranches b/debian.linaro/scripts/mkflavourbranches new file mode 100755 index 00000000000..1469aa57d33 --- /dev/null +++ b/debian.linaro/scripts/mkflavourbranches @@ -0,0 +1,123 @@ +#!/bin/bash +#set -x +#set -e + +DEBIAN=debian.linaro +source_pkg_name=$(dpkg-parsechangelog -l${DEBIAN}/changelog|grep Source|sed 's/^.*Source: //') +source_pkg_version=$(dpkg-parsechangelog -l${DEBIAN}/changelog|grep Version|sed 's/^.*Version: //') +common_flavour_prefix=linaro + + +function fail { + echo $1 + exit -1 +} + +function checkclean { + status=$(git status -s) + test -z "$status" || fail "Only run this script in a clean repo" +} + +function setup_working_branch { + hoser=$(git branch -a | grep " $1$") + test -z "$hoser" || fail "$1 already exists" + git checkout -b $1 +} + +function cleanup { + git reset --hard HEAD + git clean -d -f -x +} + +flavours=(${DEBIAN}/control.d/vars.*) +flavours=(${flavours[*]##*vars.${common_flavour_prefix}-}) +firstflavour=${flavours[0]} + +function do_flavour_branches { + for flavour in ${flavours[*]}; do + echo flavour is $flavour + otherflavours=(${flavours[*]##$flavour}) + echo otherflavours are ${otherflavours[*]} + + single_flavour_branch=${working_branch}-$flavour-only + git branch -f $single_flavour_branch HEAD + git checkout $single_flavour_branch + + sed -i -e "s/^${source_pkg_name}/${source_pkg_name}-$flavour/" ${DEBIAN}/changelog + git add ${DEBIAN}/changelog + + for otherflavour in ${otherflavours[*]}; do + git rm ${DEBIAN}/config/armel/config.flavour.${common_flavour_prefix}-$otherflavour + git rm ${DEBIAN}/control.d/vars.${common_flavour_prefix}-$otherflavour + sed -i -e "/${common_flavour_prefix}-$otherflavour/d" ${DEBIAN}/d-i/kernel-versions.in + git add ${DEBIAN}/d-i/kernel-versions.in + sed -i -e "s/${common_flavour_prefix}-$otherflavour//" ${DEBIAN}/rules.d/armel.mk + if [ "$flavour" = "$firstflavour" ]; then + # for first flavour only make the common header and tools deb + sed -i -e "s/do_common_headers_indep.*=.*/do_common_headers_indep = false/" ${DEBIAN}/rules.d/armel.mk + sed -i -e "s/do_tools.*=.*/do_tools = true/" ${DEBIAN}/rules.d/armel.mk + else + sed -i -e "s/do_common_headers_indep.*=.*/do_common_headers_indep = true/" ${DEBIAN}/rules.d/armel.mk + sed -i -e "s/do_tools.*=.*/do_tools = false/" ${DEBIAN}/rules.d/armel.mk + fi + git add ${DEBIAN}/rules.d/armel.mk + done + + git status + fakeroot ./debian/rules clean + fakeroot ./debian/rules updateconfigs + cat >> debian.linaro/config/armel/config.flavour.${common_flavour_prefix}-$flavour << END +# +# Single flavour kernel packages have no flavour dependent config options +# look in ../config.common.ubuntu for full config +# +END + cat >> debian.linaro/config/armel/config.common.armel << END +# +# Single flavour kernel packages have no arch dependent config options +# look in ../config.common.ubuntu for full config +# +END + git commit -s -m "LINARO: Cleanup configs after removing other flavours" debian.linaro/config + git commit -s -m "LINARO: Linaro-${source_pkg_version} $flavour only" + tagname="Linaro-${source_pkg_version}-${flavour}-only" + git tag -f -s -m "$tagname" $tagname HEAD + + git push $remote_push -f HEAD:$flavour-only + git push $remote_push -f $tagname + + git reset --hard HEAD + git checkout $working_branch + + cleanup + done +} + +test $# -eq 1 || fail "must provide a pushable remote" + +working_branch="tbranch$(dd 2>/dev/null if=/dev/urandom bs=10 count=1 | od -X | awk '{ print $2 }')" +echo Using $working_branch as working branch name + +remote_push=$1 + + +orig_branch=$(git symbolic-ref HEAD 2>/dev/null) +orig_branch=${orig_branch##refs/heads/} + +checkclean + +setup_working_branch $working_branch + +git push $remote_push -f $working_branch:master +tagname="Linaro-${source_pkg_version}" +git tag -f -s -m "$tagname" $tagname HEAD +git push $remote_push -f $tagname + +do_flavour_branches + +git checkout $orig_branch +git branch -D $working_branch + + +cleanup + |