All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] combo-layer fixes
@ 2012-03-22 17:15 Paul Eggleton
  2012-03-22 17:15 ` [PATCH 1/2] scripts/combo-layer: limit component repo dirty check Paul Eggleton
  2012-03-22 17:15 ` [PATCH 2/2] scripts/combo-layer: handle diffs in commit messages Paul Eggleton
  0 siblings, 2 replies; 5+ messages in thread
From: Paul Eggleton @ 2012-03-22 17:15 UTC (permalink / raw)
  To: openembedded-core

A couple of fixes for combo-layer. Thanks to Otavio Salvador for testing
the second patch.


The following changes since commit d036265de1d9931bedb660e01a763d3d1d9e4097:

  xserver-kdrive: Fix packaging warnings (2012-03-21 23:17:26 +0000)

are available in the git repository at:
  git://git.openembedded.org/openembedded-core-contrib paule/combo-layer-fixes4
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/combo-layer-fixes4

Paul Eggleton (2):
  scripts/combo-layer: limit component repo dirty check
  scripts/combo-layer: handle diffs in commit messages

 scripts/combo-layer |   56 ++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 47 insertions(+), 9 deletions(-)

-- 
1.7.5.4




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] scripts/combo-layer: limit component repo dirty check
  2012-03-22 17:15 [PATCH 0/2] combo-layer fixes Paul Eggleton
@ 2012-03-22 17:15 ` Paul Eggleton
  2012-03-22 19:44   ` Otavio Salvador
  2012-03-22 17:15 ` [PATCH 2/2] scripts/combo-layer: handle diffs in commit messages Paul Eggleton
  1 sibling, 1 reply; 5+ messages in thread
From: Paul Eggleton @ 2012-03-22 17:15 UTC (permalink / raw)
  To: openembedded-core

If one or more components are specified for update, only check if their
repository/repositories are dirty rather than checking all of the
configured repositories.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 scripts/combo-layer |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/scripts/combo-layer b/scripts/combo-layer
index 7457ba2..3612323 100755
--- a/scripts/combo-layer
+++ b/scripts/combo-layer
@@ -150,15 +150,6 @@ def action_update(conf, args):
         generate the patch list
         apply the generated patches
     """
-    # make sure all repos are clean
-    for name in conf.repos:
-        check_repo_clean(conf.repos[name]['local_repo_dir'])
-    check_repo_clean(os.getcwd())
-
-    import uuid
-    patch_dir = "patch-%s" % uuid.uuid4()
-    os.mkdir(patch_dir)
-
     repos = []
     if len(args) > 1:
         for arg in args[1:]:
@@ -174,6 +165,15 @@ def action_update(conf, args):
     if not repos:
         repos = conf.repos
 
+    # make sure all repos are clean
+    for name in repos:
+        check_repo_clean(conf.repos[name]['local_repo_dir'])
+    check_repo_clean(os.getcwd())
+
+    import uuid
+    patch_dir = "patch-%s" % uuid.uuid4()
+    os.mkdir(patch_dir)
+
     for name in repos:
         repo = conf.repos[name]
         ldir = repo['local_repo_dir']
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] scripts/combo-layer: handle diffs in commit messages
  2012-03-22 17:15 [PATCH 0/2] combo-layer fixes Paul Eggleton
  2012-03-22 17:15 ` [PATCH 1/2] scripts/combo-layer: limit component repo dirty check Paul Eggleton
@ 2012-03-22 17:15 ` Paul Eggleton
  2012-03-22 19:45   ` Otavio Salvador
  1 sibling, 1 reply; 5+ messages in thread
From: Paul Eggleton @ 2012-03-22 17:15 UTC (permalink / raw)
  To: openembedded-core

A few recent commits in the OE-Core repository contain diffs in their
commit messages, which totally confuses git-am when applying them to the
combo repository during update. Add some code to detect and indent any
diff text in the commit message so that this does not happen (and show a
warning).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 scripts/combo-layer |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/scripts/combo-layer b/scripts/combo-layer
index 3612323..73d61cc 100755
--- a/scripts/combo-layer
+++ b/scripts/combo-layer
@@ -144,6 +144,43 @@ def check_repo_clean(repodir):
         logger.error("git repo %s is dirty, please fix it first", repodir)
         sys.exit(1)
 
