Mailinglist Archive: opensuse-buildservice (311 mails)
| < Previous | Next > |
[opensuse-buildservice] [patch] [osc] Fallback to plain file, if cpio download isn't available.
- From: "Jan-Simon Möller" <dl9pf@xxxxxx>
- Date: Mon, 9 Nov 2009 15:20:02 +0100
- Message-id: <200911091520.02768.dl9pf@xxxxxx>
Hi !
The new cpio file query needs a fallback option in case of the api being an
_old_ api .
This is really needed - just think of migration scenarios and for backward
compatibility.
I hacked up a patch and would like to append it for comments from our osc
experts.
Best,
Jan-Simon
Index: fetch.py
===================================================================
--- fetch.py (Revision 8854)
+++ fetch.py (Arbeitskopie)
@@ -184,6 +184,14 @@
pac = pkgs[hdr.filename.rsplit('.', 1)[0]]
archive.copyin_file(hdr.filename,
os.path.dirname(tmpfile), os.path.basename(tmpfile))
self.move_package(tmpfile, pac.localdir, pac)
+ except URLGrabError, e:
+ #retry without cpio for compatibility - please also think of
migration scenarios and stay compatible !
+ for mynext in pkgs.keys():
+ url = makeurl(buildinfo.apiurl,
+ ['build', project, repo,
buildinfo.buildarch, '_repository', mynext])
+ self.gr.urlgrab(url, filename = tmpfile, text = 'fetching
file \'%s\' for \'%s\'' % (mynext, project))
+ pac = pkgs[mynext]
+ self.move_package(tmpfile, pac.localdir, pac)
finally:
if os.path.exists(tmparchive):
os.unlink(tmparchive)
Index: fetch.py
===================================================================
--- fetch.py (Revision 8854)
+++ fetch.py (Arbeitskopie)
@@ -184,6 +184,14 @@
pac = pkgs[hdr.filename.rsplit('.', 1)[0]]
archive.copyin_file(hdr.filename,
os.path.dirname(tmpfile), os.path.basename(tmpfile))
self.move_package(tmpfile, pac.localdir, pac)
+ except URLGrabError, e:
+ #retry without cpio for compatibility - please also think of
migration scenarios and stay compatible !
+ for mynext in pkgs.keys():
+ url = makeurl(buildinfo.apiurl,
+ ['build', project, repo,
buildinfo.buildarch, '_repository', mynext])
+ self.gr.urlgrab(url, filename = tmpfile, text = 'fetching
file \'%s\' for \'%s\'' % (mynext, project))
+ pac = pkgs[mynext]
+ self.move_package(tmpfile, pac.localdir, pac)
finally:
if os.path.exists(tmparchive):
os.unlink(tmparchive)
The new cpio file query needs a fallback option in case of the api being an
_old_ api .
This is really needed - just think of migration scenarios and for backward
compatibility.
I hacked up a patch and would like to append it for comments from our osc
experts.
Best,
Jan-Simon
Index: fetch.py
===================================================================
--- fetch.py (Revision 8854)
+++ fetch.py (Arbeitskopie)
@@ -184,6 +184,14 @@
pac = pkgs[hdr.filename.rsplit('.', 1)[0]]
archive.copyin_file(hdr.filename,
os.path.dirname(tmpfile), os.path.basename(tmpfile))
self.move_package(tmpfile, pac.localdir, pac)
+ except URLGrabError, e:
+ #retry without cpio for compatibility - please also think of
migration scenarios and stay compatible !
+ for mynext in pkgs.keys():
+ url = makeurl(buildinfo.apiurl,
+ ['build', project, repo,
buildinfo.buildarch, '_repository', mynext])
+ self.gr.urlgrab(url, filename = tmpfile, text = 'fetching
file \'%s\' for \'%s\'' % (mynext, project))
+ pac = pkgs[mynext]
+ self.move_package(tmpfile, pac.localdir, pac)
finally:
if os.path.exists(tmparchive):
os.unlink(tmparchive)
Index: fetch.py
===================================================================
--- fetch.py (Revision 8854)
+++ fetch.py (Arbeitskopie)
@@ -184,6 +184,14 @@
pac = pkgs[hdr.filename.rsplit('.', 1)[0]]
archive.copyin_file(hdr.filename,
os.path.dirname(tmpfile), os.path.basename(tmpfile))
self.move_package(tmpfile, pac.localdir, pac)
+ except URLGrabError, e:
+ #retry without cpio for compatibility - please also think of
migration scenarios and stay compatible !
+ for mynext in pkgs.keys():
+ url = makeurl(buildinfo.apiurl,
+ ['build', project, repo,
buildinfo.buildarch, '_repository', mynext])
+ self.gr.urlgrab(url, filename = tmpfile, text = 'fetching
file \'%s\' for \'%s\'' % (mynext, project))
+ pac = pkgs[mynext]
+ self.move_package(tmpfile, pac.localdir, pac)
finally:
if os.path.exists(tmparchive):
os.unlink(tmparchive)
| < Previous | Next > |