]> git.saurik.com Git - apt.git/commitdiff
autogenerate makefile for vendor system
authorDavid Kalnischkies <david@kalnischkies.de>
Sun, 23 Feb 2014 23:25:29 +0000 (00:25 +0100)
committerDavid Kalnischkies <david@kalnischkies.de>
Thu, 13 Mar 2014 12:57:34 +0000 (13:57 +0100)
It can be useful to have a whole makefile available for vendor setup,
but by providing a basic one we can deal with the simple cases more
easily (and changes to the system are presumably easier).

15 files changed:
.gitignore
doc/apt-verbatim.ent
vendor/debian/makefile [deleted file]
vendor/debian/sources.list.in
vendor/getinfo
vendor/makefile
vendor/raspbian/makefile [deleted file]
vendor/steamos/apt-vendor.ent
vendor/steamos/makefile [deleted file]
vendor/steamos/sources.list.in
vendor/tanglu/apt-vendor.ent
vendor/tanglu/makefile [deleted file]
vendor/tanglu/sources.list.in
vendor/ubuntu/makefile [deleted file]
vendor/vendor.makefile [new file with mode: 0644]

index 69a229c3ec8e42fe998f0ca2526428365e32796d..2c619ab57faa9881dc6cb0abf72987a9b61f03b4 100644 (file)
@@ -39,5 +39,5 @@
 /debian/libapt-inst*.install
 /debian/libapt-pkg-dev.install
 /vendor/current
 /debian/libapt-inst*.install
 /debian/libapt-pkg-dev.install
 /vendor/current
-/vendor/debian/sources.list
-/vendor/ubuntu/sources.list
+/vendor/*/sources.list
+/vendor/*/makefile.auto
index 6ff45e228b3db25c3b9c5fc2c5305c19b5bad4a3..75aa02c8fa098d15883b72743859ffe67dbe2a5a 100644 (file)
 <!ENTITY stable-codename "wheezy">
 <!ENTITY testing-codename "jessie">
 <!ENTITY stable-version "7">
 <!ENTITY stable-codename "wheezy">
 <!ENTITY testing-codename "jessie">
 <!ENTITY stable-version "7">
-<!ENTITY tanglu-codename "bartholomea">
 <!ENTITY ubuntu-codename "trusty">
 
 <!-- good and bad just refers to matching and not matching a pattern…
 <!ENTITY ubuntu-codename "trusty">
 
 <!-- good and bad just refers to matching and not matching a pattern…
diff --git a/vendor/debian/makefile b/vendor/debian/makefile
deleted file mode 100644 (file)
index 25bc035..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-# -*- make -*-
-BASE=../..
-SUBDIR=vendor/debian
-
-# Bring in the default rules
-include ../../buildlib/defaults.mak
-
-doc binary manpages: sources.list
-
-sources.list: sources.list.in ../../doc/apt-verbatim.ent
-       sed -e 's#&stable-codename;#$(shell ../getinfo debian-stable-codename)#g' $< > $@
-
-clean: clean/sources.list
-
-clean/sources.list:
-       rm -f sources.list
-
index 745e32cbefb41f605bc680e80c75c4c82ce31b8a..2e430296a83697771481889f370c4f84c676caa3 100644 (file)
@@ -1,8 +1,8 @@
 # See sources.list(5) manpage for more information
 # Remember that CD-ROMs, DVDs and such are managed through the apt-cdrom tool.
 # See sources.list(5) manpage for more information
 # Remember that CD-ROMs, DVDs and such are managed through the apt-cdrom tool.
-deb http://ftp.us.debian.org/debian &stable-codename; main contrib non-free
-deb http://security.debian.org &stable-codename;/updates main contrib non-free
+deb http://ftp.us.debian.org/debian &debian-stable-codename; main contrib non-free
+deb http://security.debian.org &debian-stable-codename;/updates main contrib non-free
 
 # Uncomment if you want the apt-get source function to work
 
 # Uncomment if you want the apt-get source function to work
