[gnome-ostree] build: Fix using local: for patches
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-ostree] build: Fix using local: for patches
- Date: Fri, 8 Mar 2013 18:46:41 +0000 (UTC)
commit 714cdacde1af2176e253b7aff1bb05d47ec2f2ad
Author: Colin Walters <walters verbum org>
Date: Fri Mar 8 13:46:24 2013 -0500
build: Fix using local: for patches
src/js/tasks/task-build.js | 1 +
src/js/vcs.js | 28 ++++++++++++----------------
2 files changed, 13 insertions(+), 16 deletions(-)
---
diff --git a/src/js/tasks/task-build.js b/src/js/tasks/task-build.js
index 460d1bd..fd82fcb 100644
--- a/src/js/tasks/task-build.js
+++ b/src/js/tasks/task-build.js
@@ -432,6 +432,7 @@ const TaskBuild = new Lang.Class({
this.patchdir,
expandedComponent,
cancellable);
+ this.patchdir = patchdir;
this._cachedPatchdirRevision = patchesRevision;
}
if ((previousMetadata != null) &&
diff --git a/src/js/vcs.js b/src/js/vcs.js
index bd466e1..efb332a 100644
--- a/src/js/vcs.js
+++ b/src/js/vcs.js
@@ -118,24 +118,20 @@ function parseSrcKey(srckey) {
return [keytype, uri];
}
-function checkoutPatches(mirrordir, patchdir, component, cancellable, params) {
- params = Params.parse(params, { patchesPath: null });
+function checkoutPatches(mirrordir, patchdir, component, cancellable) {
let patches = component['patches'];
- let patches_keytype = null;
- let patches_uri = null;
- if (params.patchesPath != null) {
- patches_keytype = local;
- patches_uri = patches_path;
- patchdir = patches_uri;
- } else {
- [patches_keytype, patches_uri] = parseSrcKey(patches['src']);
- let patchesMirror = getMirrordir(mirrordir, patches_keytype, patches_uri);
- getVcsCheckout(mirrordir, patches_keytype, patches_uri,
- patchdir, patches['revision'], cancellable,
- {overwrite: true,
- quiet: true});
- }
+ let [patchesKeytype, patchesUri] = parseSrcKey(patches['src']);
+ if (patchesKeytype == 'local')
+ return Gio.File.new_for_path(patchesUri);
+ else if (patchesKeytype != 'git')
+ throw new Error("Unhandled keytype " + patchesKeytype);
+
+ let patchesMirror = getMirrordir(mirrordir, patchesKeytype, patchesUri);
+ getVcsCheckout(mirrordir, patchesKeytype, patchesUri,
+ patchdir, patches['revision'], cancellable,
+ {overwrite: true,
+ quiet: true});
return patchdir;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]