diff mbox

[Branch,~linaro-maintainers/linaro-image-tools/trunk] Rev 268: Merge lp:~lool/linaro-image-tools/setup-py-rework; rework setup.py and use

Message ID 20110128163334.1338.9756.launchpad@loganberry.canonical.com
State Accepted
Headers show

Commit Message

Loïc Minier Jan. 28, 2011, 4:33 p.m. UTC
Merge authors:
  Loïc Minier (lool)
Related merge proposals:
  https://code.launchpad.net/~lool/linaro-image-tools/setup-py-rework/+merge/47817
  proposed by: Loïc Minier (lool)
  review: Approve - Guilherme Salgado (salgado)
------------------------------------------------------------
revno: 268 [merge]
fixes bug(s): https://launchpad.net/bugs/683746
committer: Loïc Minier <lool@dooz.org>
branch nick: linaro-image-tools
timestamp: Fri 2011-01-28 17:31:19 +0100
message:
  Merge lp:~lool/linaro-image-tools/setup-py-rework; rework setup.py and use
  DistutilsExtra and add a do-release script to roll releases; LP: #683746.
removed:
  .bzr-builddeb/
  .bzr-builddeb/default.conf
  debian/
  debian/changelog
  debian/compat
  debian/control
  debian/copyright
  debian/linaro-image-tools.install
  debian/python-hwpack.install
  debian/python-linaro-media-create.install
  debian/rules
added:
  do-release
modified:
  setup.py*


--
lp:linaro-image-tools
https://code.launchpad.net/~linaro-maintainers/linaro-image-tools/trunk

You are subscribed to branch lp:linaro-image-tools.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-maintainers/linaro-image-tools/trunk/+edit-subscription
diff mbox

Patch

=== removed directory '.bzr-builddeb'
=== removed file '.bzr-builddeb/default.conf'
--- .bzr-builddeb/default.conf	2010-09-24 20:37:48 +0000
+++ .bzr-builddeb/default.conf	1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@ 
-[BUILDDEB]
-native=True

