[pacman-dev] [PATCH] Allow vendor based DLAGENT settings in makepkg.conf

Yun Zheng Hu yunzheng.hu at gmail.com
Sun Feb 8 10:55:39 EST 2009


This patch will allow the default DLAGENT settings to be overridden in
the configure script. This will allow better default DLAGENT settings
for specific platforms/vendors. For example: Mac OS X does not have
wget installed by default, but it does have curl by default.

Currently the patch only overrides the default FTP and HTTP/HTTPS
agents when configuring for Mac OS X.

Signed-off-by: Yun Zheng Hu <yunzheng.hu at gmail.com>
---
 configure.ac        |   20 ++++++++++++++++++++
 etc/Makefile.am     |    5 +++++
 etc/makepkg.conf.in |   10 +++++-----
 3 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 2e7f433..0a63405 100644
--- a/configure.ac
+++ b/configure.ac
@@ -236,6 +236,26 @@ case "${host}" in
 		;;
 esac

+# Configure DLAGENT settings, used in makepkg.conf
+DLAGENT_FTP="ftp::/usr/bin/wget -c --passive-ftp -t 3 --waitretry=3 -O %o %u"
+DLAGENT_HTTP="http::/usr/bin/wget -c -t 3 --waitretry=3 -O %o %u"
+DLAGENT_HTTPS="https::/usr/bin/wget -c -t 3 --waitretry=3
--no-check-certificate -O %o %u"
+DLAGENT_RSYNC="rsync::/usr/bin/rsync -z %u %o"
+DLAGENT_SCP="scp::/usr/bin/scp -C %u %o"
+case "${host_vendor}" in
+	apple)
+		DLAGENT_FTP="ftp::/usr/bin/curl --location --continue-at - --retry
3 --retry-delay 3 -o %o %u"
+		DLAGENT_HTTP="http::/usr/bin/curl --location --continue-at -
--retry 3 --retry-delay 3 -o %o %u"
+		DLAGENT_HTTPS="https::/usr/bin/curl --location --continue-at -
--retry 3 --retry-delay 3 --insecure -o %o %u"
+		;;
+esac
+
+AC_SUBST(DLAGENT_FTP)
+AC_SUBST(DLAGENT_HTTP)
+AC_SUBST(DLAGENT_HTTPS)
+AC_SUBST(DLAGENT_RSYNC)
+AC_SUBST(DLAGENT_SCP)
+
 # Now do some things common to all architectures
 CHOST="${host}"
 AC_SUBST(CARCH)
diff --git a/etc/Makefile.am b/etc/Makefile.am
index 55c28c3..1605bfc 100644
--- a/etc/Makefile.am
+++ b/etc/Makefile.am
@@ -15,6 +15,11 @@ edit = sed \
 	-e 's|@SRCEXT[@]|$(SRCEXT)|g' \
 	-e 's|@CARCH[@]|$(CARCH)|g' \
 	-e 's|@CHOST[@]|$(CHOST)|g' \
+	-e 's|@DLAGENT_FTP[@]|$(DLAGENT_FTP)|g' \
+	-e 's|@DLAGENT_HTTP[@]|$(DLAGENT_HTTP)|g' \
+	-e 's|@DLAGENT_HTTPS[@]|$(DLAGENT_HTTPS)|g' \
+	-e 's|@DLAGENT_RSYNC[@]|$(DLAGENT_RSYNC)|g' \
+	-e 's|@DLAGENT_SCP[@]|$(DLAGENT_SCP)|g' \
 	-e 's|@ARCHSWITCH[@]|$(ARCHSWITCH)|g' \
 	-e 's|@CARCHFLAGS[@]|$(CARCHFLAGS)|g' \
 	-e 's|@ROOTDIR[@]|$(ROOTDIR)|g'
diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in
index d811867..d6c4ea6 100644
--- a/etc/makepkg.conf.in
+++ b/etc/makepkg.conf.in
@@ -8,11 +8,11 @@
 #
 #-- The download utilities that makepkg should use to acquire sources
 #  Format: 'protocol::agent'
-DLAGENTS=('ftp::/usr/bin/wget -c --passive-ftp -t 3 --waitretry=3 -O %o %u'
-          'http::/usr/bin/wget -c -t 3 --waitretry=3 -O %o %u'
-          'https::/usr/bin/wget -c -t 3 --waitretry=3
--no-check-certificate -O %o %u'
-          'rsync::/usr/bin/rsync -z %u %o'
-          'scp::/usr/bin/scp -C %u %o')
+DLAGENTS=('@DLAGENT_FTP@'
+          '@DLAGENT_HTTP@'
+          '@DLAGENT_HTTPS@'
+          '@DLAGENT_RSYNC@'
+          '@DLAGENT_SCP@')

 # Other common tools:
 # /usr/bin/snarf
-- 
1.6.1.2


More information about the pacman-dev mailing list