]> git.e2factory.org Git - e2factory.git/commitdiff
fix e2-install-e2 to install branches properly
authorGordon Hecker <gh@emlix.com>
Tue, 23 Jun 2009 09:44:26 +0000 (11:44 +0200)
committerGordon Hecker <gh@emlix.com>
Fri, 2 Oct 2009 10:39:02 +0000 (12:39 +0200)
Signed-off-by: Gordon Hecker <gh@emlix.com>
Changelog
doc/manual/basic.text
global/e2-install-e2.lua.in

index f03740668645bbe8dd3dbf7c0b66c2b9965bdb1d..dc6b4aa48b5a4f77ddce7c59ac0de530561b2614 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -1,5 +1,6 @@
 NEXT:
  * temporary build directories are located in a version specific directory now
+ * e2-install-e2 installs branches properly now. Git refs can be specified.
 
 e2factory-2.3.1
  * bugfixes
index 53d1273eefbee448ddcb1cb289cf0aed7cb8641a..305fb0524a9c1b8a5e7d4c0b491a6063a1c58309 100644 (file)
@@ -25,7 +25,9 @@ Example:
 
     2_3_0
 
-.e2/extensions holds a table specifying a list of extensions.
+.e2/extensions holds a table specifying a list of extensions. The ref
+must be a valid git ref. If the string has a '/' the ref is passed to
+git as-is, otherwise it is translated into a tag by prepending 'refs/tags/'
 
 Example:
 
index bc3fe1fc56736f27af753b9d43a05b307427043e..b7f2ab92cd6dbfe6b839cc54e6e0316506cafeb7 100755 (executable)
@@ -122,7 +122,11 @@ end
 local ref
 if tag == "^" then
   e2lib.warnf("WOTHER", "using e2 version by branch")
-  ref = string.format("refs/heads/%s", branch)
+  if branch:match("/") then
+    ref = branch
+  else
+    ref = string.format("remotes/origin/%s", branch)
+  end
 else
   ref = string.format("refs/tags/%s", tag)
 end
@@ -146,8 +150,7 @@ end
 e2lib.chdir(destdir)
 
 -- checkout ref
-local args = string.format("--track -b tmp '%s'", ref)
-rc, re = e2lib.git(nil, "checkout", args)
+rc, re = e2lib.git(nil, "checkout", ref)
 if not rc then
   e2lib.abort(e:cat(re))
 end
@@ -158,7 +161,13 @@ for _,ex in ipairs(extensions) do
   if not rc then
     e2lib.abort(e:cat(re))
   end
-  e2lib.logf(2, "fetching extension: %s (tag %s)", ex.name, ex.ref)
+  local ref
+  if ex.ref:match("/") then
+    ref = ex.ref
+  else
+    ref = string.format("refs/tags/%s", ex.ref)
+  end
+  e2lib.logf(2, "fetching extension: %s (%s)", ex.name, ref)
   local server = config.site.e2_server
   local location = string.format("%s/%s.git", config.site.e2_base, ex.name)
   local destdir = ex.name
@@ -175,8 +184,7 @@ for _,ex in ipairs(extensions) do
   e2lib.chdir(destdir)
 
   -- checkout ref
-  local args = string.format("--track -b tmp '%s'", ex.ref)
-  rc, re = e2lib.git(nil, "checkout", args)
+  rc, re = e2lib.git(nil, "checkout", ref)
   if not rc then
     e2lib.abort(e:cat(re))
   end