Welcome to CRUX bug tracking.

FS#684 - Add User-Agent to ck4up HTTP Get

Attached to Project: CRUX
Opened by Daryl Fonseca-Holt (wyatt) - Sunday, 12 December 2010, 20:07 GMT
Last edited by Juergen Daubert (jue) - Tuesday, 14 December 2010, 16:49 GMT
Task Type Bug Report
Category ports → core/opt
Status New
Assigned To Juergen Daubert (jue)
Operating System Linux
Severity Low
Priority Normal
Reported Version 2.7
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


sourceforge is now tailoring http based on the browser User-Agent. ck4up isn't getting Linux related information, it's getting Windows (argh, the default). In ck4up.conf I have an item that worked until recently:

@TAR@ @NAME@-.*?\.tar\.[bg]z2?
xchm md5 @SFfiles@ @TAR@

I worked up a Ruby noob's patch that gets it working again by supplying the User-Agent from Linux Midori but it has the side-effect of requiring an ending slash (/) on each URL or the HTTP Get fails.

The attached patch is for ck4up ver 1.2 rel 1.
This task depends upon

Comment by Juergen Daubert (jue) - Monday, 13 December 2010, 11:50 GMT
Thanks for the patch, even though I'm not sure if it's a good idea at all, because ck4up is a general-purpose utility that can be used for other stuff than ports maintenance and should run fine under Windows. Sourceforge is and was a bit of a pain for non-interactive use and we should expect that they will change their stuff again in the future. Btw, why midori and not mozilla?
Comment by Daryl Fonseca-Holt (wyatt) - Monday, 13 December 2010, 22:57 GMT
I agree about sourceforge. It's been the devil to try keeping my ports up-to-date. Mostly I just wanted you to be aware it was happening. I didn't know ck4up was being used for anything except Windows, my mistake.

Short of adding some kind of configuration setting of OS for ck4up I don't know of any way to address this in ck4up. I can easily make my own port for ck4up and apply a patch to it.

I used Midori for two reasons: it was one of the shorter User-Agent strings at and in-case they were counting browser types I wanted Midori to get some credit as Mozilla gets plenty. They may only be check the platform portion of the string anyway so it might be possible to plug ck4up as well. I haven't experimented with that yet.
Comment by Juergen Daubert (jue) - Tuesday, 14 December 2010, 16:48 GMT
Yeah, currently we have no support for setting important runtime-variables in ck4up's config file. What I've done is using global variables for them and to define them at the top of the script, like Threads_max etc.

If we can add something like "User_agent" that way and, that's most important for me, get it working without any other required changes like adding "/" to all URL that are directories, I'm not opposed to accept your patch for a future release.