Package: apt-cacher-ng
Version: 0.8.0-3
Severity: important
Tags: patch

Dear Maintainer,

Using apt-cacher-ng to cache RPMs from Fedora Rawhide eventually results
in packages that cannot be verified, because it would seem that Fedora
allows them to be rebuilt without incrementing the version number.

I tried fixing this problem by marking them as volatile with the
VfilePatternEx option:

    /development/rawhide/.*

However, this fails to achieve anything, since the default SPfilePattern
includes all RPMs and this option overrides any VfilePattern option.

Not completely understading why the default SPfilePattern must include
all RPMs, I have provided a possible solution which allows for
exceptions by specifying an SVfilePattern, the default being the regex
above.  I don't know if any other Fedora releases should also be treated
as volatile.

Best regards,

Carlos

-- Package-specific info:

-- System Information:
Debian Release: 8.0
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages apt-cacher-ng depends on:
ii  adduser                3.113+nmu3
ii  debconf [debconf-2.0]  1.5.55
ii  dpkg                   1.17.24
ii  init-system-helpers    1.22
ii  libbz2-1.0             1.0.6-7+b2
ii  libc6                  2.19-17
ii  libgcc1                1:4.9.2-10
ii  liblzma5               5.1.1alpha+20120614-2+b3
ii  libssl1.0.0            1.0.1k-1
ii  libstdc++6             4.9.2-10
ii  libsystemd0            215-12
ii  libwrap0               7.6.q-25
ii  zlib1g                 1:1.2.8.dfsg-2+b1

Versions of packages apt-cacher-ng recommends:
ii  ed  1.10-2

Versions of packages apt-cacher-ng suggests:
ii  avahi-daemon  0.6.31-4+b2
ii  curl          7.38.0-4
ii  doc-base      0.10.6
ii  libfuse2      2.9.3-15+b1
ii  wget          1.16-3

-- Configuration Files:
/etc/apt-cacher-ng/acng.conf changed [not included]
/etc/apt-cacher-ng/security.conf [Errno 13] Permission denied: 
u'/etc/apt-cacher-ng/security.conf'
/etc/cron.daily/apt-cacher-ng [Errno 2] No such file or directory: 
u'/etc/cron.daily/apt-cacher-ng'

