diff options
Diffstat (limited to 'debian')
-rw-r--r-- | debian/README.source | 50 | ||||
-rw-r--r-- | debian/cloud-init.install | 11 | ||||
-rw-r--r-- | debian/cloud-init.templates | 2 | ||||
-rw-r--r-- | debian/control | 2 | ||||
-rw-r--r-- | debian/dirs | 5 | ||||
-rwxr-xr-x | debian/new-upstream-snapshot | 166 | ||||
-rwxr-xr-x | debian/rules | 7 |
7 files changed, 131 insertions, 112 deletions
diff --git a/debian/README.source b/debian/README.source index 5e4319fb..86bcf530 100644 --- a/debian/README.source +++ b/debian/README.source @@ -1,43 +1,23 @@ === General Info === -Development packaging branch is at - lp:ubuntu/<suite>/cloud-init -alternatively, if you're on the development release: - lp:ubuntu/cloud-init +Packaging branches for the Ubuntu development release are maintained in +upstream git under ubuntu/devel branch. -Patches in debian/patches are also stored applied in bzr. + git clone git://git.launchpad.net/cloud-init -b ubuntu/devel -To cherry pick revisions 391 to tip from from trunk, do something like: - s=391; e=; - b=../trunk; - [ -n "${e}" ] || e=$(cd ${b} && bzr revno) - pfile=catchup-${s}${e:+-${e}}.patch - [ "$s" = "$e" ] && pfile=catchup-${s}.patch - ( cd ../trunk && bzr log -r$s..$e && - bzr diff -p1 -r$(($s-1))..$e ) > ../$pfile.full - mkdir -p debian/patches - filterdiff --exclude "*/ChangeLog" < ../$pfile.full > debian/patches/$pfile - echo "$pfile" >> debian/patches/series - quilt push - quilt refresh - files="$(quilt files ${pfile}) debian/patches/series debian/patches/${pfile}" - files="$files .pc/${pfile} .pc/applied-patches" - bzr add $files +Stable release branches are also available in ubuntu/<codename> + $ git clone git://git.launchpad.net/cloud-init + $ cd cloud-init + $ git branch -r + origin/HEAD -> origin/master + origin/master + origin/ubuntu/devel + origin/ubuntu/precise + origin/ubuntu/trusty + origin/ubuntu/xenial - # now add an entry - dch --append "${pfile} (sync to $e)" - dch --edit # improve the entry - debcommit $files - - ../$pfile.full will have the full diff. See 'ChangeLog' entries there - and debian/patches/$pfile for help writing debian/changelog entry - -You can set 'e' (end) to not go to tip. - -== Cherry pick single patch == -There is a utility in debian/cherry-pick-rev that will -help to cherry pick a single commit from trunk. +Patches in debian/patches are stored un-applied. == New snapshot == -To pull a new upstream snapshot, given lp:cloud-init in ../trunk: +To pull a new upstream snapshot: ./debian/new-upstream-snapshot ../trunk diff --git a/debian/cloud-init.install b/debian/cloud-init.install deleted file mode 100644 index d985f51e..00000000 --- a/debian/cloud-init.install +++ /dev/null @@ -1,11 +0,0 @@ -./tools/21-cloudinit.conf etc/rsyslog.d/ -./tools/Z99-cloud-locale-test.sh etc/profile.d/ -etc/cloud -etc/init/*.conf -lib/systemd/* -lib/udev/* -usr/bin -usr/lib/cloud-init -usr/lib/python*/*-packages/*egg-info -usr/lib/python*/*-packages/cloudinit -usr/share/doc/cloud-init diff --git a/debian/cloud-init.templates b/debian/cloud-init.templates index 30bf04a1..f056f05b 100644 --- a/debian/cloud-init.templates +++ b/debian/cloud-init.templates @@ -1,7 +1,7 @@ Template: cloud-init/datasources Type: multiselect Default: NoCloud, ConfigDrive, OpenNebula, Azure, AltCloud, OVF, MAAS, GCE, OpenStack, CloudSigma, SmartOS, Ec2, CloudStack, None -Choices-C: NoCloud, ConfigDrive, OpenNebula, Azure, AltCloud, OVF, MAAS, GCE, Openstack, CloudSigma, SmartOS, Ec2, CloudStack, None +Choices-C: NoCloud, ConfigDrive, OpenNebula, Azure, AltCloud, OVF, MAAS, GCE, OpenStack, CloudSigma, SmartOS, Ec2, CloudStack, None Choices: NoCloud: Reads info from /var/lib/cloud/seed only, ConfigDrive: Reads data from Openstack Config Drive, OpenNebula: read from OpenNebula context disk, Azure: read from MS Azure cdrom. Requires walinux-agent, AltCloud: config disks for RHEVm and vSphere, OVF: Reads data from OVF Transports, MAAS: Reads data from Ubuntu MAAS, GCE: google compute metadata service, OpenStack: native openstack metadata service, CloudSigma: metadata over serial for cloudsigma.com, SmartOS: Read from SmartOS metadata service, Ec2: reads data from EC2 Metadata service, CloudStack: Read from CloudStack metadata service, None: Failsafe datasource Description: Which data sources should be searched? Cloud-init supports searching different "Data Sources" for information diff --git a/debian/control b/debian/control index 1788abb8..e9eb9b67 100644 --- a/debian/control +++ b/debian/control @@ -27,6 +27,8 @@ Build-Depends: debhelper (>= 9), python3-unittest2, python3-yaml XS-Python-Version: all +Vcs-Browser: https://git.launchpad.net/cloud-init/?h=ubuntu/devel +Vcs-Git: git://git.launchpad.net/cloud-init -b ubuntu/devel Standards-Version: 3.9.6 Package: cloud-init diff --git a/debian/dirs b/debian/dirs deleted file mode 100644 index f966b7de..00000000 --- a/debian/dirs +++ /dev/null @@ -1,5 +0,0 @@ -etc/cloud -etc/init -usr/bin -usr/share/doc/cloud -var/lib/cloud diff --git a/debian/new-upstream-snapshot b/debian/new-upstream-snapshot index 0e71d41a..ef7510c2 100755 --- a/debian/new-upstream-snapshot +++ b/debian/new-upstream-snapshot @@ -1,69 +1,117 @@ #!/bin/sh +TEMP_D="" +error() { echo "$@" 1>&2; } +fail() { [ $# -eq 0 ] || error "$@"; exit 1; } Usage() { - cat <<EOF -Usage: ${0##*/} trunk-dir [next-upstream-version] - - pull in new upstream snapshot from trunk-dir +cat <<EOF +${0##*/} [branch] + update current branch with trunk branch. + branch defaults to 'master' +EOF +} - Leaves file 'new-changes.log' +print_commit() { + local subject="$1" author="$2" bugs="$3" aname="" + aname=${author% <*} + echo " - $subject [${aname}]${bugs:+ (LP: ${bugs})}" +} - Example: - $ ${0##*/} ../trunk - # prepare bzr dir in . with new snapshot from ../trunk - $ dch --edit - # read changes in new-changes.log and write changelog - $ debcommit - $ dch --release - $ debcommit --release -EOF +git_log_to_dch() { + local line="" commit="" lcommit="" bugs="" + while :; do + read line || break + case "$line" in + commit\ *) + if [ -n "$commit" ]; then + print_commit "$subject" "$author" "$bugs" + fi + commit=${line#*: } + bugs="" + author="" + subject="" + ;; + Author:*) author="${line#Author: }";; + LP:*) bugs="${bugs:+${bugs}, }${line#*: }";; + "") [ -z "$subject" ] && read subject;; + esac + done + if [ -n "$commit" ]; then + print_commit "$subject" "$author" "$bugs" + fi } -fail() { echo "$@" 1>&2; exit 1; } - -name="cloud-init" -[ $# -eq 0 ] && { Usage 1>&2; exit 1; } -[ "$1" = "-h" -o "$1" = "--help" ] && { Usage; exit 0; } -trunk=$1 -revno=${2:-tip} -uver=${3:-0.7.7} # the *next* upstream version - -[ -d "$trunk" ] || - fail "trunk dir '$trunk' not a dir" -if [ "$revno" = "tip" ]; then - revno=$(cd "$trunk" && bzr revno) || - fail "failed getting bzr revno from $trunk" -fi -pversion=$(dpkg-parsechangelog --show-field Version) || - fail "failed to read previous version with dpkg-parsechangelog" -prevno=$(echo "$pversion" | sed 's,.*bzr\([0-9]\+\)-.*,\1,') || - fail "fail reading previous bzr revision from previous version '$pversion'" -version=${uver}~bzr${revno} -tarball=${name}-${version}.tar.gz -t=../${name}_${version}.orig.tar.gz -if [ -f "$t" ]; then - echo "using '$t' as tarball" 1>&2 - tarball="$t" -else - echo "creating $tarball with bzr export" 1>&2 - bzr export --format=tgz "--revision=${revno}" "$tarball" "${trunk}" || - fail "failed exporting bzr in $trunk to $tarball" +cleanup() { + [ ! -d "${TEMP_D}" ] || rm -Rf "${TEMP_D}" +} + +from_ref=${1:-"master"} +cur_branch=$(git rev-parse --abbrev-ref HEAD) || + fail "failed to get current branch" + +case "$cur_branch" in + ubuntu/*) :;; + *) fail "You are on branch '$cur_branch', expect to be on ubuntu/*";; +esac + +trap cleanup EXIT + +prev_pkg_ver=$(dpkg-parsechangelog --show-field Version) || + fail "failed reading package version" +pkg_name=$(dpkg-parsechangelog --show-field Source) || + fail "failed to read Source from changelog" + +# turn 0.7.7-10-gbc2c326-0ubuntu1 into 'bc2c326' +t=${prev_pkg_ver%-*} +prev_pkg_hash=${t##*-g} + +new_pkg_upstream=$(git describe master) +new_pkg_debian="0ubuntu1" +new_upstream_ver=$(git describe "${from_ref}") +new_pkg_ver="${new_upstream_ver}-${new_pkg_debian}" + +prev_upstream_ver=${prev_pkg_ver%-*} +if [ "${prev_upstream_ver}" = "${new_upstream_ver}" ]; then + echo "nothing to commit. '$from_ref' is at ${new_upstream_ver}." + exit 0 fi -bzr merge-upstream "$tarball" "--version=${version}" || - fail "failed merge-upstream of $tarball at version=$version" -oldrev=$(($prevno+1)) -( cd "$trunk" && bzr log -r "${oldrev}..${revno}" ) > new-changes.log || - fail "failed to get changes from ${oldrev}..$revno" +git merge "${from_ref}" -m "merge from $from_ref at $new_upstream_ver" || + fail "failed: git merge ${from_ref} -m 'merge from $from_ref ..'" +TEMP_D=$(mktemp -d) || fail "failed mktemp" +clog="${TEMP_D}/changelog" +gitlog="${TEMP_D}/gitlog" -cat <<EOF -==== -Now see ./new-changes.log for changes between $oldrev and $revno - -then: - $ dch --edit - # read changes in new-changes.log and write changelog - $ debcommit - $ dch --release - $ debcommit --release - $ debuild -S +git log --first-parent --no-decorate --format=full \ + "${prev_pkg_hash}..${from_ref}" > "$gitlog" || + fail "failed git log ${prev_pkg_hash}..${from_ref}" + +cat >> "$clog" <<EOF +$pkg_name ($new_pkg_ver) UNRELEASED; urgency=medium + + * New upstream snapshot. EOF +git_log_to_dch < "$gitlog" >> "$clog" || + fail "failed git_log_to_dch" +cat >> "$clog" <<EOF + + -- ${DEBFULLNAME} <$DEBEMAIL> $(date -R) + +EOF + +cat "$clog" "debian/changelog" > "$TEMP_D/newlog" && + cp "$TEMP_D/newlog" "debian/changelog" || + fail "failed replacing debian/changelog" + +dch -e || fail "dch -e exited $?" + +git diff + +echo -n "Commit this change? (Y/n): " +read answer || fail "failed to read answer" +case "$answer" in + n|[Nn][oO]) exit 1;; +esac + +msg="update changelog (new upstream snapshot $new_upstream_ver)." +git commit -m "$msg" debian/changelog || + fail "failed to commit '$msg'" diff --git a/debian/rules b/debian/rules index 4008d73f..ef13251f 100755 --- a/debian/rules +++ b/debian/rules @@ -7,10 +7,15 @@ export PYBUILD_INSTALL_ARGS=--init-system=$(INIT_SYSTEM) override_dh_auto_test: ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) - http_proxy= make PYVER=3 check + http_proxy= make PYVER=python3 check else @echo check disabled by DEB_BUILD_OPTIONS=$(DEB_BUILD_OPTIONS) endif override_dh_systemd_start: dh_systemd_start --no-restart-on-upgrade --no-start + +override_dh_auto_install: + dh_auto_install --destdir=debian/cloud-init + install -D ./tools/21-cloudinit.conf debian/cloud-init/etc/rsyslog.d/21-cloudinit.conf + install -D ./tools/Z99-cloud-locale-test.sh debian/cloud-init/etc/profile.d/Z99-cloud-locale-test.sh |