]> git.saurik.com Git - apt.git/commitdiff
evaluate sourceslist-list-format entity in vendors sources.list
authorDavid Kalnischkies <david@kalnischkies.de>
Thu, 14 Jan 2016 13:45:37 +0000 (14:45 +0100)
committerDavid Kalnischkies <david@kalnischkies.de>
Thu, 14 Jan 2016 16:33:58 +0000 (17:33 +0100)
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

vendor/debian/apt-vendor.ent
vendor/debian/sources.list.in
vendor/getinfo
vendor/makefile
vendor/vendor.makefile

index 8b26da3853634ad2bb8388d888e7288eec3909ed..93e4e046043a440a58588c4540a9174f85c5c695 100644 (file)
@@ -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">
index c36fb16a73a5202cf280eba8ca79c2eb7ff22d09..0fae88e5ed0679953802f9a111b52b5c9a81a625 100644 (file)
@@ -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
index 415ede98c179f768ee08fd6a9e71abf05c96fbdd..79da83620f1f7af93720a74a93cf19588a2f048f 100755 (executable)
@@ -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() {
index ebf5787c84aac25a45177477b9de662550f4e775..966c3d080896434c0e751736c52b3d9290e1ea5b 100644 (file)
@@ -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
index 40b35ea3d9e5e1ad100dcd87edf9c40338238923..32de3b0d56fae545294306f5bce765afd60e411e 100644 (file)
@@ -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#&current-codename;#$(shell ../getinfo current-codename)#g' \
-               $< > $@
+               > $@
 
 clean: clean/sources.list
+veryclean: clean/sources.list
 
 clean/sources.list:
        rm -f sources.list