summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gentoo.org>2021-02-24 19:04:02 -0500
committerMatt Turner <mattst88@gentoo.org>2021-02-24 19:05:56 -0500
commit6e85d8a770ebc9f00e53a61cdd098caefeb3cbbf (patch)
tree66f0c95ffaad84cdd80264445d8904607ce61335 /bin
parentbcb81589c94c416aa460100092f1c2c76c013a93 (diff)
downloadgentoolkit-6e85d8a770ebc9f00e53a61cdd098caefeb3cbbf.tar.gz
bin: Handle case of no KEYWORD removals
Signed-off-by: Matt Turner <mattst88@gentoo.org>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/merge-driver-ekeyword9
1 files 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)