Mailinglist Archive: opensuse-packaging (250 mails)

< Previous Next >
Re: [opensuse-packaging] Packages that need a new maintainer
  • From: Vincent Untz <vuntz@xxxxxxxxxxxx>
  • Date: Fri, 21 Aug 2009 11:16:04 +0200
  • Message-id: <20090821091604.GU14766@xxxxxxxxx>
Le vendredi 21 août 2009, à 08:02 +0200, Cristian Morales Vega a écrit :
Cannot download
http://www.bunkus.org/videotools/mkvtoolnix/sources/?path=&download=mkvtoolnix-2.9.8.tar.bz2:
no basename in URL.

Ah, interesting case. I've committed a workaround to git. You can apply
the patch locally, if you want (see attachment).

Vincent

--
Les gens heureux ne sont pas pressés.
From f1564a7891b6a3e24d498fd98620cca7d7ebd7fe Mon Sep 17 00:00:00 2001
From: Vincent Untz <vuntz@xxxxxxxxxx>
Date: Fri, 21 Aug 2009 11:11:28 +0200
Subject: [PATCH] [osc-gnome] Improve upstream tarball basename detection in
'upstream'

When the basename of the upstream tarball is not in the URL, but in the
query fields, we can try to guess it.

Note that this is only a workaround since we should get this information
from download-upstream-versions (via the database).
---
obs-dissector/osc-gnome.py | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/obs-dissector/osc-gnome.py b/obs-dissector/osc-gnome.py
index a02b31c..6b86511 100644
--- a/obs-dissector/osc-gnome.py
+++ b/obs-dissector/osc-gnome.py
@@ -1474,7 +1474,19 @@ def _gnome_download_internal(self, url, dest_dir):

parsed_url = urlparse.urlparse(url)
basename = os.path.basename(parsed_url.path)
- if basename == '':
+ if not basename:
+ # FIXME: workaround until we get a upstream_basename property for each
+ # package (would be needed for upstream hosted on sf, anyway).
+ # Currently needed for mkvtoolnix.
+ for field in parsed_url.query.split('&'):
+ try:
+ (key, value) = field.split('=', 1)
+ except ValueError:
+ value = field
+ if value.endswith('.gz') or value.endswith('.tgz') or
value.endswith('.bz2'):
+ basename = os.path.basename(value)
+
+ if not basename:
raise self.OscGnomeDownloadError('Cannot download %s: no basename in
URL.' % url)

dest_file = os.path.join(dest_dir, basename)
--
1.6.3.3

< Previous Next >