Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved-sorta] Automagic wget for sourceforge?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
eddieparker
Tux's lil' helper
Tux's lil' helper


Joined: 09 Sep 2004
Posts: 147

PostPosted: Thu Jan 03, 2008 5:36 am    Post subject: [solved-sorta] Automagic wget for sourceforge? Reply with quote

Hey!

This is kind of an "out there" question, but I've asked such things before and the community has come back with some interesting answers... so I thought I'd give it a try. :)

Anyone know of a utility that I can use from the command line to download files from sourceforge? I traditionally go to the website (from my WinXP computer) and navigate to the mirror, find the direct download link, cuss and hyperventilate at the auto-download that's starting, and then copy paste that to wget on my server.

I was hoping there'd be something easier, like "wget --sourceforge-style http://someproject.sourceforge.net/downloads/downloadfile.tgz", and it either auto-picks the closest mirror, or I specify it somewhere.

Anyone heard of something like this, or am I just dreaming?


Thanks!

-e-


Last edited by eddieparker on Sat Jan 05, 2008 1:59 am; edited 1 time in total
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Thu Jan 03, 2008 10:08 am    Post subject: Reply with quote

Arch Linux uses in tons of packages:
Code:
source=(http://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}-${pkgver}.tar.bz2)

Which equates to:
Code:
wget http://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}-${pkgver}.tar.bz2
Back to top
View user's profile Send private message
marschw
n00b
n00b


Joined: 04 Jun 2003
Posts: 51

PostPosted: Fri Jan 04, 2008 10:27 pm    Post subject: Re: Automagic wget for sourceforge? Reply with quote

eddieparker wrote:
I was hoping there'd be something easier, like "wget --sourceforge-style http://someproject.sourceforge.net/downloads/downloadfile.tgz", and it either auto-picks the closest mirror, or I specify it somewhere.


The http://someproject.sourceforge.net/ urls have nothing to do with sourceforge's servers, aside from the domain name. So downloads on them wouldn't need anything special.

Assuming you meant files from the download pages on sourceforge itself (e.g. the d2vsource_20030603.zip link on the page at http://sourceforge.net/project/showfiles.php?group_id=82303&package_id=84801&release_id=163321 ), if you copy that link and paste it into wget (in this case, http://downloads.sourceforge.net/guliverkli/d2vsource_20030603.zip?modtime=1054598400&big_mirror=0 ), it'll properly download via wget, since those pages issue a 302 redirect. Of course, be sure to enclose the url in quotes on account of the special characters in it. For example:
Code:
wget 'http://downloads.sourceforge.net/guliverkli/d2vsource_20030603.zip?modtime=1054598400&big_mirror=0'

will properly download d2vsource_20030603.zip.
Back to top
View user's profile Send private message
Nick C
Guru
Guru


Joined: 18 Mar 2005
Posts: 526
Location: Portsmouth, England

PostPosted: Fri Jan 04, 2008 10:30 pm    Post subject: Reply with quote

if you know any python you could nose around the portage code that handles this as if you look in any ebuild that uses a sf host they have a special way of handling it, which appears similar to what you want i think, perhaps you could borrow/base a program on that to do what you need?
_________________
Please add [solved] to the initial post's subject line if you feel your problem is resolved.
www.monkeydust.net
Back to top
View user's profile Send private message
eddieparker
Tux's lil' helper
Tux's lil' helper


Joined: 09 Sep 2004
Posts: 147

PostPosted: Sat Jan 05, 2008 1:58 am    Post subject: Reply with quote

Quote:

Arch Linux uses in tons of packages:
Code:
source=(http://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}-${pkgver}.tar.bz2)

Which equates to:
Code:
wget http://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}-${pkgver}.tar.bz2


Hrmm, allowing that works universally, scripting that shouldn't be too bad. I'll give that a try soon.

Quote:

Assuming you meant files from the download pages on sourceforge itself (e.g. the d2vsource_20030603.zip link on the page at http://sourceforge.net/project/showfiles.php?group_id=82303&package_id=84801&release_id=163321 ), if you copy that link and paste it into wget (in this case, http://downloads.sourceforge.net/guliverkli/d2vsource_20030603.zip?modtime=1054598400&big_mirror=0 ), it'll properly download via wget, since those pages issue a 302 redirect. Of course, be sure to enclose the url in quotes on account of the special characters in it. For example:


Hrmm, interesting. I forgot I can get it from the mainpage. Seeing as how I have to see what downloads there are, that might be the 'easiest' I can make it.

Quote:

if you know any python you could nose around the portage code that handles this as if you look in any ebuild that uses a sf host they have a special way of handling it, which appears similar to what you want i think, perhaps you could borrow/base a program on that to do what you need?


That's essentially what I was after, but after thinking about marschw's post, I realize there's no easy way to divine what version number I want - and determining it would . I suppose if I could do something like "sfwget.sh [package name]" and have it auto-determine the latest version number, I might revisit this script. We'll see. Any ideas on how to do so would be appreciated. :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum