Gentoo Archives: gentoo-commits

From: "Robin H. Johnson (robbat2)" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-misc/apt-cacher-ng/files: apt-cacher-ng-0.7.19-gentoo.diff
Date: Thu, 05 Dec 2013 02:45:33
Message-Id: 20131205024525.1B3A12004B@flycatcher.gentoo.org
1 robbat2 13/12/05 02:45:25
2
3 Added: apt-cacher-ng-0.7.19-gentoo.diff
4 Log:
5 Add in Gentoo mirror support to apt-cacher-ng, patch submitted to upstream as well.
6
7 (Portage version: 2.2.7/cvs/Linux x86_64, unsigned Manifest commit)
8
9 Revision Changes Path
10 1.1 net-misc/apt-cacher-ng/files/apt-cacher-ng-0.7.19-gentoo.diff
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/apt-cacher-ng/files/apt-cacher-ng-0.7.19-gentoo.diff?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/apt-cacher-ng/files/apt-cacher-ng-0.7.19-gentoo.diff?rev=1.1&content-type=text/plain
14
15 Index: apt-cacher-ng-0.7.19-gentoo.diff
16 ===================================================================
17 Support Gentoo mirrors in apt-cacher-ng
18
19 Please note the use of a script to build the gentoo_mirrors file live; this
20 should probably be done when each release is being built.
21
22 The geo-balanced http://distfiles.gentoo.org/ mirror is NOT included in the
23 mirrors3.xml source, so it gets added manually.
24
25 The first 3 sed expresssions aren't actually required, but are useful in making
26 the output list understandable.
27
28 Signed-off-by: Robin H. Johnson <robbat2@g.o>
29
30 diff -Nuar --exclude '*.gz' apt-cacher-ng-0.7.19.orig/conf/acng.conf apt-cacher-ng-0.7.19/conf/acng.conf
31 --- apt-cacher-ng-0.7.19.orig/conf/acng.conf 2013-07-28 11:09:43.000000000 -0700
32 +++ apt-cacher-ng-0.7.19/conf/acng.conf 2013-12-03 19:55:07.000000000 -0800
33 @@ -44,6 +44,7 @@
34 Remap-fedora: file:fedora_mirrors # Fedora Linux
35 Remap-epel: file:epel_mirrors # Fedora EPEL
36 Remap-slrep: file:sl_mirrors # Scientific Linux
37 +Remap-gentoo: file:gentoo_mirrors.gz http://distfiles.gentoo.org/ /gentoo ; file:backends_gentoo # Gentoo Archives
38
39 # This is usually not needed for security.debian.org because it's always the
40 # same DNS hostname. However, it might be enabled in order to use hooks,
41 diff -Nuar --exclude '*.gz' apt-cacher-ng-0.7.19.orig/conf/backends_gentoo.default apt-cacher-ng-0.7.19/conf/backends_gentoo.default
42 --- apt-cacher-ng-0.7.19.orig/conf/backends_gentoo.default 1969-12-31 16:00:00.000000000 -0800
43 +++ apt-cacher-ng-0.7.19/conf/backends_gentoo.default 2013-12-03 19:46:38.000000000 -0800
44 @@ -0,0 +1,4 @@
45 +# This is a configuration file. All lines starting with # are ignored.
46 +
47 +# gentoo mirrors use geodns to dispatch to the nearest location
48 +http://distfiles.gentoo.org/
49 diff -Nuar --exclude '*.gz' apt-cacher-ng-0.7.19.orig/conf/gentoo_mirrors.sh apt-cacher-ng-0.7.19/conf/gentoo_mirrors.sh
50 --- apt-cacher-ng-0.7.19.orig/conf/gentoo_mirrors.sh 1969-12-31 16:00:00.000000000 -0800
51 +++ apt-cacher-ng-0.7.19/conf/gentoo_mirrors.sh 2013-12-04 18:20:07.000000000 -0800
52 @@ -0,0 +1,11 @@
53 +#!/bin/sh
54 +# This fetchs the live Gentoo mirrors list
55 +# robbat2@g.o - 2013/Dec/03
56 +OUTFILE=/etc/apt-cacher-ng/gentoo_mirrors
57 +wget --save-headers -q http://www.gentoo.org/main/en/mirrors3.xml -O - \
58 + |sed -n \
59 + -e '/^[A-Z]/{s,^,#,g;p}' \
60 + -e '/<mirrorgroup/{s,^,\n#,g;p}' \
61 + -e '/<name/{s,^,#,g;p}' \
62 + -e '/<uri/{/protocol="http"/{s/.*<uri[^>]\+>//g;s/<\/uri>//g;p}}' \
63 + | gzip -9 >${OUTFILE}.gz