-#deb-src http://ftp.us.debian.org/debian &stable-codename; main contrib non-free
-#deb-src http://security.debian.org &stable-codename;/updates main contrib non-free
+#deb-src http://ftp.us.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 4422f5d7861d5d7ccb4e9427da52cd9714460fa9..d45c0fca2b085000585e8168674cc74193466103 100755 (executable)
@@ -3,6 +3,7 @@
 
 BASEDIR="$(readlink -f "$(dirname $0)")"
 INFO="$(readlink -f "${BASEDIR}/current/apt-vendor.ent")"
 
 BASEDIR="$(readlink -f "$(dirname $0)")"
 INFO="$(readlink -f "${BASEDIR}/current/apt-vendor.ent")"
+VERBATIM="${BASEDIR}/../doc/apt-verbatim.ent"
 
 if [ -z "$INFO" ] || [ ! -e "$INFO" ]; then
        echo >&2 'The current vendor is not valid or not chosen by the buildsystem yet.'
 
 if [ -z "$INFO" ] || [ ! -e "$INFO" ]; then
        echo >&2 'The current vendor is not valid or not chosen by the buildsystem yet.'
@@ -20,17 +21,20 @@ getfield() {
 }
 
 case "$1" in
 }
 
 case "$1" in
-debian-stable-codename)
-       getrawfield 'stable-codename' "${BASEDIR}/../doc/apt-verbatim.ent"
-       ;;
-tanglu-codename)
-       getrawfield 'tanglu-codename' "${BASEDIR}/../doc/apt-verbatim.ent"
+debian-stable-codename|debian-oldstable-codename|debian-testing-codename)
+       getrawfield "${1#*-}" "$VERBATIM"
        ;;
 ubuntu-codename)
        ;;
 ubuntu-codename)
-       getrawfield 'ubuntu-codename' "${BASEDIR}/../doc/apt-verbatim.ent"
+       getrawfield "$1" "$VERBATIM"
+       ;;
+keyring-package|keyring-filename|keyring-master-filename|keyring-removed-filename|keyring-uri|current-codename)
+       exec $0 'vendor' "$@"
+       ;;
+vendor)
+       getfield "$2"
        ;;
        ;;
-keyring-package|keyring-filename|keyring-master-filename|keyring-removed-filename|keyring-uri|current-distro-codename)
-       getfield "$1"
+verbatim)
+       getfield "$2" "$VERBATIM"
        ;;
 *)
        echo >&2 "Unknown data field $1 requested"
        ;;
 *)
        echo >&2 "Unknown data field $1 requested"
index 619c603fbd5d4f658f3370c4a9ffd3b252684893..0701a03ebddc00370fc0dd3cef27a3aa6f21ac71 100644 (file)
@@ -14,11 +14,9 @@ veryclean: veryclean/subdirs
 dirs: dirs/subdirs
 manpages: manpages/subdirs
 
 dirs: dirs/subdirs
 manpages: manpages/subdirs
 
-all/subdirs binary/subdirs doc/subdirs dirs/subdirs manpages/subdirs:
-       $(MAKE) -C current $(patsubst %/subdirs,%,$@)
-
-clean/subdirs veryclean/subdirs:
-       test ! -e current || $(MAKE) -C current $(patsubst %/subdirs,%,$@)
+all/subdirs binary/subdirs doc/subdirs dirs/subdirs manpages/subdirs clean/subdirs veryclean/subdirs:
+       test ! -e current/makefile || $(MAKE) -C current $(patsubst %/subdirs,%,$@)
+       test ! -e current/makefile.auto || $(MAKE) -C current -f makefile.auto $(patsubst %/subdirs,%,$@)
 
 current:
        rm -f $@
 
 current:
        rm -f $@
@@ -29,17 +27,29 @@ current:
                        break; \
                fi; \
        done
                        break; \
                fi; \
        done
