> Nick Guenther wrote:
>> On Wed, Jul 30, 2008 at 12:17 PM, macintoshzoom
>> <[EMAIL PROTECTED]> wrote:
>>> I need an alternative to the default system fetch ftp used by pkg_add,
>>> that could be socksified via dsocks,
>>> e.g. FETCH_CMD="dsocks-torify.sh newsocksifiableftp"
>>>
>>> Okay only passive ftp.
>>>
>>> BUT, as pkg_add man says, this alternative must:
>>> <<<<<<<
>>> man pkg_add :
>>> FETCH_CMD Override use of ftp(1). Must point to a command that
>>> understands ${FETCH_CMD} -o - url.
>>> I like wget, BUT it don't understands the command -o as ftp, it uses -O
>>> instead I think, so wget can't be used as a straight replacement to ftp
>>> for pkg_add ... ? (unless tweaking the perl pkg_add code?)
>>>
>>> I want to run pkg_add -u routed via my (only) exit socks 4a/5 proxy
>>> server (tor).
>>> (dsocks-torify.sh ftp don't work)
>>>
>>
>> What if you wrote a script that looked for -o that then called wget
>> with -O and used that for FETCH_CMD?
>>
>> -Nick
>>
On Wed, Jul 30, 2008 at 1:23 PM, macintoshzoom
<[EMAIL PROTECTED]> wrote:
> Yes, I like that, but I don't know (yet) how to write this script.
> My script knowledge ends by now to just simple basic things like:
> ------
> #! /bin/sh
> kdesu 'pfctl -Fa -f /etc/pf.conf-443+80' && display
> /home/xx/pf.conf-reloaded-to-pf.conf-443+80-OKAY.png &
> --------
> (I am building an OpenBSD-KDE Desktop)
>
> I think pkg_add calls ftp with the "-o" command via many different
> (perl?) scripts.
> Doing a context text file search for "-o", or "fetch", or "FETCH_CMD",
> in / can give a clue of where to tweak.
>
> I think pkg_add -u uses also sysmerge:
> The /usr/sbin/sysmerge script mentions the FETCH_CMD= and has a
> "FETCH_CMD="/usr/bin/ftp -V -m -k" at line 39.
> .. perhaps tweaking all those scripts (which ones?) for wget use
> instead of ftp...
>
>
> A script to enable the use of wget for FETCH_CMD= for me should be
> excellent.
>
> Any link where I can learn how to do this kind of scripts?
> Or any very similar script to tweak?
>
> Thanks.
> Mac.
No... don't tweak pkg_add (at least, not without thinking it through
and making it worthy of a patch). Maintaining your own little branch
of pkg_add is bad. Use the hook they gave you.
Perhaps google for a shell programming tutorial a bit? Shell
programming sucks, but it's useful to have in your back pocket. You'll
want to use getopt(1)
(http://www.openbsd.org/cgi-bin/man.cgi?query=getopt&sektion=1).
Alternatively, if you want to hack it (since you know exactly what the
command line is going to look like) just do:
-----
#!/bin/sh
wget -O - $3
-----
Doing it this way will break things down the road, but it'll work for
this week and if you just want to get your system up that's probably
better for you.
(note: $3 means the fourth argument token in the command line, but I'm
not 100% that will work so please test it yourself).
-Nick
[by the way, not to nitpick at you personally, but if you could
remember to CC the mailing list (unless the discussion has clearly
been taken Offline) then everyone else can benefit from the knowledge
that we share :)]
_______________________________________________
Openbsd-newbies mailing list
[email protected]
http://mailman.theapt.org/listinfo/openbsd-newbies