Merge lp:~rainct/apt-zeroconf/cheetah into lp:apt-zeroconf

Proposed by Siegfried Gevatter
Status: Needs review
Proposed branch: lp:~rainct/apt-zeroconf/cheetah
Merge into: lp:apt-zeroconf
Diff against target: 1002 lines (+313/-327)
19 files modified
HACKING (+2/-1)
MANIFEST (+1/-2)
apt-zeroconf (+9/-7)
aptzeroconf/exceptions.py (+32/-0)
aptzeroconf/http.py (+17/-7)
aptzeroconf/parse.py (+76/-120)
azc_daemon/__init__.py (+14/-1)
debian/apt-zeroconf.postinst (+7/-12)
debian/changelog (+21/-0)
debian/control (+28/-14)
debian/init (+23/-29)
debian/rules (+2/-6)
debian/templates (+4/-0)
setup.py (+10/-5)
support/apt-zeroconf.1 (+65/-0)
support/apt-zeroconf.xml (+0/-115)
support/azc_rule (+1/-1)
support/build.sh (+0/-5)
test/test_general.py (+1/-2)
To merge this branch: bzr merge lp:~rainct/apt-zeroconf/cheetah
Reviewer Review Type Date Requested Status
Apt Zeroconf Team Pending
Review via email: mp+18348@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Siegfried Gevatter (rainct) wrote :

 - Several fixes so that installing the package works correctly.
 - Fix http.py to look in the right path for the installed files.
 - Replace the manpage with a roff one, so that no conversion is needed.
 - Change hashbang to python2.6 so this works on Debian too (where 2.5 is default).
 - Merge in a couple other branches.
 - Other little changes to debian/.

lp:~rainct/apt-zeroconf/cheetah updated
142. By Siegfried Gevatter

Catch exception when socket is already in use and signalize this
condition with a special code.

143. By Siegfried Gevatter

apt-zeroconf.1: clarify the use of --daemon.

144. By Siegfried Gevatter

Fix debian/init.

The previous version was good enough for the package to work, but
"sudo service apt-zeroconf start/stop/restart" didn't work.

145. By Siegfried Gevatter

Some more changes here and there to make pep-8.py happy.
Change debian/init to always return 0 on stop, else dpkg-reconfigure gets mad.

146. By Siegfried Gevatter

azc_daemon/__init__.py: close all file descriptors after forking

Now that we don't use start-stop-daemon with the --background
workaround option anymore, dpkg-reconfigure was hanging again.
*Finally* I discovered the problem as being in _daemonize() :/.

147. By Siegfried Gevatter

Update debian/changelog.

Unmerged revisions

147. By Siegfried Gevatter

Update debian/changelog.

146. By Siegfried Gevatter

azc_daemon/__init__.py: close all file descriptors after forking

Now that we don't use start-stop-daemon with the --background
workaround option anymore, dpkg-reconfigure was hanging again.
*Finally* I discovered the problem as being in _daemonize() :/.

145. By Siegfried Gevatter

Some more changes here and there to make pep-8.py happy.
Change debian/init to always return 0 on stop, else dpkg-reconfigure gets mad.

144. By Siegfried Gevatter

Fix debian/init.

The previous version was good enough for the package to work, but
"sudo service apt-zeroconf start/stop/restart" didn't work.

143. By Siegfried Gevatter

apt-zeroconf.1: clarify the use of --daemon.

142. By Siegfried Gevatter

Catch exception when socket is already in use and signalize this
condition with a special code.

141. By Siegfried Gevatter

Fix postinst, init file, etc. Installing the package works now!

140. By Siegfried Gevatter

Fix wrong path for HTML files when installed.

139. By Siegfried Gevatter

Remove now superfluous manpage generation code from setup.py.

138. By Siegfried Gevatter

