← Back to team overview

curtin-dev team mailing list archive

[Merge] ~dbungert/curtin:build-deb-dch into curtin:master

 

Dan Bungert has proposed merging ~dbungert/curtin:build-deb-dch into curtin:master.

Commit message:
build-deb: changelog gen with dch

* primary reason for this is to generate the changelog with a real
  DEBNAME/DEBEMAIL
* remove template debian/changelog.trunk
* assume debian version 0ubuntu1
* let dch manage the changelog file

Requested reviews:
  curtin developers (curtin-dev)

For more details, see:
https://code.launchpad.net/~dbungert/curtin/+git/curtin/+merge/413637
-- 
Your team curtin developers is requested to review the proposed merge of ~dbungert/curtin:build-deb-dch into curtin:master.
diff --git a/debian/changelog.trunk b/debian/changelog.trunk
deleted file mode 100644
index 4d943c0..0000000
--- a/debian/changelog.trunk
+++ /dev/null
@@ -1,5 +0,0 @@
-curtin (UPSTREAM_VER-0ubuntu1) UNRELEASED; urgency=low
-
-  * Initial release
-
- -- Scott Moser <smoser@xxxxxxxxxx>  Mon, 29 Jul 2013 16:12:09 -0400
diff --git a/tools/build-deb b/tools/build-deb
index dbe364f..6355592 100755
--- a/tools/build-deb
+++ b/tools/build-deb
@@ -1,7 +1,7 @@
 #!/bin/sh
 # This file is part of curtin. See LICENSE file for copyright and license info.
 
-set -e
+set -eu
 
 sourcename="curtin"
 TEMP_D=""
@@ -40,15 +40,9 @@ if [ $# -eq 0 ]; then
    set -- -S -d -us -uc
 fi
 
-# grab the first line in the changelog
-# hopefully this pulls the version info there
-# resulting in something like: UPSTREAM_VER-0ubuntu1
-clogver_o=$(sed -n '1s,.*(\([^)]*\)).*,\1,p' debian/changelog.trunk)
-
 # uver gets 17.1-3-gc85e2562 '17.1' if this is a tag.
 uver=$(git describe --long --abbrev=8 "--match=[0-9][0-9]*" "$ref")
-clogver_debian=${clogver_o##*-}
-clogver_new="${uver}-${clogver_debian}"
+clogver_new="${uver}-0ubuntu1"
 
 # uver_base_rel rel gets '17.1'
 uver_base_rel=${uver%%-*}
@@ -60,7 +54,7 @@ TEMP_D=$(mktemp -d "${TMPDIR:-/tmp}/${bname}.XXXXXX")
 
 trap cleanup EXIT
 
-echo "building version ${uver}, debian_ver=${clogver_debian}"
+echo "building version ${uver}"
 
 dir="${sourcename}-$uver"
 tarball="${sourcename}_$uver.orig.tar.gz"
@@ -93,18 +87,8 @@ if [ ! -d "$dir" ]; then
 fi
 cd "$dir" || fail "failed cd $dir"
 
-# move files ending in .trunk to name without .trunk
-# ie, this copies debian/changelog.trunk to debian/changelog
-for f in debian/*.trunk; do
-   mv "$f" "${f%.trunk}"
-done
-
-# first line of debian/changelog looks like
-#   curtin (<version>) UNRELEASED; urgency=low
-# fix the version and UNRELEASED
-sed -i -e "1s,([^)]*),(${clogver_new})," \
-       -e "1s,UNRELEASED,${RELEASE}," debian/changelog ||
-   fail "failed to write debian/changelog"
+dch --create --package curtin --newversion $clogver_new \
+    --distribution $RELEASE "Development release"
 debuild "$@" || fail "debuild failed"
 
 cd "$TEMP_D"

Follow ups