=== removed directory 'debian'
=== removed file 'debian/changelog'
--- debian/changelog	2011-01-19 19:00:48 +0000
+++ debian/changelog	1970-01-01 00:00:00 +0000
@@ -1,111 +0,0 @@ 
-linaro-image-tools (0.4.1) natty; urgency=low
-
-  * Brown paperbag release.
-  * Sort files in commands ran by linaro_media_create.rootfs.move_contents()
-    as this breaks the testsuite on some filesystems.
-  * Disable pkgbinarymangler when running the testsuite as it might cause some
-    stderr output which confuses it.
-  * Uppercase Python in python-linaro-media-create long description.
-  * Drop util-linux from Depends as it's Essential.
-  * Update Build-Deps for testsuite requirements (qemu-kvm for qemu-img,
-    u-boot | uboot-mkimage for mkimage and command-not-found for
-    CommandNotFound) and recommend command-not-found to locate the package of
-    missing commands.
-
- -- Loïc Minier <loic.minier@linaro.org>  Wed, 19 Jan 2011 19:32:38 +0100
-
-linaro-image-tools (0.4) natty; urgency=low
-
-  IMPORTANT: this version of linaro-image-tools breaks support for 10.05
-  images; we hope to restore this support really soon but it was more
-  important to release this update and have support for linaro-n images.
- 
-  * New major release
-    - Large parts rewritten in Python (Michael Hudson, Guilherme Salgado,
-      James Westby, Martin Ohlsson).
-    - Various bug fixes.
-    - Notify users that apt-get will be run in target rootfs (Martin Ohlsson);
-      LP: #651906
-    - Use fdisk -l for output rather than sfdisk -l (Martin Ohlsson);
-      LP: #673410.
-    - Allow passing multiple --hwpack when creating an image (Michael Hudson).
-    - Add --hwpack-force-yes to linaro-media-create to forcibly install
-      unauthenticated packages (Michael Hudson).
-    - hwpack-create now has a --debug option (James Westby).
-    - hwpack creation now outputs a manifest external to the hwpack as well
-      (Michael Hudson).
-    - Add ability to add local .debs to the hwpack with --local-deb
-      (Michael Hudson).
-    - Update dependencies; new deps on python-testtools, python-parted,
-      python-dbus and more, drop obsolete deps.
-  * Fix support of space in pathnames (Paul Larson).
-  * Update Depends to cope with mkimage moving from uboot-mkimage to
-    u-boot-tools.
-  * Fix empty Vcs-Bzr.
-  * Strict >= ${source:Version} dependency on python-hwpack.
-  * Use python2 dh sequence instead of python-support; add a python >=
-    2.6.5-1~ build-dep.
-  * Uppercase Python in description (lintian).
-  * Various cleanups.
-  * Drop omapfb.debug=y from kernel cmdlines as DSS2 is stable nowadays.
-
- -- Loïc Minier <loic.minier@linaro.org>  Thu, 23 Dec 2010 14:41:29 +0100
-
-linaro-image-tools (0.3) maverick-proposed; urgency=low
-
-  [ Steve Langasek ]
-  * no longer using the 'omap' uboot flavor support in live-helper; instead,
-    run the mkimage commands directly for omap.
-  * fix the paths used for looking up x-loader and u-boot binaries in the
-    tarball; these don't belong in /boot at all, pull them from /usr/lib.
-  * only enforce the presence of commands we're actually using; this lets
-    us automatically pull in btrfs-tools when btrfs is specified.
-  * add sudo to a couple more commands in linaro-media-create, so the script
-    itself can run as non-root as intended.
-
-  [ James Westby ]
-  * Add a linaro-hwpack-create script for the creation of hardware packs.
-
-  [ Steve Langasek ]
-  * Fix lookup of linaro-hwpack-install to work correctly when l-m-c is on
-    the path.  Closes: #652669.
-
-  [ Loïc Minier ]
-  * Drop spurious single quote character in boot_args_options for beagle|igep;
-    thanks Peter Maydell; LP: #667400.
-  * Set LC_ALL=C when entering the chroot as it has no locales.  LP: #651905.
-
-  [ Tom Gall ]
-  * Use --numeric-owner argument to tar when unpacking, so that files get
-    the right owner on boot of the image.  LP: #652121.
-
-  [ Dave Martin ]
-  * Implement proper cleanup handling on signal / exit, so that we don't
-    leave clutter behind on error.  This also fixes the message at the end of
-    a successful install about being unable to unmount proc.  LP: #616385,
-    #660196, #667394, #643601, #627383.
-
- -- Steve Langasek <steve.langasek@ubuntu.com>  Tue, 09 Nov 2010 12:50:26 -0800
-
-linaro-image-tools (0.2) maverick; urgency=low
-
-  [ James Westby ]
-  * Add a module that provides some improvements to tarfile.
-  * Add some matchers for testing the content of tarfiles.
-  * Add the skeleton code to create empty hardware packs.
-
-  [ Torez Smith ]
-  * Add IGEP support; LP: #627611.
-
-  [ Loïc Minier ]
-  * Fix deps in control as well: depend on uuid-runtime rather than
-    uuidgen-runtime and do not depend on util-linux, e2fsprogs and coreutils
-    as these are Essential: yes; thanks Colin Watson.
-
- -- Loïc Minier <loic.minier@linaro.org>  Sun, 05 Sep 2010 10:26:20 +0200
-
-linaro-image-tools (0.1) maverick; urgency=low
-
-  * Initial packaging
-
- -- Loïc Minier <loic.minier@linaro.org>  Tue, 31 Aug 2010 22:32:49 +0200

=== removed file 'debian/compat'
--- debian/compat	2010-08-31 20:50:14 +0000
+++ debian/compat	1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@ 
-7

