Merge lp:~gingerchris/endroid/package-version into lp:endroid

Proposed by ChrisD
Status: Merged
Approved by: ChrisD
Approved revision: 119
Merged at revision: 104
Proposed branch: lp:~gingerchris/endroid/package-version
Merge into: lp:endroid
Diff against target: 297 lines (+130/-47)
13 files modified
README (+1/-1)
debian/changelog (+12/-0)
debian/conffiles (+0/-1)
debian/control (+1/-1)
debian/endroid.install (+0/-1)
debian/postinst (+11/-0)
etc/init/endroid.conf (+5/-0)
gen_version.sh (+10/-0)
makedeb (+52/-0)
setup.py (+29/-29)
src/endroid.sh (+2/-6)
src/endroid/__init__.py (+1/-1)
src/endroid/plugins/version.py (+6/-7)
To merge this branch: bzr merge lp:~gingerchris/endroid/package-version
Reviewer Review Type Date Requested Status
Matthew Hall Approve
Review via email: mp+282621@code.launchpad.net

Commit message

1.4.8 release: Improvements to installation/release process and various bug fixes
  * Fix bug in DB update function
  * Improve exception logging
  * Add makedeb script to make it easier to build and install debs
  * Remove need for manual service restart when upgrading
  * Only list rooms that a user is allowed in
  * Fix various bugs in plugins
  * Fix up lintian errors/warnings

Description of the change

Collection of changes:

