diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-06-25 12:28:59 -0700 |
---|---|---|
committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-06-25 12:28:59 -0700 |
commit | 6d74afcd0e11de5cb56623d9121472e9212e8481 (patch) | |
tree | 9256187f8e4a5b3e6e9212105c87a2de187f68a9 | |
parent | ffe4cde6d3fd95131b4434ca2d88af469dacfd51 (diff) | |
download | vyos-cloud-init-6d74afcd0e11de5cb56623d9121472e9212e8481.tar.gz vyos-cloud-init-6d74afcd0e11de5cb56623d9121472e9212e8481.zip |
1. Moving around the packages dir.
2. Adjusting the bddep shell script
3. Starting to add a brpm
-rwxr-xr-x | packages/bddeb | 62 | ||||
-rwxr-xr-x | packages/brpm | 3 | ||||
-rw-r--r-- | packages/debian.trunk/changelog (renamed from debian.trunk/changelog) | 0 | ||||
-rw-r--r-- | packages/debian.trunk/compat (renamed from debian.trunk/compat) | 0 | ||||
-rw-r--r-- | packages/debian.trunk/control (renamed from debian.trunk/control) | 0 | ||||
-rw-r--r-- | packages/debian.trunk/copyright (renamed from debian.trunk/copyright) | 0 | ||||
-rw-r--r-- | packages/debian.trunk/dirs (renamed from debian.trunk/dirs) | 0 | ||||
-rw-r--r-- | packages/debian.trunk/pycompat (renamed from debian.trunk/pycompat) | 0 | ||||
-rwxr-xr-x | packages/debian.trunk/rules (renamed from debian.trunk/rules) | 0 | ||||
-rwxr-xr-x | packages/make-dist-tarball (renamed from tools/make-dist-tarball) | 4 | ||||
-rwxr-xr-x | tools/bddeb | 33 |
11 files changed, 67 insertions, 35 deletions
diff --git a/packages/bddeb b/packages/bddeb new file mode 100755 index 00000000..74932985 --- /dev/null +++ b/packages/bddeb @@ -0,0 +1,62 @@ +#!/bin/sh + +# Ensure we can find the setup.py file which +# should be at the root of the cloud-init tree +PKG_DIR=`pwd` +ROOT="$PKG_DIR/../" +if [ ! -e "$ROOT/setup.py" ]; then + echo "No setup.py found at $ROOT" + exit 1 +fi +echo "Using root directory $ROOT for building your debian package" + +# Ensure tempdir is cleaned and ready to go +TEMP_D=$(mktemp -d "${TMPDIR:-/tmp}/${0##*/}.XXXXXXX") +echo "With $TEMP_D as a temporary workspace" +rm -Rf "${TEMP_D}"; mkdir "${TEMP_D}" +set -e + +# Ensure tempdir removed if breaks... +trap "rm -Rf '${TEMP_D}'" EXIT SIGINT SIGTERM + +# Go to the root and start making a package! +cd $ROOT +files=$(bzr ls --versioned) +revno=$(bzr revno) +version=$(awk -F: \ + '$1 ~ /[0-9][.][0-9]+[.][0-9]+/ { print $1 ; exit(0); }' ChangeLog ) + +# Ensure that the version found in 'Changelog' is the same in the python +# cloud-init version directory +py_version=$(python -c 'from cloudinit import version; import sys; \ +sys.stdout.write(version.version_string())') + +# Canonicalize the changelog version +ch_version=$(python -c "from distutils import version; import sys; \ +sys.stdout.write(str(version.StrictVersion('$version')));") + +if [ "$py_version" != "$ch_version" ]; then + echo "Cloud-init python version $py_version" \ + " != changelog version $ch_version" + echo "Please ensure they are the same!" + exit 1 +fi + +mkdir "${TEMP_D}/cloud-init" +otar="$TEMP_D/cloud-init_$version~bzr${revno}.orig.tar.gz" +tar -czf - ${files} > "$otar" +tar -C "${TEMP_D}/cloud-init" -xzf - < "$otar" + +if [ ! -d "${TEMP_D}/cloud-init/debian" ]; then + rsync -a $PKG_DIR/debian.trunk/ "${TEMP_D}/cloud-init/debian" +fi + +sed -i -e "s,VERSION,$version," -e "s,REVNO,bzr$revno," \ + "$TEMP_D/cloud-init/debian/changelog" + +cd "${TEMP_D}/cloud-init" +debuild "$@" +debname="cloud-init_${version}~bzr${revno}-1_all.deb" +mv "../$debname" "$PKG_DIR" +echo "Wrote $debname to $PKG_DIR" + diff --git a/packages/brpm b/packages/brpm new file mode 100755 index 00000000..829303ea --- /dev/null +++ b/packages/brpm @@ -0,0 +1,3 @@ +#!/bin/sh + + diff --git a/debian.trunk/changelog b/packages/debian.trunk/changelog index a36d00d6..a36d00d6 100644 --- a/debian.trunk/changelog +++ b/packages/debian.trunk/changelog diff --git a/debian.trunk/compat b/packages/debian.trunk/compat index 7ed6ff82..7ed6ff82 100644 --- a/debian.trunk/compat +++ b/packages/debian.trunk/compat diff --git a/debian.trunk/control b/packages/debian.trunk/control index f0dcef6a..f0dcef6a 100644 --- a/debian.trunk/control +++ b/packages/debian.trunk/control diff --git a/debian.trunk/copyright b/packages/debian.trunk/copyright index dc993525..dc993525 100644 --- a/debian.trunk/copyright +++ b/packages/debian.trunk/copyright diff --git a/debian.trunk/dirs b/packages/debian.trunk/dirs index f3de468d..f3de468d 100644 --- a/debian.trunk/dirs +++ b/packages/debian.trunk/dirs diff --git a/debian.trunk/pycompat b/packages/debian.trunk/pycompat index 0cfbf088..0cfbf088 100644 --- a/debian.trunk/pycompat +++ b/packages/debian.trunk/pycompat diff --git a/debian.trunk/rules b/packages/debian.trunk/rules index 0f79136c..0f79136c 100755 --- a/debian.trunk/rules +++ b/packages/debian.trunk/rules diff --git a/tools/make-dist-tarball b/packages/make-dist-tarball index d6d53aa7..622283bd 100755 --- a/tools/make-dist-tarball +++ b/packages/make-dist-tarball @@ -9,7 +9,7 @@ Usage: ${0##*/} version EOF } -topdir=$PWD +topdir="../$PWD" tag=${1} [ -n "$tag" ] || { Usage 1>&2 ; exit 1; } @@ -22,4 +22,4 @@ out=${topdir}/cloud-init-${tag}.tar.gz cd ${tmpd} && bzr branch -r "tag:${tag}" "${topdir}" ./cloud-init-${tag} && tar czf "${out}" cloud-init-${tag}/ --exclude cloud-init-${tag}/.bzr && - echo "wrote ${out}" + echo "Wrote ${out}" diff --git a/tools/bddeb b/tools/bddeb deleted file mode 100755 index b162b06f..00000000 --- a/tools/bddeb +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -TEMP_D=$(mktemp -d "${TMPDIR:-/tmp}/${0##*/}.XXXXXXX") -#TEMP_D=/tmp/my.d -start=${PWD} -rm -Rf "${TEMP_D}"; mkdir "${TEMP_D}" -set -e -trap "rm -Rf '${TEMP_D}'" exit -files=$(bzr ls --versioned) -revno=$(bzr revno) -version=$(awk -F: \ - '$1 ~ /[0-9][.][0-9]+[.][0-9]+/ { print $1 ; exit(0); }' ChangeLog ) -mkdir "${TEMP_D}/cloud-init" -otar="$TEMP_D/cloud-init_$version~bzr${revno}.orig.tar.gz" -tar -czf - ${files} > "$otar" -tar -C "${TEMP_D}/cloud-init" -xzf - <"$otar" - -if [ ! -d "${TEMP_D}/cloud-init/debian" ]; then - rsync -a debian.trunk/ "${TEMP_D}/cloud-init/debian" -fi -sed -i -e "s,VERSION,$version," -e "s,REVNO,bzr$revno," \ - "$TEMP_D/cloud-init/debian/changelog" -cd "${TEMP_D}/cloud-init" -debuild "$@" -#for x in ../*.deb; do -# echo wrote ${x##*/} -#done -debname="cloud-init_${version}~bzr${revno}-1_all.deb" -mv "../$debname" "$start" -link="$start/cloud-init_all.deb" -echo "wrote $debname" -[ ! -e "$link" -o -L "$link" ] - { ln -sf "$debname" "$link" && echo "linked ${link##*/}"; } |