diff options
-rwxr-xr-x | BuildTools/UpdateDebianChangelog.py | 31 | ||||
-rwxr-xr-x | BuildTools/package_debian.sh | 10 | ||||
-rwxr-xr-x | Swift/Packaging/Debian/package.sh | 1 |
3 files changed, 32 insertions, 10 deletions
diff --git a/BuildTools/UpdateDebianChangelog.py b/BuildTools/UpdateDebianChangelog.py new file mode 100755 index 0000000..6615ab1 --- /dev/null +++ b/BuildTools/UpdateDebianChangelog.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python + +import sys, re, email.utils + +assert(len(sys.argv) == 3) + +version = sys.argv[2] + +changelog = open(sys.argv[1]) +last_version_line = changelog.readline() +changelog.close() + +project = "" +last_version = "" +m = re.match("(\w+) \((.*)\)", last_version_line) +if m : + project = m.group(1) + last_version = m.group(2) + +if last_version != version : + changelog = open(sys.argv[1]) + changelog_data = changelog.read() + changelog.close() + changelog = open(sys.argv[1], "w") + changelog.write(project + " (" + version + ")" + " unstable; urgency=low\n\n") + changelog.write(" * Upstream development snapshot\n\n") + changelog.write(" -- Remko Tron\xc3\xa7on <dev@el-tramo.be> " + email.utils.formatdate() + "\n") + changelog.write("\n") + changelog.write(changelog_data) + changelog.close() + diff --git a/BuildTools/package_debian.sh b/BuildTools/package_debian.sh deleted file mode 100755 index 3d01243..0000000 --- a/BuildTools/package_debian.sh +++ /dev/null @@ -1,10 +0,0 @@ -VERSION=1.0 -PACKAGE=swift-$VERSION - -rm -rf $PACKAGE -git archive --format=tar --prefix=$PACKAGE/ HEAD | tar x -cp -r Swift/Packaging/Debian $PACKAGE/debian -pushd $PACKAGE -SWIFT_VERSION=$VERSION dpkg-buildpackage -rfakeroot -popd -rm -rf $PACKAGE diff --git a/Swift/Packaging/Debian/package.sh b/Swift/Packaging/Debian/package.sh index 5e93ee9..9c9dae1 100755 --- a/Swift/Packaging/Debian/package.sh +++ b/Swift/Packaging/Debian/package.sh @@ -16,6 +16,7 @@ echo "Checking out a fresh copy ..." rm -rf $DIRNAME git clone ../../../.git $DIRNAME ln -s Swift/Packaging/Debian/debian $DIRNAME/debian +../../../BuildTools/UpdateDebianChangelog.py $DIRNAME/debian/changelog $VERSION echo "Building ..." cd $DIRNAME |