commit:     6e85d8a770ebc9f00e53a61cdd098caefeb3cbbf
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 25 00:04:02 2021 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Thu Feb 25 00:05:56 2021 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=6e85d8a7

bin: Handle case of no KEYWORD removals

Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 bin/merge-driver-ekeyword | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/bin/merge-driver-ekeyword b/bin/merge-driver-ekeyword
index 2df83fc..d24aaf9 100755
--- a/bin/merge-driver-ekeyword
+++ b/bin/merge-driver-ekeyword
@@ -93,10 +93,11 @@ def apply_keyword_changes(ebuild: str, pathname: str,
 
         for removals, additions in changes:
             args = []
-            for rem in removals:
-                # Drop leading '~' and '-' characters and prepend '^'
-                i = 1 if rem[0] in ('~', '-') else 0
-                args.append('^' + rem[i:])
+            if removals:
+                for rem in removals:
+                    # Drop leading '~' and '-' characters and prepend '^'
+                    i = 1 if rem[0] in ('~', '-') else 0
+                    args.append('^' + rem[i:])
             if additions:
                 args.extend(additions)
             args.append(ebuild_symlink)

Reply via email to