[pacman-dev] [PATCH] Allow vendor based DLAGENT settings in makepkg.conf
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@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
On Sun, Feb 8, 2009 at 9:55 AM, Yun Zheng Hu <yunzheng.hu@gmail.com> wrote:
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.
I like the intent of this patch, but not the implementation. I'm actually leaning away from all this customization stuff we do at all in makepkg.conf with configure.ac, as I really don't think it belongs there. I believe it is the responsibility of the downstream maintainer to tweak some of the shipped defaults, which is what we already do with Arch for both pacman.conf and makepkg.conf. Anyone else have opinions on this? Am I way off-base? -Dan
On Sun, Feb 8, 2009 at 7:27 PM, Dan McGee <dpmcgee@gmail.com> wrote:
On Sun, Feb 8, 2009 at 9:55 AM, Yun Zheng Hu <yunzheng.hu@gmail.com> wrote:
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.
I like the intent of this patch, but not the implementation. I'm actually leaning away from all this customization stuff we do at all in makepkg.conf with configure.ac, as I really don't think it belongs there. I believe it is the responsibility of the downstream maintainer to tweak some of the shipped defaults, which is what we already do with Arch for both pacman.conf and makepkg.conf.
Anyone else have opinions on this? Am I way off-base?
In this case, we should maybe use the most portable tools in the default makepkg.conf from the repository. But I have no clue if curl is more appropriate than wget if we consider all platforms. Otherwise we could provide the two alternatives, like in pacman.conf : 19 #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u 20 #XferCommand = /usr/bin/curl %u > %o Except than in the DLAGENT case, we probably want to uncomment one by default.
participants (3)
-
Dan McGee
-
Xavier
-
Yun Zheng Hu