[apt-proxy-devel] r608 - in people/halls/rework: apt_proxy/test
debian
Chris Halls
halls at costa.debian.org
Fri Jun 2 22:16:43 UTC 2006
Author: halls
Date: Fri Jun 2 22:16:42 2006
New Revision: 608
Modified:
people/halls/rework/apt_proxy/test/test_requests.py
people/halls/rework/debian/changelog
people/halls/rework/debian/postinst
people/halls/rework/doc/TODO
Log:
* Update TODO
* Always check cache directory and logfile permissions when package is installed, thanks Ben Hutchings for the patch (Closes: #312969)
* Add test_requests ftp backend test class
Modified: people/halls/rework/apt_proxy/test/test_requests.py
==============================================================================
--- people/halls/rework/apt_proxy/test/test_requests.py (original)
+++ people/halls/rework/apt_proxy/test/test_requests.py Fri Jun 2 22:16:42 2006
@@ -431,6 +431,23 @@
self.httpserver.stop()
BackendTestBase.tearDown(self)
+class FtpBackendTest(TestRequestHelper, BackendTestBase):
+ def setUp(self):
+ """
+ Make a configuration with a single backend
+ [files]
+ backends=file:///<path to test packages directory>
+ """
+ import test_fetchers
+ self.debugname = 'FtpBackendTest'
+ self.ftpserver = test_fetchers.FtpServer()
+ port = self.ftpserver.start()
+ uri = "ftp://127.0.0.1:" + str(port)
+ BackendTestBase.setUp(self, uri)
+ def tearDown(self):
+ self.ftpserver.stop()
+ BackendTestBase.tearDown(self)
+
class RsyncBackendTest(TestRequestHelper, BackendTestBase):
def setUp(self):
"""
Modified: people/halls/rework/debian/changelog
==============================================================================
--- people/halls/rework/debian/changelog (original)
+++ people/halls/rework/debian/changelog Fri Jun 2 22:16:42 2006
@@ -8,11 +8,14 @@
* Move fetchers and cache management into separate files
* Add bandwidth_limit configuration parameter to limit download
rates (Closes: #306095)
- * Add more unit tests
* Add support for rsync port specification
+ * Always check cache directory and logfile permissions when package
+ is installed, thanks Ben Hutchings for the patch (Closes: #312969)
+ * Add more unit tests
* Remove obsolete debian/TODO from source package
+ * Update doc/TODO, removing fixed items
- -- Chris Halls <halls at debian.org> Thu, 25 May 2006 14:11:32 +0100
+ -- Chris Halls <chris.halls at credativ.co.uk> Thu, 1 Jun 2006 19:54:29 +0100
apt-proxy (1.9.33) unstable; urgency=low
Modified: people/halls/rework/debian/postinst
==============================================================================
--- people/halls/rework/debian/postinst (original)
+++ people/halls/rework/debian/postinst Fri Jun 2 22:16:42 2006
@@ -11,63 +11,63 @@
set -e
case "$1" in
configure)
- # Check if the user exist and do what is needed
- if ! id $APTPROXY_USER > /dev/null 2>&1; then
- # Create user
- echo creating $APTPROXY_USER user...
- adduser --quiet --system --ingroup nogroup \
- --home $CACHEDIR --no-create-home $APTPROXY_USER
-
- # Make apt-proxy user own cache directory
- chown -R $APTPROXY_USER $CACHEDIR
- # Create a blank logfile owned by apt-proxy user
- touch $APTPROXY_LOGFILE
- chown $APTPROXY_USER:adm $APTPROXY_LOGFILE
- chmod 640 $APTPROXY_LOGFILE
- fi
-
- PREV="$2"
- db_fget $NAME/upgrading-v2 had_v2_conf || true
- had_v2_conf=$RET
-
- if dpkg --compare-versions "$PREV" lt-nl 1.9; then
- if [ -x /usr/sbin/update-inetd ]; then
- echo "Disabling inetd's apt-proxy v1 line."
- update-inetd --comment-chars "#<apt-proxy-v2># " --disable 9999
- invoke-rc.d inetd restart
- fi
- db_fset $NAME/upgrading-v2 seen false || true
- db_input medium $NAME/upgrading-v2 || true
- db_go
- fi
- if
- dpkg --compare-versions "$PREV" lt-nl 1.9 && ( ! $had_v2_conf ) \
- && [ -r /etc/apt-proxy/apt-proxy.conf ]
- then
- echo Customising configuration file based on old settings.
- cp -a --backup=numbered /etc/apt-proxy/apt-proxy-v2.conf \
- /etc/apt-proxy/apt-proxy-v2.conf.backup
- OUTPUT=$(/usr/sbin/apt-proxy-v1tov2 /etc/apt-proxy/apt-proxy.conf \
- /etc/apt-proxy/apt-proxy-v2.conf.backup\
- 2>&1 \
- > /etc/apt-proxy/apt-proxy-v2.conf )
- echo "$OUTPUT" > /var/log/apt-proxy-v1tov2.log
- chown aptproxy:adm /var/log/apt-proxy-v1tov2.log
- chmod 640 /var/log/apt-proxy-v1tov2.log
- echo "The log of conversion was save in /var/log/apt-proxy-v1tov2.log."
- if [ -n "$OUTPUT" ]; then
- db_fset $NAME/upgrading-v2-result seen false
- db_input high $NAME/upgrading-v2-result || true
- db_go
- fi
- fi
- # Older versions got database permissions wrong #288829
- if dpkg --compare-versions "$PREV" lt-nl 1.9.27; then
- if [ -d /var/cache/apt-proxy/.apt-proxy ]; then
- echo "Fixing database owner."
- chown -R aptproxy.nogroup /var/cache/apt-proxy/.apt-proxy
- fi
- fi
+ # Check if the user exist and do what is needed
+ if ! id $APTPROXY_USER > /dev/null 2>&1; then
+ # Create user
+ echo creating $APTPROXY_USER user...
+ adduser --quiet --system --ingroup nogroup \
+ --home $CACHEDIR --no-create-home $APTPROXY_USER
+ fi
+
+ # Make apt-proxy user own cache directory
+ chown -R $APTPROXY_USER $CACHEDIR
+ # Create a blank logfile owned by apt-proxy user
+ touch $APTPROXY_LOGFILE
+ chown $APTPROXY_USER:adm $APTPROXY_LOGFILE
+ chmod 640 $APTPROXY_LOGFILE
+
+ PREV="$2"
+ db_fget $NAME/upgrading-v2 had_v2_conf || true
+ had_v2_conf=$RET
+
+ if dpkg --compare-versions "$PREV" lt-nl 1.9; then
+ if [ -x /usr/sbin/update-inetd ]; then
+ echo "Disabling inetd's apt-proxy v1 line."
+ update-inetd --comment-chars "#<apt-proxy-v2># " --disable 9999
+ invoke-rc.d inetd restart
+ fi
+ db_fset $NAME/upgrading-v2 seen false || true
+ db_input medium $NAME/upgrading-v2 || true
+ db_go
+ fi
+ if
+ dpkg --compare-versions "$PREV" lt-nl 1.9 && ( ! $had_v2_conf ) \
+ && [ -r /etc/apt-proxy/apt-proxy.conf ]
+ then
+ echo Customising configuration file based on old settings.
+ cp -a --backup=numbered /etc/apt-proxy/apt-proxy-v2.conf \
+ /etc/apt-proxy/apt-proxy-v2.conf.backup
+ OUTPUT=$(/usr/sbin/apt-proxy-v1tov2 /etc/apt-proxy/apt-proxy.conf \
+ /etc/apt-proxy/apt-proxy-v2.conf.backup\
+ 2>&1 \
+ > /etc/apt-proxy/apt-proxy-v2.conf )
+ echo "$OUTPUT" > /var/log/apt-proxy-v1tov2.log
+ chown aptproxy:adm /var/log/apt-proxy-v1tov2.log
+ chmod 640 /var/log/apt-proxy-v1tov2.log
+ echo "The log of conversion was save in /var/log/apt-proxy-v1tov2.log."
+ if [ -n "$OUTPUT" ]; then
+ db_fset $NAME/upgrading-v2-result seen false
+ db_input high $NAME/upgrading-v2-result || true
+ db_go
+ fi
+ fi
+ # Older versions got database permissions wrong #288829
+ if dpkg --compare-versions "$PREV" lt-nl 1.9.27; then
+ if [ -d /var/cache/apt-proxy/.apt-proxy ]; then
+ echo "Fixing database owner."
+ chown -R aptproxy.nogroup /var/cache/apt-proxy/.apt-proxy
+ fi
+ fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
Modified: people/halls/rework/doc/TODO
==============================================================================
--- people/halls/rework/doc/TODO (original)
+++ people/halls/rework/doc/TODO Fri Jun 2 22:16:42 2006
@@ -1,8 +1,6 @@
File permision's on the cache are too strict, there is nothing wrong in all
users reading the debs and Packages files.
-it looks like it is leaking FileVerifiers
-
Verification times out with big files and considers them corrupted even if
they are OK.
- We could have three levels of checking.
@@ -13,10 +11,6 @@
- when we find that stat doesn't match, we schedule a check and serve
anyway. We don't check before serving.
-To get streaming from rsync without the LD_PRELOAD hack:
- - Since we know the pid, we can read from /proc/$pid/fd/3 and get the
- streaming from there ala 'tail -f'
-
---------------- "Not so urgent" mark ---------------------------
Handle database corruption in a more conservative way.
@@ -24,17 +18,11 @@
Support /etc/init.d/apt-proxy reload as kill -HUP
- auto reload apt-proxy.conf support too?
-Report an error at /etc/init.d/apt-proxy start if something is already
-listening on the port (current behaviour is no error and message in logfile only)
-
Add a configuration parameter which says 'never delete the final version of
a package, even if older than max_age'
Maybe it should be "never delete files which still appear in current
Packages.gz listings"
-When a file transfer is finished, move the temporary file instead of coping
-it.
-
Mirror house-keeping:
MAX_VERSIONS: keep track of versions per distro (potato/woody/sid)
python-apt should help on that
@@ -56,14 +44,8 @@
Maybe we should write an AptProxyClientFile so it can be added to
factory.runningClients to prevent that.
-Cleanup orphan entries in packages.db also
-
Implement HEAD method
-Parse options:
- --conf
- ...
-
per backend 'min_age'
we won't bother to update a Packages file before it is "min_age" old
@@ -87,8 +69,6 @@
sources.list wouldn't need to be modified and apt could be forced to ignore
http_proxy environment variable.
-Add support to make apt-proxy request to a another proxy like squid.
-
consider doing file integrity checks after downloading instead of before
serving to improve performance.
@@ -100,9 +80,6 @@
- to access mirrors which may have it.
- sincronizing two caches
-Consider using apt-build to get "auto recompiled for your processor" packages.
- - warning apt-build changes your system compiler.. ugh. Chris
-
Deal with permissions problems in the cache gracefully, not like this:
22/08/2002 17:23 [AptProxy,1,192.168.60.24] [debug:9]CHECKING_CACHED
@@ -126,22 +103,5 @@
Accept numeric ports in backend configuration
----------------- Clean up of naming conventions -------------
-
-To help Chris get his head around the code :)
-
-Some suggestions that were hashed out:
-
-- Reduce imports at top of file -
-16:54 < ranty> but I don't understand how you plan to fix the namespace problem.
-16:56 < haggai> oh, not really. My only suggestion is to avoid excessibe use of 'import', or maybe to split into smaller source files
-move 'import' to the place where it is needed if posible.
-
----------------- OLD LIST from v1 ---------------------------
-TODO list for apt-proxy
-
-- Return a better error message if the backend servers do not exist, rather
- than 'directory does not exist'
-
- Add debconf questions for default user and cache directory
More information about the apt-proxy-devel
mailing list