Make it easier to build a deb from the package:
 - Added a makedeb script - which optionally installs the package if 'install' specified
 - Added a gen_version.sh script that generates detailed version information (moved from src/endroid.sh)
   - remove generation of version code from setup.py (it wasn't effective and is superseded by makedeb)

Make updating the version number easier:
 - Make setup.py get its version from endroid.__version__ (so 1 fewer place to update)

Remove need to restart endroid when installed
 - Add a postinst script that restarts the service

Fix up deb lintian warnings/errors:
 - Increase debian/control Standards-Version
 - Remove the empty endroid.db file (and references to it) that was being installed to /var/lib/endroid/db/ - which is not the default location for the file (default is ~/.endroid/endroid.db)

Other changes
 - Improved information returned by the version plugin to capitalise on version number changes
 - Added respawn to the default init config
 - Typo

And finally; bump the version to 1.4.8.

To post a comment you must log in.
119. By Chris Davidson <email address hidden>

minor changes to makedeb

Revision history for this message
Matthew Hall (matt.hall) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'README'
--- README 2013-09-10 15:38:23 +0000
+++ README 2016-01-14 16:24:13 +0000
@@ -11,7 +11,7 @@
11** Endroid is an extensible XMPP bot, built with a plugin architecture11** Endroid is an extensible XMPP bot, built with a plugin architecture
12** The endroid.sh script in the src directory may be used to start EnDroid easily, e.g. for testing12** The endroid.sh script in the src directory may be used to start EnDroid easily, e.g. for testing
1313
14* Example confiuration14* Example configuration
15** You should register a Jabber ID for your EnDroid, e.g. at https://register.jabber.org/15** You should register a Jabber ID for your EnDroid, e.g. at https://register.jabber.org/
16** Put config in ~/.endroid/endroid.conf see etc/endroid.conf for an example config file.16** Put config in ~/.endroid/endroid.conf see etc/endroid.conf for an example config file.
1717
1818
=== modified file 'debian/changelog'
--- debian/changelog 2016-01-04 14:09:46 +0000
+++ debian/changelog 2016-01-14 16:24:13 +0000
@@ -1,3 +1,15 @@
1endroid (1.4.8) trusty; urgency=medium
2
3 * Fix bug in DB update function
4 * Improve exception logging
5 * Add makedeb script to make it easier to build and install debs
6 * Remove need for manual service restart when upgrading
7 * Only list rooms that a user is allowed in
8 * Fix various bugs in plugins
9 * Fix up lintian errors/warnings
10
11 -- Chris Davidson <chdavids@ensoft-sandbox.cisco.com> Thu, 14 Jan 2016 16:16:42 +0000
12
1endroid (1.4.7) trusty; urgency=low13endroid (1.4.7) trusty; urgency=low
214
3 * Enhance the ldapauth plugin to support LDAP directories that do not15 * Enhance the ldapauth plugin to support LDAP directories that do not
416
=== removed file 'debian/conffiles'
--- debian/conffiles 2014-04-05 19:53:27 +0000
+++ debian/conffiles 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
1/var/lib/endroid/db/endroid.db
20
=== modified file 'debian/control'
--- debian/control 2014-08-11 09:02:24 +0000
+++ debian/control 2016-01-14 16:24:13 +0000
@@ -3,7 +3,7 @@
3Section: misc3Section: misc
4Priority: optional4Priority: optional
5Build-Depends: debhelper (>= 9),python,python-setuptools5Build-Depends: debhelper (>= 9),python,python-setuptools
6Standards-Version: 3.9.36Standards-Version: 3.9.5
77
8Package: endroid8Package: endroid
9Architecture: all9Architecture: all
1010
=== modified file 'debian/endroid.install'
--- debian/endroid.install 2014-04-05 19:53:27 +0000
+++ debian/endroid.install 2016-01-14 16:24:13 +0000
@@ -5,7 +5,6 @@
5bin/endroid_remote usr/bin/5bin/endroid_remote usr/bin/
6bin/spelunk_hi5s usr/sbin/6bin/spelunk_hi5s usr/sbin/
7lib/wokkel-0.7.1-py2.7.egg usr/lib/endroid/dependencies7lib/wokkel-0.7.1-py2.7.egg usr/lib/endroid/dependencies
8var/endroid.db var/lib/endroid/db
9doc/EnDroid.png usr/share/endroid/media/8doc/EnDroid.png usr/share/endroid/media/
10resources/httpinterface/index.html usr/share/endroid/templates/httpinterface/9resources/httpinterface/index.html usr/share/endroid/templates/httpinterface/
11resources/httpinterface/notfound.html usr/share/endroid/templates/httpinterface/10resources/httpinterface/notfound.html usr/share/endroid/templates/httpinterface/
1211
=== added file 'debian/postinst'
--- debian/postinst 1970-01-01 00:00:00 +0000
+++ debian/postinst 2016-01-14 16:24:13 +0000
@@ -0,0 +1,11 @@
1#! /bin/sh -e
2
3if which service >/dev/null 2>&1; then
4 service endroid restart
5elif which invoke-rc.d >/dev/null 2>&1; then
6 invoke-rc.d endroid restart
7else
8 /etc/init.d/endroid restart
9fi
10
11#DEBHELPER#
012
=== modified file 'etc/init/endroid.conf'
--- etc/init/endroid.conf 2014-10-14 10:17:13 +0000
+++ etc/init/endroid.conf 2016-01-14 16:24:13 +0000
@@ -5,3 +5,8 @@
5start on net-device-up5start on net-device-up
6stop on stopping network6stop on stopping network
7stop on starting shutdown7stop on starting shutdown
8
9# Respawn if endroid exits
10respawn
11# Only respawn max 10 times in 5s period, otherwise fail
12respawn limit 10 5
813
=== added file 'gen_version.sh'
--- gen_version.sh 1970-01-01 00:00:00 +0000
+++ gen_version.sh 2016-01-14 16:24:13 +0000
@@ -0,0 +1,10 @@
1#!/bin/bash
2
3#
4# This script generates version information for Endroid
5#
6
7ENDROID_VERSION_INFO="src/endroid/version_info.py"
8CURRENT_LOCATION="$( cd $( dirname "$0" ) && pwd )"
9echo "Generating version info from ${CURRENT_LOCATION} at ${CURRENT_LOCATION}/${ENDROID_VERSION_INFO}"
10cd ${CURRENT_LOCATION} && bzr version-info --python > ${ENDROID_VERSION_INFO} && cd -
011
=== added file 'makedeb'
--- makedeb 1970-01-01 00:00:00 +0000
+++ makedeb 2016-01-14 16:24:13 +0000
@@ -0,0 +1,52 @@
1#!/bin/bash -e
2
3#
4# This script uses Debhelper to build the endroid Debian package and
5# optionally install it
6#
7
8# Find the location of this script
9CURRENT_LOCATION="$( cd $( dirname "$0" ) && pwd )"
10
11#
12# Generate the version info
13#
14${CURRENT_LOCATION}/gen_version.sh
15
16#
17# Work out what the resulting deb file will be called
18# Why doesn't debuild just have an output argument!!!
19#
20ENDROID_VERSION=`dpkg-parsechangelog --show-field Version`
21ENDROID_DEB_FILE="endroid_${ENDROID_VERSION}_all.deb"
22ENDROID_DEB="../${ENDROID_DEB_FILE}"
23
24# Delete the file if it exists
25stat ${ENDROID_DEB} || true
26rm ${ENDROID_DEB} || true
27
28# Call debuild with the following options:
29# -uc -us : Don't attempt to sign anything
30# -tc : Clean the source tree after building
31# -I : Exclude undesired files/dirs from the package (e.g. CVS control
32# files, backup files)
33#
34# During development it can be useful to run this command without the -tc
35# option, allowing inspection of the build directory contents.
36debuild -uc -us -tc -I
37
38#
39# Now install the deb if that has been requested
40#
41if [[ $# -ge 1 && "$1" == "install" ]] ; then
42 if [[ -e ${ENDROID_DEB} ]] ; then
43 # Go ahead and install it
44 echo "Installing ${ENDROID_DEB}"
45 stat ${ENDROID_DEB}
46 dpkg -i ${ENDROID_DEB}
47 else
48 echo "${ENDROID_DEB} doesn't appear to exist - aborting install"
49 exit 2
50 fi
51fi
52
053
=== modified file 'setup.py'
--- setup.py 2016-01-04 14:09:46 +0000
+++ setup.py 2016-01-14 16:24:13 +0000
@@ -3,36 +3,36 @@
3# EnDroid setup file3# EnDroid setup file
4#4#
55
6import re
67
7from distutils.core import setup8from distutils.core import setup
89
910
10try:11# Get the version from the endroid package
11 # Generate the version_info module, used so that endroid12ver_re = re.compile(r"\s*__version__\s*=\s*[\"'](?P<version>[^\"']+)")
12 # knows what version it is at13version_file = 'src/endroid/__init__.py'
13 import os14
14 import bzrlib.branch15version = None
15 import bzrlib.version_info_formats.format_python16with open(version_file, 'r') as f:
16 this_dir = os.path.dirname(os.path.realpath(__file__))17 for line in f.readlines():
17 the_branch = bzrlib.branch.Branch.open(this_dir)18 m = ver_re.match(line)
18 version_info = bzrlib.version_info_formats.format_python.PythonVersionInfoBuilder(the_branch)19 if m:
19 version_info_file = os.path.join(this_dir, 'src', 'endroid', 'version_info.py')20 version = m.group('version')
20 with open(version_info_file, 'w') as f:21 break
21 version_info.generate(f)22
22except (ImportError, OSError, Exception) as e:23if version is None:
23 print("Failed to get version info: {}".format(e))24 print("Failed to find version number from {}, aborting setup".format(version_file))
2425else:
2526 setup(name='endroid',
26setup(name='endroid',27 version=version,
27 version="1.4.7",28 description='EnDroid: a modular XMPP bot',
28 description='EnDroid: a modular XMPP bot',29 url='http://open.ensoft.co.uk/EnDroid',
29 url='http://open.ensoft.co.uk/EnDroid',30 packages=[
30 packages=[31 'endroid',
31 'endroid',32 'endroid.plugins',
32 'endroid.plugins',33 'endroid.plugins.compute',
33 'endroid.plugins.compute',34 'endroid.plugins.sms',
34 'endroid.plugins.sms',35 ],
35 ],36 package_dir={'endroid': 'src/endroid'},
36 package_dir={'endroid': 'src/endroid'},37 requires=['treq', 'wokkel', 'twisted']
37 requires=['treq', 'wokkel', 'twisted']38 )
38 )
3939
=== modified file 'src/endroid.sh'
--- src/endroid.sh 2014-09-17 00:07:09 +0000
+++ src/endroid.sh 2016-01-14 16:24:13 +0000
@@ -16,11 +16,7 @@
16export PYTHONPATH="${ENDROID}/lib/wokkel-0.7.1-py2.7.egg":"${ENDROID}/src/":"${ENDROID_PLUGINS}":"${PYTHONPATH}" 16export PYTHONPATH="${ENDROID}/lib/wokkel-0.7.1-py2.7.egg":"${ENDROID}/src/":"${ENDROID_PLUGINS}":"${PYTHONPATH}"
17echo "Setting PYTHONPATH=${PYTHONPATH}"17echo "Setting PYTHONPATH=${PYTHONPATH}"
18ENDROID_VERSION_INFO="${ENDROID}/src/endroid/version_info.py"18ENDROID_VERSION_INFO="${ENDROID}/src/endroid/version_info.py"
19echo "Generating version info from ${ENDROID} at ${ENDROID_VERSION_INFO}"19# Generate the version information for debugging purposes
20cd ${ENDROID} && bzr version-info --python > ${ENDROID_VERSION_INFO}20${ENDROID}/gen_version.sh
21echo "Running endroid at ${ENDROID} with plugins at ${ENDROID_PLUGINS}"21echo "Running endroid at ${ENDROID} with plugins at ${ENDROID_PLUGINS}"
22python -m endroid "$@"22python -m endroid "$@"
23# Now cleanup the version info
24echo "Cleaning up version info file (${ENDROID_VERSION_INFO})"
25rm ${ENDROID_VERSION_INFO}
26
2723
=== modified file 'src/endroid/__init__.py'
--- src/endroid/__init__.py 2014-09-18 16:36:42 +0000
+++ src/endroid/__init__.py 2016-01-14 16:24:13 +0000
@@ -31,7 +31,7 @@
31import endroid.manhole31import endroid.manhole
3232
3333
34__version__ = (1, 2)34__version__ = "1.4.8"
3535
36LOGGING_FORMAT = '%(asctime)-8s %(name)-20s %(levelname)-8s %(message)s'36LOGGING_FORMAT = '%(asctime)-8s %(name)-20s %(levelname)-8s %(message)s'
37LOGGING_DATE_FORMAT = '%Y-%m-%d %H:%M:%S'37LOGGING_DATE_FORMAT = '%Y-%m-%d %H:%M:%S'
3838
=== modified file 'src/endroid/plugins/version.py'
--- src/endroid/plugins/version.py 2014-09-17 21:50:37 +0000
+++ src/endroid/plugins/version.py 2016-01-14 16:24:13 +0000
@@ -4,6 +4,7 @@
4# Created by Chris Davidson4# Created by Chris Davidson
5# -----------------------------------------5# -----------------------------------------
66
7import endroid
78
8from endroid.plugins.command import CommandPlugin, command9from endroid.plugins.command import CommandPlugin, command
910
@@ -24,11 +25,9 @@
2425
25 @command()26 @command()
26 def version(self, msg, args):27 def version(self, msg, args):
27 if self.version_info is None:28 reply = "I'm running Endroid verson {}.".format(endroid.__version__)
28 reply = ("I'm sorry I don't appear to know what version I'm "29 if self.version_info is not None:
29 "running.")30 reply += (" More specifically revno {revno} commited on "
30 else:31 "{date} and built on {build_date} (rev "
31 reply = ("I'm currently running version {revno} commited on "32 "{revision_id})".format(**self.version_info))
32 "{date} and built on {build_date} (rev "
33 "{revision_id})".format(**self.version_info))
34 msg.reply(reply)33 msg.reply(reply)
3534
=== removed directory 'var'
=== removed file 'var/endroid.db'

Subscribers

People subscribed via source and target branches