-       # if we haven't found a specific, look for a deriving in hardcoded order
-       test -e $@ || \
-               (dpkg-vendor --derives-from ubuntu && cp ln -s ubuntu $@ ) || \
-               (dpkg-vendor --derives-from tanglu && cp ln -s tanglu $@ ) || \
-               ln -s debian $@
+       # if we haven't found a specific, look for a deriving
+       # we do ubuntu and debian last as those are the biggest families
+       # and would therefore potentially 'shadow' smaller families
+       # (especially debian as it sorts quiet early)
+       if ! test -e $@; then \
+               find -mindepth 1 -maxdepth 1 -type d | cut -d'/' -f 2 | while read DISTRO; do \
+                       if [ "$$DISTRO" = 'debian' -o "$$DISTRO" = 'ubuntu' ]; then continue; fi; \
+                       if dpkg-vendor --derives-from $$DISTRO; then \
+                               ln -s $$DISTRO $@; \
+                               break; \
+                       fi; \
+               done; \
+               test -e $@ || \
+                       (dpkg-vendor --derives-from ubuntu && cp ln -s ubuntu $@ ) || \
+                       ln -s debian $@; \
+       fi
+       if test ! -e current/makefile; then \
+               sed "s#@@VENDOR@@#$(notdir $(shell readlink -f current))#" vendor.makefile > current/makefile.auto; \
+       fi
 
 .PHONY: clean veryclean all binary vendor
 
 .PHONY: clean veryclean all binary vendor
-.NOPARALLEL:
 
 clean: clean/current
 
 
 clean: clean/current
 
-clean/current:
-       test ! -e current || $(MAKE) -C current clean
-       rm -f current
+clean/current: clean/subdirs
+       rm -f current/makefile.auto current
diff --git a/vendor/raspbian/makefile b/vendor/raspbian/makefile
deleted file mode 100644 (file)
index c446490..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-# -*- make -*-
-BASE=../..
-SUBDIR=vendor/raspbian
-
-# Bring in the default rules
-include ../../buildlib/defaults.mak
-
-doc binary manpages: sources.list
-
-sources.list: sources.list.in ../../doc/apt-verbatim.ent
-       sed -e 's#&stable-codename;#$(shell ../getinfo debian-stable-codename)#g' $< > $@
-
-clean: clean/sources.list
-
-clean/sources.list:
-       rm -f sources.list
index 69bb254ef0f9a79bc1be43d7789fa423cb82f921..dc1b798e6d3ed7261918f2e1d4da447758e6a2be 100644 (file)
@@ -3,6 +3,6 @@
 <!ENTITY keyring-package "<package>valve-archive-keyring</package>">
 <!ENTITY keyring-filename "<filename>/usr/share/keyrings/valve-archive-keyring.gpg</filename>">
 <!ENTITY keyring-removed-filename "<filename>/usr/share/keyrings/valve-archive-removed-keys.gpg</filename>">
 <!ENTITY keyring-package "<package>valve-archive-keyring</package>">
 <!ENTITY keyring-filename "<filename>/usr/share/keyrings/valve-archive-keyring.gpg</filename>">
 <!ENTITY keyring-removed-filename "<filename>/usr/share/keyrings/valve-archive-removed-keys.gpg</filename>">
-<!ENTITY current-distro-codename "alchemist">
 <!ENTITY keyring-master-filename "">
 <!ENTITY keyring-uri "">
 <!ENTITY keyring-master-filename "">
 <!ENTITY keyring-uri "">
+<!ENTITY current-codename "alchemist">
diff --git a/vendor/steamos/makefile b/vendor/steamos/makefile
deleted file mode 100644 (file)
index 9ee0e65..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-# -*- make -*-
-BASE=../..
-SUBDIR=vendor/steamos
-
-# Bring in the default rules
-include ../../buildlib/defaults.mak
-
-doc binary manpages: sources.list
-
-sources.list: sources.list.in ../../doc/apt-verbatim.ent
-       sed -e 's#&stable-codename;#$(shell ../getinfo debian-stable-codename)#g' $< | sed -e 's#&steamos-codename;#$(shell ../getinfo current-distro-codename)#g' > $@
-
-clean: clean/sources.list
-
-clean/sources.list:
-       rm -f sources.list
-
index fed6c381807cced6e27e6e5e16d9eee41001dba1..69174d0905478cd2a13825a05115d82cbca89b95 100644 (file)
@@ -1,5 +1,5 @@
 # See sources.list(5) manpage for more information
 # Remember that CD-ROMs, DVDs and such are managed through the apt-cdrom tool.
 
 # See sources.list(5) manpage for more information
 # Remember that CD-ROMs, DVDs and such are managed through the apt-cdrom tool.
 
