[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[RFC] fixing sourceforge watch files

we have had a little trouble with our sf redirector a while back (i.e. the
sf mirror was down) and it is really annoying.
Anyhow, I noticed that there are now direct links with http 302 redirection
towards a mirror, without the ugly selection page!

example: [not wrapped at 80 columns, sorry]

$ wget -O/dev/null 'http://downloads.sourceforge.net/vde/vdetelweb-1.1a.tar.gz?big_mirror=0'
--2008-06-17 17:25:22--  http://downloads.sourceforge.net/vde/vdetelweb-1.1a.tar.gz?big_mirror=0
Resolving downloads.sourceforge.net...
Connecting to downloads.sourceforge.net||:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://ufpr.dl.sourceforge.net/sourceforge/vde/vdetelweb-1.1a.tar.gz [following]
--2008-06-17 17:25:22--  http://ufpr.dl.sourceforge.net/sourceforge/vde/vdetelweb-1.1a.tar.gz
Resolving ufpr.dl.sourceforge.net...
Connecting to ufpr.dl.sourceforge.net||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 93880 (92K) [application/x-gzip]
Saving to: `/dev/null'

100%[=========================================================================================>] 93,880      58.1K/s   in 1.6s    

2008-06-17 17:25:25 (58.1 KB/s) - `/dev/null' saved [93880/93880]

this leads to an almost straightforward watch file: (note the trailing .*)

http://sf.net/project/showfiles.php?group_id=95403 http://downloads.sourceforge.net/vde/vdetelweb-(.*)\.tar\.gz.*

which in turn gives:

$ uscan --destdir ../tarballs --rename --verbose --force
-- Scanning for watchfiles in .
-- Found watchfile in ./debian
-- In debian/watch, processing watchfile line:
   http://sourceforge.net/project/showfiles.php?group_id=95403 http://downloads.sourceforge.net/vde/vdetelweb-(.*)\.tar\.gz.*
-- Found the following matching hrefs:
Newest version on remote site is 1.1a, local version is 1.1a
 => Package is up to date
Newest version on remote site is 1.1a, local version is 1.1a
 => vdetelweb_1.1a.orig.tar.gz already in package directory '../tarballs'
-- Scan finished

I'm attaching a quick patch to uscan(1) to give some instructions on how to
produce a working watch file, hopefully to get rid of the hacky redirector.

comments welcome,
Filippo Giunchedi - http://esaurito.net
PGP key: 0x6B79D401
random quote follows:

What a strange illusion it is to suppose that beauty is goodness.
-- Lev Tolstoj
Index: uscan.1
--- uscan.1	(revision 1508)
+++ uscan.1	(working copy)
@@ -68,13 +68,18 @@
-# If your package is located on sourceforge, use one of the following
-# formats to automatically use the qa.debian.org redirector, avoiding
-# SF's difficult mirror system.
+# If your package is located on sourceforge, go to the project page, then to
+# "download" and "browse all files". The resulting URL containing "group_id"
+# should be used as the first part, the second part should capture the full URL
+# together with version number plus any trailing character.
+# Example for audacity:
+# project page: http://sourceforge.net/projects/audacity/
+# download page: http://sourceforge.net/project/showfiles.php?group_id=6235
+# full download URL: http://downloads.sourceforge.net/audacity/audacity-src-1.2.6.tar.gz?modtime=1163635022&big_mirror=0
+# results in (note the trailing .+ to match after the ?)
+http://sourceforge.net/project/showfiles.php?group_id=6235 \ 
+	http://downloads.sourceforge.net/audacity/audacity-src-(.+)\.tar\.gz.+
-http://sf.net/audacity/ audacity-src-(.+)\\.tar\\.gz
 # If the qa.debian.org redirector does not produce any results for
 # your sourceforge-hosted project, you can use the following format
 # to check for new versions.  Note that it does not seem to be

Attachment: signature.asc
Description: Digital signature

Reply to: