diff options
author | David Kalnischkies <david@kalnischkies.de> | 2016-01-14 14:45:37 +0100 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2016-01-14 17:33:58 +0100 |
commit | 7fa4f5e12261d39666283051956d9e1f78eb609b (patch) | |
tree | b9ae7b93fe2e0d3d0ed4d1688eec6b1e52db72ef /vendor | |
parent | 9feb98eb0aeed775f78cb4afbf6bc0e3a90e9fed (diff) |
evaluate sourceslist-list-format entity in vendors sources.list
Parsing XML entity files in shell isn't exactly nice and causing the
substitution with a while-read loop isn't either, but it seems to be
good enough for the moment without changing too much.
Thanks: Niels Thykier for reporting on IRC
Diffstat (limited to 'vendor')
-rw-r--r-- | vendor/debian/apt-vendor.ent | 8 | ||||
-rw-r--r-- | vendor/debian/sources.list.in | 2 | ||||
-rwxr-xr-x | vendor/getinfo | 2 | ||||
-rw-r--r-- | vendor/makefile | 5 | ||||
-rw-r--r-- | vendor/vendor.makefile | 11 |
5 files changed, 19 insertions, 9 deletions
diff --git a/vendor/debian/apt-vendor.ent b/vendor/debian/apt-vendor.ent index 8b26da385..93e4e0460 100644 --- a/vendor/debian/apt-vendor.ent +++ b/vendor/debian/apt-vendor.ent @@ -6,14 +6,14 @@ <!ENTITY keyring-master-filename ""> <!ENTITY keyring-uri ""> -<!ENTITY sourceslist-list-format "deb http://httpredir.debian.org/debian &stable-codename; main contrib non-free -deb http://security.debian.org &stable-codename;/updates main contrib non-free"> +<!ENTITY sourceslist-list-format "deb http://httpredir.debian.org/debian &debian-stable-codename; main contrib non-free +deb http://security.debian.org &debian-stable-codename;/updates main contrib non-free"> <!ENTITY sourceslist-sources-format "Types: deb URIs: http://httpredir.debian.org/debian -Suites: &stable-codename; +Suites: &debian-stable-codename; Components: main contrib non-free Types: deb URIs: http://security.debian.org -Suites: &stable-codename;/updates +Suites: &debian-stable-codename;/updates Components: main contrib non-free"> diff --git a/vendor/debian/sources.list.in b/vendor/debian/sources.list.in index c36fb16a7..0fae88e5e 100644 --- a/vendor/debian/sources.list.in +++ b/vendor/debian/sources.list.in @@ -3,5 +3,5 @@ &sourceslist-list-format; # Uncomment if you want the apt-get source function to work -#deb-src http://ftp.us.debian.org/debian &debian-stable-codename; main contrib non-free +#deb-src http://httpredir.debian.org/debian &debian-stable-codename; main contrib non-free #deb-src http://security.debian.org &debian-stable-codename;/updates main contrib non-free diff --git a/vendor/getinfo b/vendor/getinfo index 415ede98c..79da83620 100755 --- a/vendor/getinfo +++ b/vendor/getinfo @@ -11,7 +11,7 @@ if [ -z "$INFO" ] || [ ! -e "$INFO" ]; then fi getrawfield() { - grep --max-count=1 "^<!ENTITY $1 \"" "${2:-$INFO}" | cut -d'"' -f 2 + awk "/<!ENTITY $1/ {f=NR} f && NR-1==f { print; exit 0 }" RS='"' "${2:-$INFO}" } getfield() { diff --git a/vendor/makefile b/vendor/makefile index ebf5787c8..966c3d080 100644 --- a/vendor/makefile +++ b/vendor/makefile @@ -50,6 +50,9 @@ current: .PHONY: clean veryclean all binary vendor clean: clean/current - clean/current: clean/subdirs rm -f current/makefile.auto current + +veryclean: veryclean/current +veryclean/current: veryclean/subdirs + rm -f current/makefile.auto current diff --git a/vendor/vendor.makefile b/vendor/vendor.makefile index 40b35ea3d..32de3b0d5 100644 --- a/vendor/vendor.makefile +++ b/vendor/vendor.makefile @@ -8,14 +8,21 @@ include ../../buildlib/defaults.mak doc binary manpages: sources.list sources.list: sources.list.in ../../doc/apt-verbatim.ent - sed -e 's#&debian-stable-codename;#$(shell ../getinfo debian-stable-codename)#g' \ + while read line; do \ + if [ "$${line}" = '&sourceslist-list-format;' ]; then \ + $(BASE)/vendor/getinfo vendor sourceslist-list-format ; \ + else \ + echo "$${line}"; \ + fi \ + done < $< | sed -e 's#&debian-stable-codename;#$(shell ../getinfo debian-stable-codename)#g' \ -e 's#&debian-oldstable-codename;#$(shell ../getinfo debian-oldstable-codename)#g' \ -e 's#&debian-testing-codename;#$(shell ../getinfo debian-testing-codename)#g' \ -e 's#&ubuntu-codename;#$(shell ../getinfo ubuntu-codename)#g' \ -e 's#¤t-codename;#$(shell ../getinfo current-codename)#g' \ - $< > $@ + > $@ clean: clean/sources.list +veryclean: clean/sources.list clean/sources.list: rm -f sources.list |