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 <[email protected]>
---
 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|@srce...@]|$(SRCEXT)|g' \
        -e 's|@car...@]|$(CARCH)|g' \
        -e 's|@cho...@]|$(CHOST)|g' \
+       -e 's|@dlagent_f...@]|$(DLAGENT_FTP)|g' \
+       -e 's|@dlagent_ht...@]|$(DLAGENT_HTTP)|g' \
+       -e 's|@dlagent_htt...@]|$(DLAGENT_HTTPS)|g' \
+       -e 's|@dlagent_rsy...@]|$(DLAGENT_RSYNC)|g' \
+       -e 's|@dlagent_s...@]|$(DLAGENT_SCP)|g' \
        -e 's|@archswit...@]|$(ARCHSWITCH)|g' \
        -e 's|@carchfla...@]|$(CARCHFLAGS)|g' \
        -e 's|@rootd...@]|$(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
_______________________________________________
pacman-dev mailing list
[email protected]
http://www.archlinux.org/mailman/listinfo/pacman-dev

Reply via email to