-- debconf information excluded
diff --git a/debian/changelog b/debian/changelog
index bddd009..3dca6d2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
+apt-cacher-ng (0.8.0-3.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fixed support for SPfilePatternEx and improved documentation.
+  * Allow Fedora Rawhide repository to be treated as volatile.
+  * Added more Fedora mirrors.
+  * Updated build dependency to libsystemd-dev, as libsystemd-daemon-dev
+    is now obsolete.
+
+ -- Carlos Maddela <[email protected]>  Mon, 16 Mar 2015 06:44:17 +1100
+
 apt-cacher-ng (0.8.0-3) unstable; urgency=medium
 
   * Restored build-dependency on libsystemd-daemond-dev since upstream source
diff --git a/debian/control b/debian/control
index cbfa365..42425a1 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: apt-cacher-ng
 Section: net
 Priority: optional
 Maintainer: Eduard Bloch <[email protected]>
-Build-Depends: debhelper (>= 9), cmake (>= 2.6.2), libbz2-dev, zlib1g-dev, liblzma-dev, libfuse-dev [!hurd-i386], pkg-config, libwrap0-dev, lsb-base (>> 3.0-6), dh-systemd (>= 1.5), po-debconf, libssl-dev, libsystemd-daemon-dev [linux-any]
+Build-Depends: debhelper (>= 9), cmake (>= 2.6.2), libbz2-dev, zlib1g-dev, liblzma-dev, libfuse-dev [!hurd-i386], pkg-config, libwrap0-dev, lsb-base (>> 3.0-6), dh-systemd (>= 1.5), po-debconf, libssl-dev, libsystemd-dev [linux-any]
 Standards-Version: 3.9.6
 Homepage: http://www.unix-ag.uni-kl.de/~bloch/acng/
 
diff --git a/debian/patches/fedora-mirrors.patch b/debian/patches/fedora-mirrors.patch
new file mode 100644
index 0000000..21dd244
--- /dev/null
+++ b/debian/patches/fedora-mirrors.patch
@@ -0,0 +1,43 @@
+From: Carlos Maddela <[email protected]>
+Date: Mon, 16 Mar 2015 07:35:09 +1100
+Subject: Added more Fedora mirrors.
+
+Description: Added more Fedora mirrors.
+Author: Carlos Maddela <[email protected]>
+Origin: vendor
+Forwarded: no
+Last-Update: 2015-03-06
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+---
+ conf/fedora_mirrors | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/conf/fedora_mirrors b/conf/fedora_mirrors
+index 7fa33fa..6df4084 100644
+--- a/conf/fedora_mirrors
++++ b/conf/fedora_mirrors
+@@ -159,3 +159,23 @@ http://www.mirrorservice.org/sites/dl.fedoraproject.org/pub/fedora/linux/
+ http://www.muug.mb.ca/pub/fedora/linux/
+ http://www.nic.funet.fi/pub/mirrors/fedora.redhat.com/pub/fedora/linux/
+ http://www.webhostingjams.com/mirror/fedora/linux/
++http://download.fedoraproject.org/pub/fedora/linux/
++http://archive.linux.duke.edu/pub/fedora/linux/
++http://ftp.lip6.fr/ftp/pub/linux/distributions/fedora/
++http://ftp.jaist.ac.jp/pub/Linux/Fedora/
++http://ftp.linux.cz/pub/linux/fedora/linux/
++http://mirror.cedia.org.ec/fedora/
++http://mirrors.syringanetworks.net/fedora/
++http://mirror.symnds.com/distributions/fedora/
++http://mirror.vutbr.cz/fedora/
++http://mirror.nexcess.net/fedora/
++http://linux.mirrors.es.net/fedora/
++http://fedora.mirrors.tds.net/pub/fedora/
++http://mirror.uta.edu.ec/fedora/
++http://mirrors.kernel.org/fedora/
++http://mirror.easyspeedy.com/fedora/
++http://ftp.cica.es/fedora/linux/
++http://mirrors.ispros.com.bd/fedora/
++http://fedora.mirror.root.lu/
++http://mirror.steadfast.net/fedora/
++http://fedora.mirror.digitalpacific.com.au/linux/
diff --git a/debian/patches/fix-SPfilePatternEx.patch b/debian/patches/fix-SPfilePatternEx.patch
new file mode 100644
index 0000000..0a29079
--- /dev/null
+++ b/debian/patches/fix-SPfilePatternEx.patch
@@ -0,0 +1,81 @@
+From: Carlos Maddela <[email protected]>
+Date: Mon, 16 Mar 2015 04:55:39 +1100
+Subject: Fixed support for SPfilePatternEx and improved documentation
+
+Description: Fixed support for SPfilePatternEx and improved documentation
+Author: Carlos Maddela <[email protected]>
+Origin: vendor
+Forwarded: no
+Last-Update: 2015-03-16
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+---
+ conf/acng.conf | 36 ++++++++++++++++++++----------------
+ source/acfg.cc |  2 +-
+ 2 files changed, 21 insertions(+), 17 deletions(-)
+
+diff --git a/conf/acng.conf b/conf/acng.conf
+index 02943bd..66a0421 100644
+--- a/conf/acng.conf
++++ b/conf/acng.conf
+@@ -170,27 +170,31 @@ ExTreshold: 4
+ # Pigeonholing files (like static vs. volatile contents) is done by (extended)
+ # regular expressions.
+ #
+-# There are following patterns for different classes and purposes:
+-# - static data that doesn't change silently ont he server (PFilePattern)
+-# - volatile data that can be changed like every hour (VFilePattern)
+-# - special static data that shared some file names with volatile data,
+-#   and in doubt should be identified as static (SPfilePattern)
+-# - a "whitelist pattern" with hints for the regular expiration job telling
+-#   to keep the files even if they are not referenced by others, like crypto
+-#   signatures with which clients begin their downloads (WfilePattern)
+-#
+-# There are two versions, the pattern variables mentioned above should not be
+-# set without good reasons because they override the built-in defaults (that
+-# might impact updates to future versions of apt-cacher-ng). There are also
+-# versions of those patterns with Ex patterns which should be modified by local
+-# administrator. They are evaluated in addition to regular patterns at runtime.
++# The following patterns are available for the purposes detailed, where
++# the latter takes precedence over the former:
++# - «PFilePattern» for static data that doesn't change silently on the server.
++# - «VFilePattern» for volatile data that may change like every hour. Files
++#   that match both PFilePattern and VfilePattern will be treated as volatile.
++# - Static data with file names that match VFilePattern may be overriden being
++#   treated as volatile by making it match the special static data pattern,
++#   «SPfilePattern».
++# - «WfilePattern» specifies a "whitelist pattern" for the regular expiration
++#   job, telling it to keep the files even if they are not referenced by
++#   others, like crypto signatures with which clients begin their downloads.
++#
++# There are two versions. The pattern variables mentioned above should not be
++# set without good reason, because they would override the built-in defaults
++# (that might impact updates to future versions of apt-cacher-ng). There are
++# also versions of those patterns ending with Ex, which may be modified by the
++# local administrator. They are evaluated in addition to the regular patterns
++# at runtime.
+ #
+ # To see examples of the expected syntax, run: apt-cacher-ng -p debug=1
+ #
+-# VfilePatternEx:
+ # PfilePatternEx:
+-# WfilePatternEx:
++# VfilePatternEx:
+ # SPfilePatternEx:
++# WfilePatternEx:
+ #
+ ###############################################################################
+ 
+diff --git a/source/acfg.cc b/source/acfg.cc
+index 70deff5..6139a7c 100644
+--- a/source/acfg.cc
++++ b/source/acfg.cc
+@@ -102,7 +102,7 @@ MapNameToString n2sTbl[] = {
+ 		,{  "VfilePatternEx",          &vfilepatEx}
+ 		,{  "PfilePatternEx",          &pfilepatEx}
+ 		,{  "WfilePatternEx",          &wfilepatEx}
+-		,{  "SPfilePattern",           &spfilepatEx}
++		,{  "SPfilePatternEx",         &spfilepatEx}
+ //		,{  "AdminAuth",               &adminauth}
+ 		,{  "BindAddress",             &bindaddr}
+ 		,{  "UserAgent",               &agentname}
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..9235163
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,3 @@
+fix-SPfilePatternEx.patch
+volatile-rawhide.patch
+fedora-mirrors.patch
diff --git a/debian/patches/volatile-rawhide.patch b/debian/patches/volatile-rawhide.patch
new file mode 100644
index 0000000..4e9dd17
--- /dev/null
+++ b/debian/patches/volatile-rawhide.patch
@@ -0,0 +1,131 @@
+From: Carlos Maddela <[email protected]>
+Date: Mon, 16 Mar 2015 06:01:18 +1100
+Subject: Allow Fedora Rawhide repository to be treated as volatile.
+
+Description: Allow Fedora Rawhide repository to be treated as volatile.
+ RPMs from Fedora Rawhide are often rebuilt without incrementing version
+ or build numbers, so must not be treated as static.
+Author: Carlos Maddela <[email protected]>
+Origin: vendor
+Forwarded: no
+Last-Update: 2015-03-16
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+---
+ conf/acng.conf          | 4 ++++
+ include/acfg.h          | 5 +++--
+ source/acfg.cc          | 9 ++++++++-
+ source/acfg_defaults.cc | 4 +++-
+ 4 files changed, 18 insertions(+), 4 deletions(-)
+
+diff --git a/conf/acng.conf b/conf/acng.conf
+index 66a0421..5190604 100644
+--- a/conf/acng.conf
++++ b/conf/acng.conf
+@@ -178,6 +178,9 @@ ExTreshold: 4
+ # - Static data with file names that match VFilePattern may be overriden being
+ #   treated as volatile by making it match the special static data pattern,
+ #   «SPfilePattern».
++# - «SVfilePattern» or the "special volatile data" pattern is for the
++#   convenience of specifying any exceptions to matches with SPfilePattern,
++#   for cases where data must still be treated as volatile.
+ # - «WfilePattern» specifies a "whitelist pattern" for the regular expiration
+ #   job, telling it to keep the files even if they are not referenced by
+ #   others, like crypto signatures with which clients begin their downloads.
+@@ -194,6 +197,7 @@ ExTreshold: 4
+ # PfilePatternEx:
+ # VfilePatternEx:
+ # SPfilePatternEx:
++# SVfilePatternEx:
+ # WfilePatternEx:
+ #
+ ###############################################################################
+diff --git a/include/acfg.h b/include/acfg.h
+index 44ad99b..056651e 100644
+--- a/include/acfg.h
++++ b/include/acfg.h
+@@ -28,9 +28,9 @@ namespace acfg
+ extern mstring cachedir, logdir, confdir, fifopath, user, group, pidfile, suppdir,
+ reportpage, vfilepat, pfilepat, wfilepat, agentname, adminauth, bindaddr, port, sUmask,
+ tmpDontcacheReq, tmpDontcachetgt, tmpDontcache, mirrorsrcs, requestapx,
+-cafile, capath, spfilepat, badredmime;
++cafile, capath, spfilepat, svfilepat, badredmime;
+ 
+-extern mstring pfilepatEx, vfilepatEx, wfilepatEx, spfilepatEx; // for customization by user
++extern mstring pfilepatEx, vfilepatEx, wfilepatEx, spfilepatEx, svfilepatEx; // for customization by user
+ 
+ extern int debug, numcores, offlinemode, foreground, verbose, stupidfs, forcemanaged, keepnver,
+ verboselog, extreshhold, exfailabort, tpstandbymax, tpthreadmax, dnscachetime, dlbufsize, usewrap,
+@@ -116,6 +116,7 @@ enum eMatchType
+ 	FILE_SOLID = 0, FILE_VOLATILE, FILE_WHITELIST,
+ 	NASTY_PATH, PASSTHROUGH,
+ 	FILE_SPECIAL_SOLID,
++	FILE_SPECIAL_VOLATILE,
+ 	ematchtype_max
+ };
+ bool Match(cmstring &in, eMatchType type);
+diff --git a/source/acfg.cc b/source/acfg.cc
+index 6139a7c..5b1768c 100644
+--- a/source/acfg.cc
++++ b/source/acfg.cc
+@@ -98,11 +98,13 @@ MapNameToString n2sTbl[] = {
+ 		,{  "VfilePattern",            &vfilepat}
+ 		,{  "PfilePattern",            &pfilepat}
+ 		,{  "SPfilePattern",           &spfilepat}
++		,{  "SVfilePattern",           &svfilepat}
+ 		,{  "WfilePattern",            &wfilepat}
+ 		,{  "VfilePatternEx",          &vfilepatEx}
+ 		,{  "PfilePatternEx",          &pfilepatEx}
+ 		,{  "WfilePatternEx",          &wfilepatEx}
+ 		,{  "SPfilePatternEx",         &spfilepatEx}
++		,{  "SVfilePatternEx",         &svfilepatEx}
+ //		,{  "AdminAuth",               &adminauth}
+ 		,{  "BindAddress",             &bindaddr}
+ 		,{  "UserAgent",               &agentname}
+@@ -1347,6 +1349,8 @@ bool CompileExpressions()
+ 			&& compat(rex[PASSTHROUGH].pat, PTHOSTS_PATTERN.c_str())
+ 			&& compat(rex[FILE_SPECIAL_SOLID].pat, spfilepat.c_str())
+ 			&& compat(rex[FILE_SPECIAL_SOLID].extra, spfilepatEx.c_str())
++			&& compat(rex[FILE_SPECIAL_VOLATILE].pat, svfilepat.c_str())
++			&& compat(rex[FILE_SPECIAL_VOLATILE].extra, svfilepatEx.c_str())
+ 			);
+ }
+ 
+@@ -1364,11 +1368,14 @@ bool Match(cmstring &in, eMatchType type)
+ 	if(MatchType(in, type))
+ 		return true;
+ 	// XXX: very special behavior...
+-	return (type == FILE_SOLID && MatchType(in, FILE_SPECIAL_SOLID));
++	return (type == FILE_SOLID && MatchType(in, FILE_SPECIAL_SOLID))
++		|| (type == FILE_VOLATILE && MatchType(in, FILE_SPECIAL_VOLATILE));
+ }
+ 
+ eMatchType GetFiletype(const string & in)
+ {
++	if (MatchType(in, FILE_SPECIAL_VOLATILE))
++		return FILE_VOLATILE;
+ 	if (MatchType(in, FILE_SPECIAL_SOLID))
+ 		return FILE_SOLID;
+ 	if (MatchType(in, FILE_VOLATILE))
+diff --git a/source/acfg_defaults.cc b/source/acfg_defaults.cc
+index 25ba3f0..5b538c9 100644
+--- a/source/acfg_defaults.cc
++++ b/source/acfg_defaults.cc
+@@ -32,6 +32,8 @@ string pfilepat(".*(\\.d?deb|\\.rpm|\\.drpm|\\.dsc|\\.tar" COMPRLIST
+ 		"|/dists/.*/installer-[^/]+/[0-9][^/]+/images/.*" // d-i stuff with revision
+ ")$");
+ 
++string svfilepat("/development/rawhide/.*");
++
+ string vfilepat(INFOLDER
+ 		"(Index|Packages" COMPOPT "|InRelease|Release|mirrors\\.txt|.*\\.gpg|NEWS\\.Debian"
+ 		"|Sources" COMPOPT "|release|index\\.db-.*\\.gz|Contents-[^/]*" COMPOPT
+@@ -59,7 +61,7 @@ string wfilepat(INFOLDER
+ 		"|[a-z]+32.exe"
+ 		")$");
+ 
+-string pfilepatEx, spfilepatEx, vfilepatEx, wfilepatEx; // for customization by user
++string pfilepatEx, spfilepatEx, vfilepatEx, svfilepatEx, wfilepatEx; // for customization by user
+ int offlinemode(false), verboselog(true), stupidfs(false), forcemanaged(false),
+ extreshhold(20), tpstandbymax(8), tpthreadmax(-1), dirperms(00755), fileperms(00664),
+ keepnver(0), maxtempdelay(27), vrangeops(1);

Reply via email to