=== removed file 'debian/control'
--- debian/control	2011-01-26 00:39:33 +0000
+++ debian/control	1970-01-01 00:00:00 +0000
@@ -1,67 +0,0 @@ 
-Source: linaro-image-tools
-Section: devel
-Priority: optional
-Build-Depends: debhelper (>= 7.0.50~),
-               python (>= 2.6.5-1~),
-               python-all,
-               python-debian (>= 0.1.16ubuntu1),
-               python-dbus,
-               python-apt,
-               python-parted,
-               python-testtools (>> 0.9.5),
-               python-argparse,
-               qemu-kvm,
-               command-not-found,
-               u-boot-tools | uboot-mkimage
-Standards-Version: 3.9.1
-Maintainer: Linaro Developers <linaro-dev@lists.linaro.org>
-Vcs-Bzr: http://bazaar.launchpad.net/~linaro-maintainers/linaro-image-tools/linaro-image-tools
-XS-Python-Version: >= 2.5
-
-Package: linaro-image-tools
-Architecture: all
-Depends: ${misc:Depends},
-         parted,
-         dosfstools,
-         u-boot-tools | uboot-mkimage,
-         python,
-         python-hwpack (>= ${source:Version}),
-         python-argparse,
-         python-dbus,
-         python-debian (>= 0.1.16ubuntu1),
-         python-linaro-media-create (>= ${source:Version}),
-         python-parted
-Recommends: qemu-kvm-extras-static,
-            qemu-kvm,
-            btrfs-tools,
-            command-not-found
-Description: collection of tools to work with Linaro images
- This package offers a set of tools for use with Linaro images.
- .
- The provided linaro-media-create command allows writing Linaro images
- to a SD card, or generating an image file which you can boot in QEMU.
-
-Package: python-hwpack
-Architecture: all
-Section: python
-Depends: ${python:Depends},
-         ${misc:Depends},
-         python-apt
-Description: Python library for the creation of hardware packs
- Hardware packs allow for the distribution of packages to be combined with
- an image to create a root filesystem at a later date.
- .
- This package provides a Python library to aid with the creation of hardware
- packs.
-
-Package: python-linaro-media-create
-Architecture: all
-Section: python
-Depends: ${python:Depends},
-         ${misc:Depends}
-Description: Python library for the creation of Linaro bootable media
- Linaro images are generated by combining generic tarballs with
- hardware-specific packs (hwpacks).
- .
- This package provides a Python library to generate Linaro images and write
- them to SD cards or image files that you can be boot in QEMU.

