Skip to contentSkip to conversation

scripts/combo-layer: specify branch when getting current revision

PATCH Applied Paul Eggleton 2 participants 2 messages Aug 21, 2012 – Aug 24, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts/combo-layer: specify branch when getting current revision

Handle the case during update where the configured branch is not currently checked out in the component repository by just specifying it in the places where it was not previously.

---
 scripts/combo-layer |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
scripts/combo-layer +3 -2
index 448fe71..330faca 100755
@@ -191,7 +191,7 @@ def action_init(conf, args):
             branch = repo.get('branch', "master")
             file_filter = repo.get('file_filter', "")
             runcmd("git archive %s | tar -x -C %s %s" % (branch, extract_dir, file_filter), ldir)
-            lastrev = runcmd("git rev-parse HEAD", ldir).strip()
+            lastrev = runcmd("git rev-parse %s" % branch, ldir).strip()
             conf.update(name, "last_revision", lastrev, initmode=True)
         runcmd("git add .")
         if conf.localconffile:
@@ -475,7 +475,8 @@ def apply_patchlist(conf, repos):
         else:
             logger.info("No patches to apply from %s" % name)
             ldir = conf.repos[name]['local_repo_dir']
-            lastrev = runcmd("git rev-parse HEAD", ldir).strip()
+            branch = conf.repos[name].get('branch', "master")
+            lastrev = runcmd("git rev-parse %s" % branch, ldir).strip()
 
         if lastrev != repo['last_revision']:
             conf.update(name, "last_revision", lastrev)
Signature · 1 line
1.7.9.5
Applied
#1 lore raw
Quoted 24 lines · Paul Eggleton

Handle the case during update where the configured branch is not currently checked out in the component repository by just specifying it in the places where it was not previously.

---
  scripts/combo-layer |    5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
scripts/combo-layer +1 -1
index 448fe71..330faca 100755
@@ -191,7 +191,7 @@ def action_init(conf, args):
              branch = repo.get('branch', "master")
              file_filter = repo.get('file_filter', "")
              runcmd("git archive %s | tar -x -C %s %s" % (branch, extract_dir, file_filter), ldir)
-            lastrev = runcmd("git rev-parse HEAD", ldir).strip()
+            lastrev = runcmd("git rev-parse %s" % branch, ldir).strip()
              conf.update(name, "last_revision", lastrev, initmode=True)
          runcmd("git add .")
          if conf.localconffile:

scripts/combo-layer def apply_patchlist(conf, repos): · line 482

Quoted 9 lines
scripts/combo-layer +2 -1
@@ -475,7 +475,8 @@ def apply_patchlist(conf, repos):
          else:
              logger.info("No patches to apply from %s" % name)
              ldir = conf.repos[name]['local_repo_dir']
-            lastrev = runcmd("git rev-parse HEAD", ldir).strip()
+            branch = conf.repos[name].get('branch', "master")
+            lastrev = runcmd("git rev-parse %s" % branch, ldir).strip()
 
          if lastrev != repo['last_revision']:
              conf.update(name, "last_revision", lastrev)

Merged into OE-Core

Thanks
Sau!