ftp.gnome.org switched to .xz only, trying to handle that
This commit is contained in:
parent
efce501b5f
commit
762d51b2b0
14
src/lgo.py
14
src/lgo.py
|
@ -104,7 +104,9 @@ class FtpDotGnomeDotOrg:
|
|||
latest_base = '%s-%s.' % (module_name, latest_version[0].split('-')[-1])
|
||||
new_basename = [x for x in os.listdir(dirname) if \
|
||||
x.startswith(latest_base) and (
|
||||
x.endswith('.tar.gz') or x.endswith('.tar.bz2'))]
|
||||
x.endswith('.tar.gz') or
|
||||
x.endswith('.tar.bz2') or
|
||||
x.endswith('.tar.xz'))]
|
||||
if new_basename:
|
||||
local_filename = os.path.join(dirname, new_basename[0])
|
||||
logging.debug('using %s instead of %s' % (new_basename[0], basename))
|
||||
|
@ -301,7 +303,12 @@ class Lgo(App):
|
|||
filenames = self.ftp_gnome_org.listdir(base_version_href)
|
||||
filenames = [x for x in filenames if \
|
||||
x.startswith(module + '-%s.' % version_dir) and \
|
||||
x.endswith('.tar.bz2')]
|
||||
x.endswith('.tar.xz')]
|
||||
if not filenames:
|
||||
# not .xz, fallback to .bz2
|
||||
filenames = [x for x in filenames if \
|
||||
x.startswith(module + '-%s.' % version_dir) and \
|
||||
x.endswith('.tar.bz2')]
|
||||
def filenames_cmp(x, y):
|
||||
return version_cmp(x[len(module)+1:-8], y[len(module)+1:-8])
|
||||
filenames.sort(filenames_cmp)
|
||||
|
@ -580,7 +587,8 @@ class Lgo(App):
|
|||
def process_nightly_tarballs(self):
|
||||
logging.info('processing nightly tarballs')
|
||||
for filename in os.listdir(self.config.nightly_tarballs_location):
|
||||
if not (filename.endswith('.tar.gz') or filename.endswith('.tar.bz2')):
|
||||
if not (filename.endswith('.tar.gz') or filename.endswith('.tar.bz2') or
|
||||
filename.endswith('.tar.xz')):
|
||||
continue
|
||||
filename = os.path.join(self.config.nightly_tarballs_location, filename)
|
||||
for doc_module in self.extract_modules(filename, nightly = True):
|
||||
|
|
Reference in New Issue