Make --httpproxy and friends work again (RhBug:529214)
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 22 Oct 2009 07:37:49 +0000 (10:37 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 22 Oct 2009 07:37:49 +0000 (10:37 +0300)
- macro fiddling to pass the macros set by --httpproxy etc popt aliases
  to the url helper
- ftp proxy and http proxy control the same thing (http proxy) now to
  keep things simple
- while at it, add %__urlhelper_localopts for local customization needs
  without having to override the entire __urlhelperopts macro

macros.in
rpmpopt.in

index 75949a4..ae46fcb 100644 (file)
--- a/macros.in
+++ b/macros.in
@@ -1186,9 +1186,13 @@ done \
 %find_lang     %{_rpmconfigdir}/find-lang.sh %{buildroot}
 
 # Commands + opts to use for retrieving remote files
+# Proxy opts can be set through --httpproxy/--httpport popt aliases,
+# for any special local needs use %__urlhelper_localopts in system-wide
+# or per-user macro configuration.
 %__urlhelpercmd         @__CURL@
 %__urlhelperopts        --silent --show-error --fail --location -o
-%_urlhelper             %{__urlhelpercmd} %{__urlhelperopts}
+%__urlhelper_proxyopts   %{?_httpproxy:--proxy %{_httpproxy}%{?_httpport::%{_httpport}}}%{!?_httpproxy:%{nil}}
+%_urlhelper             %{__urlhelpercmd} %{?__urlhelper_localopts} %{?__urlhelper_proxyopts} %{__urlhelperopts}
 
 
 # \endverbatim
index 4b8dd52..1d8816a 100644 (file)
@@ -140,9 +140,9 @@ rpm alias --rebuilddbpath    --define '_dbapath_rebuild !#:+'
 #      [--dbpath DIRECTORY"    "use database in DIRECTORY"
 rpm    alias --dbpath          --define '_dbpath !#:+'
 #      [--ftpport <port>]      "port number of ftp server (or proxy)"
-rpm    alias --ftpport         --define '_ftpport !#:+'
+rpm    alias --ftpport         --define '_httpport !#:+'
 #      [--ftpproxy <host>]     "hostname or IP of ftp proxy"
-rpm    alias --ftpproxy        --define '_ftpproxy !#:+'
+rpm    alias --ftpproxy        --define '_httpproxy !#:+'
 #      [--httpport <port>]     "port number of http server (or proxy)"
 rpm    alias --httpport        --define '_httpport !#:+'
 #      [--httpproxy <host>]    "hostname or IP of http proxy"
@@ -152,8 +152,8 @@ rpm alias --httpproxy       --define '_httpproxy !#:+'
 rpmbuild       alias --dbpath          --define '_dbpath !#:+' \
        --POPTdesc=$"use database in DIRECTORY" \
        --POPTargs=$"DIRECTORY"
-rpmbuild alias --ftpport               --define '_ftpport !#:+'
-rpmbuild alias --ftpproxy      --define '_ftpproxy !#:+'
+rpmbuild alias --ftpport               --define '_httpport !#:+'
+rpmbuild alias --ftpproxy      --define '_httpproxy !#:+'
 rpmbuild alias --httpport      --define '_httpport !#:+'
 rpmbuild alias --httpproxy     --define '_httpproxy !#:+'
 rpmbuild alias --timecheck     --define '_timecheck !#:+'