-deb http://repo.steampowered.com/steamos &steamos-codename; main contrib non-free
-deb-src http://repo.steampowered.com/steamos &steamos-codename; main contrib non-free
+deb http://repo.steampowered.com/steamos &current-codename; main contrib non-free
+deb-src http://repo.steampowered.com/steamos &current-codename; main contrib non-free
index 4b70a5f82ba20576b12c15151a2187f3a044cc42..d2442209c4f428f1f6d2ec3bdfdf716a8dcda1bf 100644 (file)
@@ -5,3 +5,4 @@
 <!ENTITY keyring-removed-filename "<filename>/usr/share/keyrings/tanglu-archive-removed-keys.gpg</filename>">
 <!ENTITY keyring-master-filename "">
 <!ENTITY keyring-uri "">
 <!ENTITY keyring-removed-filename "<filename>/usr/share/keyrings/tanglu-archive-removed-keys.gpg</filename>">
 <!ENTITY keyring-master-filename "">
 <!ENTITY keyring-uri "">
+<!ENTITY current-codename "bartholomea">
diff --git a/vendor/tanglu/makefile b/vendor/tanglu/makefile
deleted file mode 100644 (file)
index 9fe680b..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-# -*- make -*-
-BASE=../..
-SUBDIR=vendor/tanglu
-
-# Bring in the default rules
-include ../../buildlib/defaults.mak
-
-doc binary manpages: sources.list
-
-sources.list: sources.list.in ../../doc/apt-verbatim.ent
-       sed -e 's#&tanglu-codename;#$(shell ../getinfo tanglu-codename)#g' $< > $@
-
-clean: clean/sources.list
-
-clean/sources.list:
-       rm -f sources.list
index dfa219046b10267b07e34ae44f0bc273ceaf8131..ce95e70c2f4b4aae67361b1dd3ab8dd09412732a 100644 (file)
@@ -1,7 +1,7 @@
 # See sources.list(5) manpage for more information
 
 # See sources.list(5) manpage for more information
 
-deb http://archive.tanglu.org/tanglu &tanglu-codename; main contrib non-free
-#deb-src http://archive.tanglu.org/tanglu &tanglu-codename; main contrib non-free
+deb http://archive.tanglu.org/tanglu &current-codename; main contrib non-free
+#deb-src http://archive.tanglu.org/tanglu &current-codename; main contrib non-free
 
 
-#deb http://archive.tanglu.org/tanglu &tanglu-codename;-updates main contrib non-free
-#deb-src http://archive.tanglu.org/tanglu &tanglu-codename;-updates main contrib non-free
+#deb http://archive.tanglu.org/tanglu &current-codename;-updates main contrib non-free
+#deb-src http://archive.tanglu.org/tanglu &current-codename;-updates main contrib non-free
diff --git a/vendor/ubuntu/makefile b/vendor/ubuntu/makefile
deleted file mode 100644 (file)
index afcaaf7..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-# -*- make -*-
-BASE=../..
-SUBDIR=vendor/ubuntu
-
-# Bring in the default rules
-include ../../buildlib/defaults.mak
-
-doc binary manpages: sources.list
-
-sources.list: sources.list.in ../../doc/apt-verbatim.ent
-       sed -e 's#&ubuntu-codename;#$(shell ../getinfo ubuntu-codename)#g' $< > $@
-
-clean: clean/sources.list
-
-clean/sources.list:
-       rm -f sources.list
diff --git a/vendor/vendor.makefile b/vendor/vendor.makefile
new file mode 100644 (file)
index 0000000..40b35ea
--- /dev/null
@@ -0,0 +1,21 @@
+# -*- make -*-
+BASE=../..
+SUBDIR=vendor/@@VENDOR@@
+
+# Bring in the default rules
+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' \
+               -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
+
+clean/sources.list:
+       rm -f sources.list