=== removed file 'debian/copyright'
--- debian/copyright	2010-09-01 12:34:06 +0000
+++ debian/copyright	1970-01-01 00:00:00 +0000
@@ -1,26 +0,0 @@ 
-Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135
-Name: Linaro Image Tools
-Source: https://code.launchpad.net/linaro-image-tools
-
-Copyright: 2010, Robert Nelson <robertcnelson@gmail.com>
-           2010, Linaro
-License: GPL-3+
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- version 3 as published by the Free Software Foundation.
- .
- This program is distributed in the hope that it will be
- useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE.  See the GNU General Public License for more
- details.
- .
- You should have received a copy of the GNU General Public
- License along with this package; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor,
- Boston, MA  02110-1301 USA
- .
- On Debian and Ubuntu systems, the full text of the GNU General
- Public License version 3 can be found in the file
- `/usr/share/common-licenses/GPL-3'.
-

=== removed file 'debian/linaro-image-tools.install'
--- debian/linaro-image-tools.install	2010-09-24 20:37:48 +0000
+++ debian/linaro-image-tools.install	1970-01-01 00:00:00 +0000
@@ -1,3 +0,0 @@ 
-linaro-media-create usr/bin
-linaro-hwpack-install usr/bin
-linaro-hwpack-create usr/bin

=== removed file 'debian/python-hwpack.install'
--- debian/python-hwpack.install	2010-09-24 20:37:48 +0000
+++ debian/python-hwpack.install	1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@ 
-usr/lib/python*/dist-packages/hwpack

=== removed file 'debian/python-linaro-media-create.install'
--- debian/python-linaro-media-create.install	2011-01-11 21:26:54 +0000
+++ debian/python-linaro-media-create.install	1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@ 
-usr/lib/python*/dist-packages/linaro_media_create

=== removed file 'debian/rules'
--- debian/rules	2011-01-22 00:20:14 +0000
+++ debian/rules	1970-01-01 00:00:00 +0000
@@ -1,9 +0,0 @@ 
-#!/usr/bin/make -f
-
-%:
-	dh --buildsystem=python_distutils --with-addon=python2 $*
-
-override_dh_auto_test:
-	# XXX: The test-suite currently fails on Lucid. What can we do about
-	# it?
-	python -m testtools.run tests.test_suite

=== added file 'do-release'
--- do-release	1970-01-01 00:00:00 +0000
+++ do-release	2011-01-28 15:48:25 +0000
@@ -0,0 +1,67 @@ 
+#!/bin/sh
+# tag tree, generate ChangeLog and roll a release tarball
+
+set -e
+
+self="$(basename "$0")"
+
+usage() {
+    echo "Usage: $self <version>"
+}
+
+log() {
+    echo "$*" >&2
+}
+
+log_i() {
+    log "I:" "$@"
+}
+
+die() {
+    log "E:" "$@"
+    exit 1
+}
+
+version="$1"
+
+if [ -z "$version" ]; then
+    usage >&2
+    exit 1
+fi
+
+log_i "Checking tree status"
+status=`bzr status`
+if [ -n "$status" ]; then
+    die "Tree is dirty according to bzr status"
+fi
+
+log_i "Running tests"
+if ! python -m testtools.run tests.test_suite; then
+    die "Testsuite doesn't pass"
+fi
+
+if bzr tags | awk '{print $1}' | grep -qFx "$version"; then
+    die "Tag $version already exists"
+fi
+
+log_i "Setting version to $version in setup.py"
+sed -i "s/^\\([[:space:]]*version=\"\\)[^\"]*\",\$/\1$version\",/" setup.py
+
+log_i "Committing $version"
+bzr commit -m "Release $version"
+
+log_i "Creating tag $version"
+bzr tag "$version"
+
+log_i "Generating ChangeLog"
+bzr log -v --gnu-changelog >ChangeLog
+
+log_i "Creating release tarball in parent directory"
+./setup.py sdist -d ..
+
+log_i "Cleaning up"
+rm -f ChangeLog MANIFEST
+
+log_i "Signing tarball"
+gpg --armor --sign --detach-sig "../linaro-image-tools-$version.tar.gz"
+

=== modified file 'setup.py' (properties changed: -x to +x)
--- setup.py	2011-01-11 21:26:54 +0000
+++ setup.py	2011-01-28 16:23:53 +0000
@@ -1,24 +1,19 @@ 
+#!/usr/bin/env python
+
 from distutils.core import setup
-import os
-import subprocess
-
-
-def get_version():
-    proc = subprocess.Popen(
-        ["dpkg-parsechangelog"],
-        cwd=os.path.abspath(os.path.dirname(__file__)),
-        stdout=subprocess.PIPE)
-    output, _ = proc.communicate()
-    version = None
-    for line in output.split("\n"):
-        if line.startswith("Version: "):
-            version = line.split(" ", 1)[1].strip()
-    assert version is not None, (
-        "Couldn't determine version number from debian changelog")
-
-
-setup(
-        name="hwpack",
-        version=get_version(),
-        packages=["hwpack", "linaro_media_create"],
+# https://launchpad.net/python-distutils-extra
+import DistUtilsExtra.auto
+
+DistUtilsExtra.auto.setup(
+        name="linaro-image-tools",
+        version="0.4.1.1",
+        description="Tools to create and write Linaro images",
+        url="https://launchpad.net/linaro-image-tools",
+        license="GPL v3 or later",
+        author='Linaro Infrastructure team',
+        author_email="linaro-dev@lists.linaro.org",
+
+        scripts=[
+            "linaro-hwpack-create", "linaro-hwpack-install",
+            "linaro-media-create"],
      )