tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

mk/fetch/fetch issue w/ sun download center



While playing with wip/virtualbox, I noticed that "make fetch" doesn't
work for this package, because of the way the master site does
HTTP redirections:

=> Fetching VirtualBox-3.0.2-OSE.tar.bz2
=> Total size: 51322139 bytes
Requesting
http://download.virtualbox.org/virtualbox/3.0.2/VirtualBox-3.0.2-OSE.tar.bz2
Redirected to
http://dlc-cdn.sun.com/virtualbox/3.0.2/VirtualBox-3.0.2-OSE.tar.bz2
Trying 87.248.216.55:80 ... Requesting
http://dlc-cdn.sun.com/virtualbox/3.0.2/VirtualBox-3.0.2-OSE.tar.bz2
Redirected to
http://dlc-cdn-rd.sun.com/c1/virtualbox/3.0.2/VirtualBox-3.0.2-OSE.tar.bz2?e=1247748219&h=ba09f9d1ab49265a0f20f201bb9001bc
Trying 87.248.207.138:80 ... Requesting
http://dlc-cdn-rd.sun.com/c1/virtualbox/3.0.2/VirtualBox-3.0.2-OSE.tar.bz2?e=1247748219&h=ba09f9d1ab49265a0f20f201bb9001bc
  1% |*    |   672 KiB  669.42 KiB/s    01:13 ETA^C

The problem here is that the additional URL parameters from the
redirect leak into the local filename. The following diff corrects the
problem. Are there any objections to this?

Index: fetch
===================================================================
RCS file: /cvsroot/pkgsrc/mk/fetch/fetch,v
retrieving revision 1.12
diff -u -r1.12 fetch
--- fetch       15 Dec 2008 09:01:30 -0000      1.12
+++ fetch       16 Jul 2009 12:43:04 -0000
@@ -272,7 +272,7 @@
          if ${TEST} -n "$resume"; then
                fetch_cmd="${FETCH_CMD} ${FETCH_BEFORE_ARGS} 
${FETCH_RESUME_ARGS} ${FETCH_OUTPUT_ARGS} $outputfile $site$file"
          else
-               fetch_cmd="${FETCH_CMD} ${FETCH_BEFORE_ARGS} $site$file 
${FETCH_AFTER_ARGS}"
+               fetch_cmd="${FETCH_CMD} ${FETCH_BEFORE_ARGS} 
${FETCH_OUTPUT_ARGS} $outputfile $site$file ${FETCH_AFTER_ARGS}"
          fi
          ${TEST} -z "$verbose" || ${ECHO} "$fetch_cmd"
          $fetch_cmd )


Home | Main Index | Thread Index | Old Index