[RFC] pkgmk and wget configuration
![](https://secure.gravatar.com/avatar/5fbfdcc9fece431e1ca05e46e42255d6.jpg?s=120&d=mm&r=g)
Hi all, currently all options for wget are hardcoded in pkgmk, which is very inflexible and doesn't allow user-specific settings. See [1] [2]. Unfortunately wget has not command-line option to read in an alternative configuration file, other than the default /etc/wgetrc and ~/.wgetrc. I'd propose a solution similar to that I've done for the pure-ftpd, which includes a custom configuration file via some bash tasks. It might look like that in pkgmk: WGET_CONF=/etc/pkgmk_wget.conf WGET_ARGS=$(sed '/^#/d' $WGET_CONF) WGET="/usr/bin/wget $WGET_ARGS" and pkgmk_wget.conf: # wget configuration for pkgmk --no-check-certificate --no-cache # End of file Sounds this interesting? best regards Juergen PS: curl has a nice -K/--config option ;-) [1] http://crux.nu/bugs/index.php?do=details&task_id=241 [2] http://crux.nu/bugs/index.php?do=details&task_id=347 -- Juergen Daubert | mailto:jue@jue.li Korb, Germany | http://jue.li/crux
![](https://secure.gravatar.com/avatar/5fbfdcc9fece431e1ca05e46e42255d6.jpg?s=120&d=mm&r=g)
On Fri, Oct 31, 2008 at 11:27:14AM +0100, Juergen Daubert wrote:
Hi all,
currently all options for wget are hardcoded in pkgmk, which is very inflexible and doesn't allow user-specific settings. See [1] [2].
well, obviously adding a new variable to pkgmk.conf WGET_ARGS="--no-check-certificate --no-cache" and using it in pkgmk is simpler and does the trick as well ... Greetings juergen -- Juergen Daubert | mailto:jue@jue.li Korb, Germany | http://jue.li/crux
![](https://secure.gravatar.com/avatar/9710f6be74c5777b5725293e8d3059c2.jpg?s=120&d=mm&r=g)
On Fri, 31 Oct 2008 11:50:25 +0100 Juergen Daubert <jue@jue.li> wrote:
On Fri, Oct 31, 2008 at 11:27:14AM +0100, Juergen Daubert wrote:
Hi all,
currently all options for wget are hardcoded in pkgmk, which is very inflexible and doesn't allow user-specific settings. See [1] [2].
well, obviously adding a new variable to pkgmk.conf
WGET_ARGS="--no-check-certificate --no-cache"
and using it in pkgmk is simpler and does the trick as well ...
IIRC this has been briefly discussed in IRC, the general consensus was that WGET_ARGS in pkgmk.conf was probably the best way to do it. -- Lucas Hazel <lucas@die.net.au>
![](https://secure.gravatar.com/avatar/5fbfdcc9fece431e1ca05e46e42255d6.jpg?s=120&d=mm&r=g)
On Fri, Oct 31, 2008 at 11:44:23PM +1100, Lucas Hazel wrote: [...]
IIRC this has been briefly discussed in IRC, the general consensus was that WGET_ARGS in pkgmk.conf was probably the best way to do it.
Thanks, Lucas, missed that discussion. I've attached a proposed patch to ticket #347 [1]. Greetings Juergen [1] http://crux.nu/bugs/index.php?do=details&task_id=347 -- Juergen Daubert | mailto:jue@jue.li Korb, Germany | http://jue.li/crux
![](https://secure.gravatar.com/avatar/a52180e24a72c78dc830624b240c5795.jpg?s=120&d=mm&r=g)
Hi Jue, Juergen Daubert wrote:
Hi all,
[...]
Unfortunately wget has not command-line option to read in an alternative configuration file, other than the default /etc/wgetrc and ~/.wgetrc. Well, I browse the wget code and seems that we could provide an alternative wgetrc file by defining an environment variable. See: (wget-1.11.4/src/init.c) (line 373)
/* Return the path to the user's .wgetrc. This is either the value of `WGETRC' environment variable, or `$HOME/.wgetrc'. If the `WGETRC' variable exists but the file does not exist, the function will exit(). */ [...] /* Try the environment. */ env = getenv ("WGETRC"); if (env && *env) { if (!file_exists_p (env)) { fprintf (stderr, _("%s: WGETRC points to %s, which doesn't exist.\n"), exec_name, env); exit (1); } return xstrdup (env); } [...] Best regards, Jose V Beneyto
participants (3)
-
Jose V Beneyto
-
Juergen Daubert
-
Lucas Hazel