Links
Tags
apache
armenia
books
bsd
c
c++
chips
cinema
concurrency
cooking
database
dragonfly
erlang
filesystem
freebsd
fun
hardware
java
javascript
json
languages
linux
lyric
mac_osx
mail
math
misc
music
personal
poems
presentation
programming
python
references
ruby
rubyjs
scm
software
spiking_neural_net
study
sysadm
sysarch
technology
testing
travel
virtualization
web
wee
windows
My DarwinPorts installation had problem with fetching source packages. After a while it simply stopped to fetch a package! I decided to look at the responsible code which was a Tcl file. Having written a simplistic Tcl interpreter in Ruby called RTcl, I put my hands on the code and replace the use of curl fetch with the wget command line utility. It’s a dirty hack I know, but it works great!
The patch (with leading whitespaces remove from each line):
--- /opt/local/share/darwinports/Tcl/port1.0/portfetch.tcl.old 2005-11-27 13:19:08.000000000 +0100
+++ /opt/local/share/darwinports/Tcl/port1.0/portfetch.tcl 2005-11-27 13:19:22.000000000 +0100
@@ -375,7 +375,7 @@
foreach site [set $url_var] {
ui_msg "$UI_PREFIX [format [msgcat::mc "Attempting to fetch %s from %s"] $distfile $site]"
set file_url [portfetch::assemble_url $site $distfile]
- if {![catch {eval curl fetch $fetch_options {$file_url} ${distpath}/${distfile}.TMP} result] &&
+ if {![catch {system "/usr/pkg/bin/wget -O ${distpath}/${distfile}.TMP $file_url"} result] &&
![catch {system "mv ${distpath}/${distfile}.TMP ${distpath}/${distfile}"}]} {
set fetched 1
break