Change python-central dependency to python-support.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'HACKING'
--- HACKING 2009-08-09 01:45:52 +0000
+++ HACKING 2010-02-01 20:58:13 +0000
@@ -15,7 +15,8 @@
15-------15-------
1616
17We use py.test for testing at the moment.17We use py.test for testing at the moment.
18You can get it by running "[sudo] easy_install -U py"18You can get it by running "[sudo] easy_install -U py", or installing
19python-codespeak-lib on Debian systems.
19 20
20- For every change, try to create a new test.21- For every change, try to create a new test.
21- Run all tests: 'py.test' in main project dir.22- Run all tests: 'py.test' in main project dir.
2223
=== modified file 'MANIFEST'
--- MANIFEST 2009-07-14 19:40:59 +0000
+++ MANIFEST 2010-02-01 20:58:13 +0000
@@ -21,10 +21,9 @@
21pages/list.xsl21pages/list.xsl
22pages/logo.png22pages/logo.png
23pages/stats.html23pages/stats.html
24support/apt-zeroconf.1.gz24support/apt-zeroconf.1
25support/apt-zeroconf.apt.conf25support/apt-zeroconf.apt.conf
26support/apt-zeroconf.conf26support/apt-zeroconf.conf
27support/apt-zeroconf.xml
28support/azc_rule27support/azc_rule
29support/build.sh28support/build.sh
30support/make_docs.sh29support/make_docs.sh
3130
=== modified file 'apt-zeroconf'
--- apt-zeroconf 2009-07-25 21:59:12 +0000
+++ apt-zeroconf 2010-02-01 20:58:13 +0000
@@ -1,4 +1,4 @@
1#!/usr/bin/python1#!/usr/bin/python2.6
2# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: nil -*-2# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: nil -*-
33
4# This file is part of apt-zeroconf.4# This file is part of apt-zeroconf.
@@ -25,10 +25,10 @@
25import optparse25import optparse
26import sys26import sys
27import os27import os
28#from pwd import getpwnam28
29sys.path.append('/usr/share/pyshared/')
29from aptzeroconf import main30from aptzeroconf import main
3031from aptzeroconf.exceptions import AlreadyRunningError
31SCRIPTPATH = os.path.dirname(os.path.abspath(__file__))
3232
33if __name__ == "__main__":33if __name__ == "__main__":
34 parser = optparse.OptionParser()34 parser = optparse.OptionParser()
@@ -50,10 +50,8 @@
50 class azcDaemon(Daemon):50 class azcDaemon(Daemon):
5151
52 def run(self):52 def run(self):
53 os.chdir(SCRIPTPATH)
54 main(options)53 main(options)
5554
56
57 if os.getuid() != 0:55 if os.getuid() != 0:
58 print ("** Logging has been disabled. **"56 print ("** Logging has been disabled. **"
59 "You need root privileges to start apt-zeroconf as daemon."57 "You need root privileges to start apt-zeroconf as daemon."
@@ -97,4 +95,8 @@
97 print "--background has been deprecated, use --daemon."95 print "--background has been deprecated, use --daemon."
98 sys.exit(2)96 sys.exit(2)
9997
100main(options)98try:
99 main(options)
100except AlreadyRunningError:
101 print "Another instance of Apt-ZeroConf is already running."
102 sys.exit(42)
101103
=== added file 'aptzeroconf/exceptions.py'
--- aptzeroconf/exceptions.py 1970-01-01 00:00:00 +0000
+++ aptzeroconf/exceptions.py 2010-02-01 20:58:13 +0000
@@ -0,0 +1,32 @@
1# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: nil -*-
2#
3# Copyright (C) 2010 - Siegfried Gevatter <rainct@ubuntu.com>
4#
5# Apt-zeroconf is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# Apt-zeroconf is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with apt-zeroconf; if not, write to the Free Software
17# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
19
20class AptZeroConfException(Exception):
21 """
22 Base class for exceptions from AptZeroConf.
23 """
24 pass
25
26
27class AlreadyRunningError(AptZeroConfException):
28 """
29 Exception raised if another instance or a conflicting service is
30 already running.
31 """
32 pass
033
=== modified file 'aptzeroconf/http.py'
--- aptzeroconf/http.py 2009-09-12 02:04:35 +0000
+++ aptzeroconf/http.py 2010-02-01 20:58:13 +0000
@@ -25,9 +25,11 @@
25redirected, or page url.25redirected, or page url.
2626
27@requires: logging27@requires: logging
28@requires: socket
28@requires: SocketServer.[ThreadingTCPServer|BaseServer]29@requires: SocketServer.[ThreadingTCPServer|BaseServer]
29@requires: SimpleHTTPServer.SimpleHTTPRequestHandler30@requires: SimpleHTTPServer.SimpleHTTPRequestHandler
30@requires: aptzeroconf.config.[config|cache]31@requires: aptzeroconf.config.[config|cache]
32@requires: aptzeroconf.exceptions.AlreadyRunningError
31@requires: socket33@requires: socket
32@requires: urllib2.HTTPError34@requires: urllib2.HTTPError
33"""35"""
@@ -37,6 +39,7 @@
37from SocketServer import ThreadingTCPServer, BaseServer39from SocketServer import ThreadingTCPServer, BaseServer
38from SimpleHTTPServer import SimpleHTTPRequestHandler40from SimpleHTTPServer import SimpleHTTPRequestHandler
39from aptzeroconf.config import config, cache41from aptzeroconf.config import config, cache
42from aptzeroconf.exceptions import AlreadyRunningError
4043
4144
42class HttpServer(ThreadingTCPServer):45class HttpServer(ThreadingTCPServer):
@@ -45,11 +48,18 @@
45 """48 """
4649
47 def __init__(self):50 def __init__(self):
48 BaseServer.__init__(self, ('', config['http_port']), AZCHTTPHandler)51 try:
49 self.socket = socket.socket(socket.AF_INET6, self.socket_type)52 BaseServer.__init__(self, ('', config['http_port']),
50 self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)53 AZCHTTPHandler)
51 self.server_bind()54 self.socket = socket.socket(socket.AF_INET6, self.socket_type)
52 self.server_activate()55 self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
56 self.server_bind()
57 self.server_activate()
58 except socket.error as error:
59 if error.args and error.args[0] == 98:
60 # Address already in use
61 raise AlreadyRunningError
62 raise
5363
5464
55def trap_socketerror(method):65def trap_socketerror(method):
@@ -145,7 +155,7 @@
145 @trap_socketerror155 @trap_socketerror
146 def do_GET(self):156 def do_GET(self):
147 self._do_GET()157 self._do_GET()
148 158
149 def _do_GET(self):159 def _do_GET(self):
150 """160 """
151 Respond to a GET request by proxy the url to preferably local content,161 Respond to a GET request by proxy the url to preferably local content,
@@ -186,7 +196,7 @@
186 if os.path.isfile("pages/" + filename):196 if os.path.isfile("pages/" + filename):
187 page = "pages/" + filename197 page = "pages/" + filename
188 else:198 else:
189 page = "/usr/share/pages/" + filename199 page = "/usr/share/apt-zeroconf/pages/" + filename
190 return open(page, "r")200 return open(page, "r")
191201
192 httpCode = 200 #: Default HTTP Error code set202 httpCode = 200 #: Default HTTP Error code set
193203
=== modified file 'aptzeroconf/parse.py'
--- aptzeroconf/parse.py 2009-08-09 02:39:51 +0000
+++ aptzeroconf/parse.py 2010-02-01 20:58:13 +0000
@@ -21,116 +21,72 @@
21from xml.sax import parseString, ContentHandler21from xml.sax import parseString, ContentHandler
22#from xml.sax.handler import feature_namespaces22#from xml.sax.handler import feature_namespaces
23from xml.sax._exceptions import SAXParseException23from xml.sax._exceptions import SAXParseException
24from apt_pkg import VersionCompare
24import logging25import logging
25import re26import re
2627
27__version__ = float(0.3)28__version__ = float(0.3)
2829
29V2, V3 = 0.2, 0.330V2, V3 = 0.2, 0.3
30EPOCH_PATTERN = {31EPOCH_PATTERN = re.compile(r'\_\d+\%3a')
31 V2 : re.compile(r'\_\d+\%3a'),32
32 V3 : re.compile(r'\_\d+\:')
33}
3433
35def normalize_whitespace(text):34def normalize_whitespace(text):
36 """Remove excessive whitespace in spaces."""35 """Remove excessive whitespace in spaces."""
37 return ' '.join(text.split())36 return ' '.join(text.split())
3837
39def _is_equal(pkg, find, ver):38
39def _is_equal(pkg, find):
40 """Are the packages equal disregarding the epoch?"""40 """Are the packages equal disregarding the epoch?"""
41 return EPOCH_PATTERN[ver].sub('_', pkg) == find or pkg == find41 return EPOCH_PATTERN.sub('_', pkg) == find or pkg == find
4242
4343
44class _PackageList(list):44class Package(object):
45 """45 """Represents a single package."""
46 Found Package list container.46 def __init__(self, name=''):
47 """47 self.name = name
48
49 def found(self, item):
50 """
51 Callback to add a found package to contatiner
52
53 @param item: Package Name
54 @type item: basestring
55 """
56 self.append(item)
57
58 def __str__(self):
59 """
60 String representaion of found package container. Displays the best
61 package found in container if multiples were added.
62
63 @return: Best or only package
64 @rtype: basestring
65 """
66 from apt_pkg import VersionCompare
67 from urllib2 import quote
68 if len(self) > 1:
69 self.sort(cmp=VersionCompare)
70 return quote(self[-1])
71
72 elif len(self) == 1:
73 return quote(self[0])
74
75 else:
76 return ""
77
78 def __repr__(self):48 def __repr__(self):
79 return '<Package name="%s" count="%d">' % (str(self), len(self))49 return '<Package name=' + self.name + '>'
8050
8151
82class _PackageFinder(ContentHandler):52class _XMLDecoder(ContentHandler):
53 """Decodes an xml package list, calling a callback for each package."""
83 callback = None #: Callback function to be set when item found54 callback = None #: Callback function to be set when item found
84 inPkgElemCnt = {}
8555
86 def __init__(self, package):56 def __init__(self):
87 """57 """
88 Initialize sax content handler.58 Initialize sax content handler.
8959
90 @param search_name: Package to locate in search data.60 @param search_name: Package to locate in search data.
91 @type search_name: basestring61 @type search_name: basestring
92 """62 """
93 self.packageSearch = normalize_whitespace(package)63 self.text = ''
9464 self.package = None
95 self.inPkgName = False #: Initialize the content flag to False65 self.list_version = ''
96 self.inPkg = False #: Initialize the content flag to False
97 self.list_version = '' #: Initialize the version value to None
9866
99 def startElement(self, name, attrs):67 def startElement(self, name, attrs):
100 """68 """
101 Check start element tags for packagelist or name.69 Check start element tags for packagelist or name.
10270
103 @param name: element tag.71 @param name: element tag
104 @type name: basestring72 @type name: basestring
105 @param name: element tag attrs.73 @param name: element attributes
106 @type name: basestring74 @type name: dict
107 """75 """
108 if name == 'packagelist': #: handle element by getting ver. attribute76 if name == 'packagelist': #: handle element by getting ver. attribute
109 self.list_version = normalize_whitespace(attrs.get('version', ""))77 self.list_version = normalize_whitespace(attrs.get('version', ""))
11078 if name == 'package':
111 if float(self.list_version) == __version__:79 self.package = Package()
11280 self.text = ''
113 if name == 'package':
114 self.inPkg = True
115 self.inPkgElemCnt = {'name': 0}
116
117 elif name == 'name': #: handle element by set flag, reset value
118 if self.inPkgElemCnt[name] > 1:
119 raise SAXParseException
120
121 self.inPkgName = True
122 self.packageName = ""
123 self.inPkgElemCnt[name] += 1
12481
125 def characters(self, char):82 def characters(self, char):
126 """83 """
127 Check characters for name value.84 Add character input to text buffer.
12885
129 @param char: text chunk86 @param char: text chunk
130 @type name: basestring87 @type name: basestring
131 """88 """
132 if self.inPkgName:89 self.text += char
133 self.packageName = self.packageName + char
13490
135 def endElement(self, name):91 def endElement(self, name):
136 """92 """
@@ -140,70 +96,72 @@
140 @param name: element tag.96 @param name: element tag.
141 @type name: basestring97 @type name: basestring
142 """98 """
143 if float(self.list_version) == __version__:99 if name == 'package':
144 if name == 'package':100 self.callback(self.package)
145 self.inPkgName = False101 elif name == 'name':
146 elif name == 'name':102 self.package.name = self.text
147 self.inPkgName = False103
148 self.packageName = normalize_whitespace(self.packageName)104
149105def decode_list(data):
150 #{ Check search_name for match with packagename
151 if _is_equal(self.packageName, self.packageSearch, V3):
152 self.callback(self.packageName)
153
154
155def has_package(package, data):
156 """106 """
157 Locate package in data string.107 @param data: xml/raw package data
158
159 @param package: package name
160 @type package: basestring
161 @param data: xml package data
162 @type data: basestring108 @type data: basestring
163 @return: PkgList object109 @return: list of Packages
164 @rtype: object110 @rtype: list
165 """111 """
166 pkglist = _PackageList()
167 if not data.startswith('<?xml'):112 if not data.startswith('<?xml'):
168 for name in data.split():113 data = data.split()
169 if _is_equal(name, package, V2):114 if data[0] == str(V2):
170 pkglist.found(name)115 return [Package(name) for name in data[1:]]
171 return pkglist
172116
173 handler = _PackageFinder(package)117 pkglist = []
174 handler.callback = pkglist.found118 handler = _XMLDecoder()
119 handler.callback = pkglist.append
175120
176 try:121 try:
177 parseString(data, handler)122 parseString(data, handler)
178
179 except SAXParseException:123 except SAXParseException:
180 #{ Non-conforming list124 #{ Non-conforming list
181 logging.warning(125 logging.warning(
182 '[PARSER] Parse Error, Ignoring: malformed package list.')126 '[PARSER] Parse Error, Ignoring: malformed package list.')
183 return _PackageList()127 return []
184
185 return pkglist128 return pkglist
186129
187130
131def has_package(package, list):
132 """
133 Locate package (disregarding the epoch) in package list.
134
135 Returns the package name, including the epoch if there is one.
136
137 @param package: package name
138 @type package: basestring
139 @param data: list of Packages
140 @type data: list
141 @return: package name
142 @rtype: basestring
143 """
144 results = []
145 for pkg in list:
146 if _is_equal(pkg.name, package):
147 results.append(pkg.name)
148
149 results.sort(cmp=VersionCompare)
150 if results:
151 return results[-1]
152 else:
153 return ''
154
155
188def store_packages(url, port):156def store_packages(url, port):
189 """157 """
190 Fetch non-local AZC Cache service host cache listings.158 Fetch non-local AZC Cache service host cache listings.
191
192 @param url:
193 @type url:
194 """159 """
195 from urllib2 import Request, urlopen160 from urllib2 import Request, urlopen
196161
197 pkglist = urlopen(Request(url="http://%s:%d/list" % (url, port)))162 pkglist = urlopen("http://%s:%d/list" % (url, port))
198 pkgdata = pkglist.read(4)163 data = pkglist.read()
199164 return decode_list(data)
200 if pkgdata[:3] == V2:
201 return pkglist.read()
202
203 elif pkgdata == '<?xm':
204 return pkgdata + pkglist.read()
205
206 return ''
207165
208166
209def make_packagelist(packages):167def make_packagelist(packages):
@@ -215,12 +173,10 @@
215 @return: xml package data173 @return: xml package data
216 @rtype: basestring174 @rtype: basestring
217 """175 """
218 from urllib2 import unquote
219
220 form = ("<?xml version='1.0' ?>\n"176 form = ("<?xml version='1.0' ?>\n"
221 "<?xml-stylesheet href='list.xsl' type='text/xsl' ?>\n"177 "<?xml-stylesheet href='list.xsl' type='text/xsl' ?>\n"
222 "<packagelist version='%.1f'>\n" % __version__)178 "<packagelist version='%.1f'>\n" % __version__)
223 for pkg in packages:179 for pkg in packages:
224 form += " <package>\n <name>%s</name>\n </package>" % unquote(pkg)180 form += " <package>\n <name>%s</name>\n </package>" % pkg
225 form += "</packagelist>\n"181 form += "</packagelist>\n"
226 return form182 return form
227183
=== modified file 'azc_daemon/__init__.py'
--- azc_daemon/__init__.py 2009-07-11 22:12:07 +0000
+++ azc_daemon/__init__.py 2010-02-01 20:58:13 +0000
@@ -23,6 +23,7 @@
23import os23import os
24import time24import time
25import atexit25import atexit
26import resource
26from signal import SIGTERM27from signal import SIGTERM
2728
2829
@@ -85,9 +86,21 @@
85 error.errno, error.strerror))86 error.errno, error.strerror))
86 sys.exit(1)87 sys.exit(1)
8788
88 #{ redirect standard file descriptors
89 sys.stdout.flush()89 sys.stdout.flush()
90 sys.stderr.flush()90 sys.stderr.flush()
91
92 #{ close all file descriptors; without this dpkg-reconfigure gets mad
93 #{ code taken from http://code.activestate.com/recipes/278731/
94 maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1]
95 if maxfd == resource.RLIM_INFINITY:
96 maxfd = 1024
97 for fd in xrange(0, maxfd):
98 try:
99 os.close(fd)
100 except OSError:
101 pass # fd wasn't open, ignore it
102
103 #{ redirect standard file descriptors
91 si = file(self.stdin, 'r')104 si = file(self.stdin, 'r')
92 so = file(self.stdout, 'a+')105 so = file(self.stdout, 'a+')
93 se = file(self.stderr, 'a+', 0)106 se = file(self.stderr, 'a+', 0)
94107
=== renamed file 'debian/postinst' => 'debian/apt-zeroconf.postinst'
--- debian/postinst 2009-07-24 23:20:29 +0000
+++ debian/apt-zeroconf.postinst 2010-02-01 20:58:13 +0000
@@ -9,23 +9,18 @@
99
10case "$1" in10case "$1" in
11 configure)11 configure)
12 db_input medium apt-zeroconf/activate || true
13 db_go
12 db_get apt-zeroconf/activate14 db_get apt-zeroconf/activate
13 if [ "$RET" = true ]; then15 if [ "$RET" = "false" ]; then
16 echo "ENABLED=0" > /etc/default/apt-zeroconf
17 else
14 echo "ENABLED=1" > /etc/default/apt-zeroconf18 echo "ENABLED=1" > /etc/default/apt-zeroconf
15 ln -s /usr/share/apt-zeroconf/apt-zeroconf.apt.conf \19 [ -L /etc/apt/apt.conf.d/10apt-zeroconf ] || \
20 ln -s /usr/share/apt-zeroconf/apt-zeroconf.apt.conf \
16 /etc/apt/apt.conf.d/10apt-zeroconf || true21 /etc/apt/apt.conf.d/10apt-zeroconf || true
17 else
18 echo "ENABLED=0" > /etc/default/apt-zeroconf
19 fi22 fi
20 ;;23 ;;
21
22 abort-upgrade|abort-remove|abort-deconfigure)
23 ;;
24
25 *)
26 echo "postinst called with unknown argument \`$1'" >&2
27 exit 1
28 ;;
29esac24esac
3025
31update-rc.d -f apt-zeroconf remove >/dev/null26update-rc.d -f apt-zeroconf remove >/dev/null
3227
=== modified file 'debian/changelog'
--- debian/changelog 2009-07-01 00:04:09 +0000
+++ debian/changelog 2010-02-01 20:58:13 +0000
@@ -1,3 +1,24 @@
1apt-zeroconf (0.5.0+20100131-0ubuntu1~ppa1) unstable; urgency=low
2
3 [ Josh Holland ]
4 * Moved packaging to use debhelper 7.
5
6 [ Siegfried-Angel Gevatter Pujals ]
7 * debian/
8 - Fix Python dependencies so this works on Debian.
9 - Other little changes.
10 * debian/templates, debian/apt-zeroconf.postinst:
11 - Give the debconf question priority "medium" and define a template for it.
12 * apt-zeroconf:
13 - Add installation directory to the path.
14 * aptzeroconf/__init__.py:
15 - Close open file descriptors after forking, without this
16 dpkg-reconfigure would hang forever.
17 * Replace manpage with a troff version, which doesn't need to
18 be generated.
19
20 -- Siegfried-Angel Gevatter Pujals <rainct@ubuntu.com> Sun, 31 Jan 2010 21:55:46 +0100
21
1apt-zeroconf (0.5.0-0ubuntu1~karmic~ppa1) karmic; urgency=low22apt-zeroconf (0.5.0-0ubuntu1~karmic~ppa1) karmic; urgency=low
223
3 * Improve proxy server to include some test urls and improved pages.24 * Improve proxy server to include some test urls and improved pages.
425
=== modified file 'debian/control'
--- debian/control 2009-07-24 23:20:29 +0000
+++ debian/control 2010-02-01 20:58:13 +0000
@@ -1,30 +1,44 @@
1Source: apt-zeroconf1Source: apt-zeroconf
2Section: admin2Section: admin
3Priority: extra3Priority: optional
4Maintainer: Apt-ZeroConf Launchpad Team <apt-zeroconf@lists.launchpad.net>4Maintainer: Apt-ZeroConf Launchpad Team <apt-zeroconf@lists.launchpad.net>
5Uploaders: Jeremy Austin-Bardo <ausimage@ubuntu.com>, Martin-Éric Racine <q-funk@iki.fi>5Uploaders: Jeremy Austin-Bardo <ausimage@ubuntu.com>,
6 Martin-Éric Racine <q-funk@iki.fi>,
7 Siegfried-Angel Gevatter Pujals <rainct@ubuntu.com>
6Homepage: https://launchpad.net/apt-zeroconf8Homepage: https://launchpad.net/apt-zeroconf
7Build-Depends: cdbs (>= 0.4.49), debhelper (>= 5.0.37.2), python-central (>= 0.6), python-dev (>= 2.6)9Build-Depends: cdbs (>= 0.4.49),
8Build-Depends-Indep: dpkg (>= 1.14.6), po-debconf10 debhelper (>= 7),
9Standards-Version: 3.8.011 python-support (>= 0.6),
10Vcs-Bzr: https://code.launchpad.net/~apt-zeroconf/apt-zeroconf/r0.512 python2.6-dev,
11XS-Python-Version: >=2.613 dpkg (>= 1.14.6),
14 po-debconf
15Standards-Version: 3.8.3
16Vcs-Bzr: https://code.launchpad.net/~apt-zeroconf/apt-zeroconf/trunk
17Vcs-Browser: https://code.launchpad.net/~apt-zeroconf/apt-zeroconf/trunk
18XS-Python-Version: >= 2.6
1219
13Package: apt-zeroconf20Package: apt-zeroconf
14Architecture: all21Architecture: all
15Depends: python-apt, python-avahi, python-dbus, debconf, python-azc-daemon, 22Depends: ${python:Depends},
16 ${python:Depends}, ${misc:Depends}23 ${misc:Depends},
24 python-apt,
25 python-avahi,
26 python-dbus,
27 debconf,
28 python-azc-daemon,
29 lsb-base (>= 3.0-6)
17XB-Python-Version: ${python:Versions}30XB-Python-Version: ${python:Versions}
18Description: Caching peer-to-peer apt proxy for local networks31Description: Caching peer-to-peer apt proxy for local networks
19 Apt-zeroconf is an extension to apt which enables it to find other32 Apt-zeroconf is an extension to apt which enables it to find other
20 instances on the LAN in order to exchange debian package files and not to 33 instances on the LAN in order to exchange Debian package files and not to
21 fetch them from the internet.34 fetch them from the internet.
2235
23Package: python-azc-daemon36Package: python-azc-daemon
24Architecture: all37Architecture: all
25XB-Python-Version: ${python:Versions}38XB-Python-Version: ${python:Versions}
26Depends: ${python:Depends}, ${misc:Depends}39Depends: ${python:Depends},
27Description: AZC daemon library.40 ${misc:Depends}
28 Daemon library to allow python code to run in the background. Based on code 41Description: apt-zeroconf daemon library
29 found at 42 Daemon library to allow Python code to run in the background. Based upon code
43 found at:
30 http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/44 http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/
3145
=== modified file 'debian/init'
--- debian/init 2009-08-14 22:08:19 +0000
+++ debian/init 2010-02-01 20:58:13 +0000
@@ -4,20 +4,18 @@
4# Required-Start: $local_fs dbus avahi4# Required-Start: $local_fs dbus avahi
5# Required-Stop: $local_fs dbus avahi5# Required-Stop: $local_fs dbus avahi
6# Default-Start: 2 3 4 56# Default-Start: 2 3 4 5
7# Default-Stop: S 0 1 67# Default-Stop: 0 1 6
8# Short-Description: apt-zeroconf peer-to-peer apt proxy8# Short-Description: apt-zeroconf peer-to-peer apt proxy
9# Description: apt-zeroconf is a caching peer-to-peer proxy for9# Description: apt-zeroconf is a caching peer-to-peer proxy for
10# local networks10# local networks
11### END INIT INFO11### END INIT INFO
1212
13PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin13PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin
14#PYTHONPATH=/usr/share/pyshared #<== Not sure of this... anyone??? -- ausimage
15DAEMON=/usr/bin/apt-zeroconf
16#DAEMON_OPTS_START="-d start"
17#DAEMON_OPTS_STOP="-d stop"
18#DAEMON_OPTS_RESTART="-d restart"
19NAME=apt-zeroconf14NAME=apt-zeroconf
20DESC="apt-zeroconf APT proxy"15DESC="apt-zeroconf APT proxy"
16DAEMON=/usr/bin/apt-zeroconf
17PIDFILE=/var/run/$NAME.pid
18STATUSCODE=0
2119
22test -x $DAEMON || exit 020test -x $DAEMON || exit 0
2321
@@ -25,40 +23,36 @@
2523
26. /lib/lsb/init-functions24. /lib/lsb/init-functions
2725
28#start_azc() {
29# start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
30# --startas $DAEMON -- $DAEMON_OPTS
31#}
32
33#stop_azc() {
34# start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid
35# rm -f /var/run/$NAME.pid
36#}
37
38case "$1" in26case "$1" in
39 start)27 start)
40 if [ "$ENABLED" != 1 ]; then28 if [ "$ENABLED" != 1 ]; then
41 log_begin_msg "Starting $DESC (not enabled)"29 log_begin_msg "Starting $DESC (not enabled)"
42 else30 else
43 log_begin_msg "Starting $DESC"31 log_begin_msg "Starting $DESC"
44 #start_azc32 if [ -f "$PIDFILE" ]; then
45 $DAEMON -d start33 STATUSCODE=1 # already running
34 else
35 $DAEMON -d start
36 STATUSCODE=$?
37 if [ $STATUSCODE -eq 42 ]; then
38 STATUSCODE=1 # already running
39 elif [ $STATUSCODE -ne 0 ]; then
40 STATUSCODE=2 # error
41 fi
42 fi
46 fi43 fi
47 log_end_msg 044 log_end_msg $STATUSCODE
48 ;;45 ;;
49 stop)46 stop)
50 log_begin_msg "Stopping $DESC"47 log_begin_msg "Stopping $DESC"
51 #stop_azc48 $DAEMON -d stop >/dev/null 2>&1
52 $DAEMON -d stop49 log_end_msg 0 # else dpkg-reconfigure fails
53 log_end_msg 0
54 ;;50 ;;
55 restart|force-reload)51 restart|force-reload)
56 log_begin_msg "Restarting $DESC"52 log_begin_msg "Restarting $DESC"
57 #stop_azc53 $DAEMON -d restart >/dev/null 2>&1
58 #sleep 154 STATUSCODE=$?
59 #start_azc55 log_end_msg $STATUSCODE
60 $DAEMON -d restart
61 log_end_msg 0
62 ;;56 ;;
63 *)57 *)
64 echo "Usage: $0 {start|stop|restart|force-reload}" >&258 echo "Usage: $0 {start|stop|restart|force-reload}" >&2
@@ -66,4 +60,4 @@
66 ;;60 ;;
67esac61esac
6862
69exit 063exit $STATUSCODE
7064
=== modified file 'debian/rules'
--- debian/rules 2009-05-06 04:18:16 +0000
+++ debian/rules 2010-02-01 20:58:13 +0000
@@ -1,7 +1,3 @@
1#!/usr/bin/make -f1#!/usr/bin/make -f
22%:
3DEB_UPDATE_RCD_PARAMS=defaults 253 dh $@
4DEB_PYTHON_SYSTEM=pycentral
5
6include /usr/share/cdbs/1/rules/debhelper.mk
7include /usr/share/cdbs/1/class/python-distutils.mk
84
=== added file 'debian/templates'
--- debian/templates 1970-01-01 00:00:00 +0000
+++ debian/templates 2010-02-01 20:58:13 +0000
@@ -0,0 +1,4 @@
1Template: apt-zeroconf/activate
2Type: boolean
3Default: true
4Description: Do you want to apt-zeroconf to start automatically at boot?
05
=== modified file 'setup.py'
--- setup.py 2009-08-14 22:08:19 +0000
+++ setup.py 2010-02-01 20:58:13 +0000
@@ -1,7 +1,11 @@
1#!/usr/bin/env python1#!/usr/bin/env python
2import os
3
2from distutils.core import setup4from distutils.core import setup
5from distutils.command.build import build
36
4setup(name='apt-zeroconf',7setup(
8 name='apt-zeroconf',
5 version='0.6.x~bzr',9 version='0.6.x~bzr',
6 author='Apt-Zeroconf Launchpad Team',10 author='Apt-Zeroconf Launchpad Team',
7 author_email='apt-zeroconf@lists.launchpad.net',11 author_email='apt-zeroconf@lists.launchpad.net',
@@ -18,18 +22,19 @@
18 packages=['aptzeroconf', 'azc_daemon'],22 packages=['aptzeroconf', 'azc_daemon'],
19 scripts=['apt-zeroconf'],23 scripts=['apt-zeroconf'],
20 data_files=[24 data_files=[
21 ('/usr/share/apt-zeroconf', ['support/apt-zeroconf.apt.conf', ]),25 ('share/apt-zeroconf', ['support/apt-zeroconf.apt.conf', ]),
22 ('/usr/share/apt-zeroconf/pages', [26 ('share/apt-zeroconf/pages', [
23 'pages/aptzeroconf.css', 'pages/host.html', 'pages/index.html',27 'pages/aptzeroconf.css', 'pages/host.html', 'pages/index.html',
24 'pages/listupdate.html', 'pages/list.xsl', 'pages/aptzeroconf.png',28 'pages/listupdate.html', 'pages/list.xsl', 'pages/aptzeroconf.png',
25 'pages/stats.html', ]),29 'pages/stats.html', ]),
26 ('/usr/share/apt-zeroconf/tests', [30 ('share/apt-zeroconf/tests', [
27 'test/common.py', 'test/__init__.py', 'test/pep8.py',31 'test/common.py', 'test/__init__.py', 'test/pep8.py',
28 'test/test_auth.py', 'test/test_general.py',32 'test/test_auth.py', 'test/test_general.py',
29 'test/test_sourcecode.py', ]),33 'test/test_sourcecode.py', ]),
30 ('/etc/', ['support/apt-zeroconf.conf']),34 ('/etc/', ['support/apt-zeroconf.conf']),
31 ('/etc/ufw/applications.d/', ['support/azc_rule']),35 ('/etc/ufw/applications.d/', ['support/azc_rule']),
32 ('/usr/share/man/man1', ['support/apt-zeroconf.1.gz', ]), ],36 ('share/man/man1', ['support/apt-zeroconf.1', ]),
37 ],
33 keywords="zeroconf, apt, cache, pacakage, proxy, adhoc",38 keywords="zeroconf, apt, cache, pacakage, proxy, adhoc",
34 platforms="Ubuntu 9.04 and 9.10 (others may work as well)",39 platforms="Ubuntu 9.04 and 9.10 (others may work as well)",
35 classifiers=[40 classifiers=[
3641
=== added file 'support/apt-zeroconf.1'
--- support/apt-zeroconf.1 1970-01-01 00:00:00 +0000
+++ support/apt-zeroconf.1 2010-02-01 20:58:13 +0000
@@ -0,0 +1,65 @@
1.TH APT\-ZEROCONF 1 "January 31, 2010" "Apt-ZeroConf"
2
3.SH NAME
4apt\-zeroconf \- write summary here...
5
6.SH SYNOPSIS
7\fBapt\-zeroconf\fP \fI[OPTION]\fP
8
9.SH DESCRIPTION
10\fBapt\-zeroconf\fP creates an adhoc network on your local network to provide
11apt repository packages. Allowing you download once, then retrieve locally for
12all other computers on your network.
13
14.SH OPTIONS
15The program follows the usual GNU command line syntax, with
16options starting with two dashes (`--'). A summary of options is
17included below.
18.TP
19.B \-p, \-\-port
20Start \fBapt\-zeroconf\fP at the given port.
21.TP
22.B \-r, \-\-restrict
23Overrides the option in \fBapt\-zeroconf\fP's configuration file, on whether
24to restrict the proxy to only operate for the URLs specified under the
25[apt-cache] section.
26.TP
27.B \-d, \-\-daemon=start|stop|restart
28Start \fBapt\-zeroconf\fP as a background process, stop an already running
29instance or restart an already running instance.
30.TP
31.B -l, \-\-logger=debug|info|warning|error|critical
32Change the verbosity of the log output.
33
34.SH EXIT VALUES
35.TP
36.B 0
37Success.
38.TP
39.B 2
40Incorrect parameter or another user error.
41.TP
42.B 42
43Another instance of \fBapt\-zeroconf\fP is already running or there's
44another service using the same port.
45
46.SH BUGS
47Please report any bugs at https://bugs.launchpad.net/apt-zeroconf.
48
49.SH AUTHORS
50Please see the AUTHORS file bundled with this application for
51a complete list of contributors.
52
53.SH LICENSE
54This program is free software: you can redistribute it and/or modify
55it under the terms of the GNU Lesser General Public License as published by
56the Free Software Foundation, either version 3 of the License, or
57(at your option) any later version.
58.PP
59This program is distributed in the hope that it will be useful,
60but WITHOUT ANY WARRANTY; without even the implied warranty of
61MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
62GNU Lesser General Public License for more details.
63.PP
64You should have received a copy of the GNU Lesser General Public License
65along with this program. If not, see <http://www.gnu.org/licenses/>.
066
=== removed file 'support/apt-zeroconf.xml'
--- support/apt-zeroconf.xml 2009-07-04 03:53:33 +0000
+++ support/apt-zeroconf.xml 1970-01-01 00:00:00 +0000
@@ -1,115 +0,0 @@
1<?xml version="1.0" encoding="utf-8"?>
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
4<!-- See http://www.docbook.org/tdg/en/html/refentry.html for more info
5 Use docbook2x-man to generate manpage. -->
6<refentry id="application.soovee">
7 <refentryinfo>
8 <author>Apt-ZeroConf Launchpad Team</author>
9 <address></address>
10
11 <copyright><year>2009</year><holder>Jeremy Austin-Bardo</holder></copyright>
12 </refentryinfo>
13
14 <refmeta>
15 <refentrytitle>apt-zeroconf</refentrytitle><manvolnum>1</manvolnum>
16 </refmeta>
17
18 <refnamediv>
19 <refname>apt-zeroconf</refname>
20 <refpurpose>Create an adhoc network on your local network to provide
21 Internet apt repository packages. Allowing you download once, then retrieve
22 locally for all other computers on your network.
23 </refpurpose>
24 </refnamediv>
25 <refsynopsisdiv>
26 <cmdsynopsis>
27 <command>apt-zeroconf</command>
28 <arg choice="opt">
29 <option>-p</option><option>--port</option> Number
30 </arg>
31 <arg choice="opt">
32 <option>-r</option><option>--restrict</option>
33 </arg>
34 <arg choice="opt">
35 <option>-d</option><option>--daemon</option>
36 <arg choice="req">start stop restart</arg>
37 </arg>
38 <arg choice="opt">
39 <option>-r</option><option>--restrict</option>
40 </arg>
41 <arg choice="opt">
42 <option>-l</option><option>--logger</option>
43 <arg choice="req">debug info warning error critical</arg>
44 </arg>
45 </cmdsynopsis>
46 </refsynopsisdiv>
47 <refsect1>
48 <title>Description</title>
49
50 <para><command>apt-zeroconf</command> </para>
51 </refsect1>
52
53 <refsect1>
54 <title>Command Arguments</title>
55
56 <variablelist>
57 <varlistentry>
58 <term>
59 <option>--port</option><option>-p</option>
60 </term>
61 <listitem>
62 <para>Override configuration file port designation for
63 <option>Number</option></para>
64 </listitem>
65 </varlistentry>
66 <varlistentry>
67 <term>
68 <option>-r</option><option>--restrict</option>
69 </term>
70 <listitem>
71 <para>Override configuration file proxy restriction to enable only
72 designated urls in [apt-cache] section.</para>
73 </listitem>
74 </varlistentry>
75 <varlistentry>
76 <term>
77 <option>-d</option><option>--daemon</option>
78 </term>
79 <listitem>
80 <para>Daemonize apt-zeroconf process to run as a background process.
81 Daemons value should be <option>debug</option>, <option>info</option>,
82 <option>warning</option>, <option>error</option>, or
83 <option>critical</option>. Should be run with sudo priviledges to
84 enable logging functionality.
85 </para>
86 </listitem>
87 </varlistentry>
88 <varlistentry>
89 <term>
90 <option>-l</option><option>--logger</option>
91 </term>
92 <listitem>
93 <para>Set logger logging level for apt-zeroconf to one of the
94 following <option>info</option>, <option>warning</option>,
95 <option>error</option>, or <option>critical</option>. Without setting
96 this switch the default will be <option>info</option>.
97 </para>
98 </listitem>
99 </varlistentry>
100 </variablelist>
101 </refsect1>
102
103 <refsect1>
104 <title>See Also</title>
105
106 </refsect1>
107
108 <refsect1>
109 <title>Author</title>
110 <para>Apt-ZeroConf Launchpad Team</para>
111 <para>Permission is hereby granted to copy, distribute and/or modify this
112 document under the terms of the GNU General Public License, Version 2 or
113 later by the Free Software Foundation.</para>
114 </refsect1>
115</refentry>
1160
=== modified file 'support/azc_rule'
--- support/azc_rule 2009-07-13 23:48:19 +0000
+++ support/azc_rule 2010-02-01 20:58:13 +0000
@@ -1,4 +1,4 @@
1[AptZeroConf]1[AptZeroConf]
2title= Apt-ZeroConf2title=Apt-ZeroConf
3description=Personal Package Cache using Avahi ZeroConf.3description=Personal Package Cache using Avahi ZeroConf.
4ports=1618/tcp4ports=1618/tcp
55
=== removed file 'support/build.sh'
--- support/build.sh 2009-06-30 21:20:54 +0000
+++ support/build.sh 1970-01-01 00:00:00 +0000
@@ -1,5 +0,0 @@
1#!/bin/sh
2echo "building..."
3for file in `ls *.xml`; do docbook2x-man $file; done
4echo "compressing..."
5for file in `ls *.1`; do gzip $file; done
60
=== modified file 'test/test_general.py'
--- test/test_general.py 2009-08-09 03:57:29 +0000
+++ test/test_general.py 2010-02-01 20:58:13 +0000
@@ -122,8 +122,7 @@
122 PORT, DEBNAME)).read()122 PORT, DEBNAME)).read()
123 # make sure the data is equal123 # make sure the data is equal
124 assert data == '*contents*'124 assert data == '*contents*'
125125
126
127def test_download_epoch_local_server(tmpdir):126def test_download_epoch_local_server(tmpdir):
128 """127 """
129 Test fetching a file with an epoch from an AZC instance on the local network.128 Test fetching a file with an epoch from an AZC instance on the local network.

Subscribers

People subscribed via source and target branches