+def check_patch(patchfile):
+    f = open(patchfile)
+    ln = f.readline()
+    of = None
+    in_patch = False
+    beyond_msg = False
+    pre_buf = ''
+    while ln:
+        if not beyond_msg:
+            if ln == '---\n':
+                if not of:
+                    break
+                in_patch = False
+                beyond_msg = True
+            elif ln.startswith('--- '):
+                # We have a diff in the commit message
+                in_patch = True
+                if not of:
+                    print('WARNING: %s contains a diff in its commit message, indenting to avoid failure during apply' % patchfile)
+                    of = open(patchfile + '.tmp', 'w')
+                    of.write(pre_buf)
+                    pre_buf = ''
+            elif in_patch and not ln[0] in '+-@ \n\r':
+                in_patch = False
+        if of:
+            if in_patch:
+                of.write(' ' + ln)
+            else:
+                of.write(ln)
+        else:
+            pre_buf += ln
+        ln = f.readline()
+    f.close()
+    if of:
+        of.close()
+        os.rename(patchfile + '.tmp', patchfile)
+
 def action_update(conf, args):
     """
         update the component repos
@@ -227,6 +264,7 @@ def action_update(conf, args):
         count=len(revlist)-1
         for patch in patchlist:
             f.write("%s %s\n" % (patch, revlist[count]))
+            check_patch(os.path.join(patch_dir, patch))
             count=count-1
         f.close()
 
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] scripts/combo-layer: limit component repo dirty check
  2012-03-22 17:15 ` [PATCH 1/2] scripts/combo-layer: limit component repo dirty check Paul Eggleton
@ 2012-03-22 19:44   ` Otavio Salvador
  0 siblings, 0 replies; 5+ messages in thread
From: Otavio Salvador @ 2012-03-22 19:44 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

Acked-by: Otavio Salvador <otavio@ossystems.com.br>

On Thu, Mar 22, 2012 at 14:15, Paul Eggleton
<paul.eggleton@linux.intel.com> wrote:
> If one or more components are specified for update, only check if their
> repository/repositories are dirty rather than checking all of the
> configured repositories.
>
> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
> ---
>  scripts/combo-layer |   18 +++++++++---------
>  1 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/scripts/combo-layer b/scripts/combo-layer
> index 7457ba2..3612323 100755
> --- a/scripts/combo-layer
> +++ b/scripts/combo-layer
> @@ -150,15 +150,6 @@ def action_update(conf, args):
>         generate the patch list
>         apply the generated patches
>     """
> -    # make sure all repos are clean
> -    for name in conf.repos:
> -        check_repo_clean(conf.repos[name]['local_repo_dir'])
> -    check_repo_clean(os.getcwd())
> -
> -    import uuid
> -    patch_dir = "patch-%s" % uuid.uuid4()
> -    os.mkdir(patch_dir)
> -
>     repos = []
>     if len(args) > 1:
>         for arg in args[1:]:
> @@ -174,6 +165,15 @@ def action_update(conf, args):
>     if not repos:
>         repos = conf.repos
>
> +    # make sure all repos are clean
> +    for name in repos:
> +        check_repo_clean(conf.repos[name]['local_repo_dir'])
> +    check_repo_clean(os.getcwd())
> +
> +    import uuid
> +    patch_dir = "patch-%s" % uuid.uuid4()
> +    os.mkdir(patch_dir)
> +
>     for name in repos:
>         repo = conf.repos[name]
>         ldir = repo['local_repo_dir']
> --
> 1.7.5.4
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core



-- 
Otavio Salvador                             O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] scripts/combo-layer: handle diffs in commit messages
  2012-03-22 17:15 ` [PATCH 2/2] scripts/combo-layer: handle diffs in commit messages Paul Eggleton
@ 2012-03-22 19:45   ` Otavio Salvador
  0 siblings, 0 replies; 5+ messages in thread
From: Otavio Salvador @ 2012-03-22 19:45 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

Acked-by: Otavio Salvador <otavio@ossystems.com.br>


On Thu, Mar 22, 2012 at 14:15, Paul Eggleton
<paul.eggleton@linux.intel.com> wrote:
> A few recent commits in the OE-Core repository contain diffs in their
> commit messages, which totally confuses git-am when applying them to the
> combo repository during update. Add some code to detect and indent any
> diff text in the commit message so that this does not happen (and show a
> warning).
>
> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
> ---
>  scripts/combo-layer |   38 ++++++++++++++++++++++++++++++++++++++
>  1 files changed, 38 insertions(+), 0 deletions(-)
>
> diff --git a/scripts/combo-layer b/scripts/combo-layer
> index 3612323..73d61cc 100755
> --- a/scripts/combo-layer
> +++ b/scripts/combo-layer
> @@ -144,6 +144,43 @@ def check_repo_clean(repodir):
>         logger.error("git repo %s is dirty, please fix it first", repodir)
>         sys.exit(1)
>
> +def check_patch(patchfile):
> +    f = open(patchfile)
> +    ln = f.readline()
> +    of = None
> +    in_patch = False
> +    beyond_msg = False
> +    pre_buf = ''
> +    while ln:
> +        if not beyond_msg:
> +            if ln == '---\n':
> +                if not of:
> +                    break
> +                in_patch = False
> +                beyond_msg = True
> +            elif ln.startswith('--- '):
> +                # We have a diff in the commit message
> +                in_patch = True
> +                if not of:
> +                    print('WARNING: %s contains a diff in its commit message, indenting to avoid failure during apply' % patchfile)
> +                    of = open(patchfile + '.tmp', 'w')
> +                    of.write(pre_buf)
> +                    pre_buf = ''
> +            elif in_patch and not ln[0] in '+-@ \n\r':
> +                in_patch = False
> +        if of:
> +            if in_patch:
> +                of.write(' ' + ln)
> +            else:
> +                of.write(ln)
> +        else:
> +            pre_buf += ln
> +        ln = f.readline()
> +    f.close()
> +    if of:
> +        of.close()
> +        os.rename(patchfile + '.tmp', patchfile)
> +
>  def action_update(conf, args):
>     """
>         update the component repos
> @@ -227,6 +264,7 @@ def action_update(conf, args):
>         count=len(revlist)-1
>         for patch in patchlist:
>             f.write("%s %s\n" % (patch, revlist[count]))
> +            check_patch(os.path.join(patch_dir, patch))
>             count=count-1
>         f.close()
>
> --
> 1.7.5.4
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core



-- 
Otavio Salvador                             O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-03-22 19:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-22 17:15 [PATCH 0/2] combo-layer fixes Paul Eggleton
2012-03-22 17:15 ` [PATCH 1/2] scripts/combo-layer: limit component repo dirty check Paul Eggleton
2012-03-22 19:44   ` Otavio Salvador
2012-03-22 17:15 ` [PATCH 2/2] scripts/combo-layer: handle diffs in commit messages Paul Eggleton
2012-03-22 19:45   ` Otavio Salvador

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.