=== modified file 'do-release'
@@ -22,6 +22,11 @@
exit 1
}
+set_version() {
+ log_i "Setting version to $1 in __version__.py"
+ sed -i "s/^__version__ =.*/__version__ = \"$1\"/" linaro_image_tools/__version__.py
+}
+
version="$1"
if [ -z "$version" ]; then
@@ -47,8 +52,7 @@
die "Tag $version already exists"
fi
-log_i "Setting version to $version in setup.py"
-sed -i "s/^\\([[:space:]]*version=\"\\)[^\"]*\",\$/\1$version\",/" setup.py
+set_version $version
log_i "Committing $version"
bzr commit -m "Release $version"
@@ -68,8 +72,7 @@
log_i "Signing tarball"
gpg --armor --sign --detach-sig "../linaro-image-tools-$version.tar.gz"
-log_i "Setting version to $version.1 in setup.py"
-sed -i "s/^\\([[:space:]]*version=\"\\)[^\"]*\",\$/\1$version.1\",/" setup.py
+set_version "$version.1"
-log_i "Committing $version"
+log_i "Committing $version.1"
bzr commit -m "Post-release version bump to $version.1"
=== modified file 'linaro-hwpack-create'
@@ -27,9 +27,10 @@
from linaro_image_tools.hwpack.builder import (
ConfigFileMissing, HardwarePackBuilder)
+from linaro_image_tools.__version__ import __version__
if __name__ == '__main__':
- parser = argparse.ArgumentParser()
+ parser = argparse.ArgumentParser(version='%(prog)s ' + __version__)
parser.add_argument(
"CONFIG_FILE",
help="The configuration file to take the hardware pack information "
=== added file 'linaro_image_tools/__version__.py'
@@ -0,0 +1,1 @@
+__version__ = "2011.09.1"
=== modified file 'linaro_image_tools/media_create/__init__.py'
@@ -21,6 +21,7 @@
from linaro_image_tools.media_create.boards import board_configs
from linaro_image_tools.media_create.android_boards import android_board_configs
+from linaro_image_tools.__version__ import __version__
KNOWN_BOARDS = board_configs.keys()
@@ -47,7 +48,7 @@
def get_args_parser():
"""Get the ArgumentParser for the arguments given on the command line."""
- parser = argparse.ArgumentParser()
+ parser = argparse.ArgumentParser(version='%(prog)s ' + __version__)
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument(
'--mmc', dest='device', help='The storage device to use.')
@@ -128,7 +129,7 @@
def get_android_args_parser():
"""Get the ArgumentParser for the arguments given on the command line."""
- parser = argparse.ArgumentParser()
+ parser = argparse.ArgumentParser(version='%(prog)s ' + __version__)
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument(
'--mmc', dest='device', help='The storage device to use.')
=== modified file 'setup.py'
@@ -2,10 +2,12 @@
# https://launchpad.net/python-distutils-extra
import DistUtilsExtra.auto
+from linaro_image_tools.__version__ import __version__
+
DistUtilsExtra.auto.setup(
name="linaro-image-tools",
- version="2011.09.1",
+ version=__version__,
description="Tools to create and write Linaro images",
url="https://launchpad.net/linaro-image-tools",
license="GPL v3 or later",