From 24376a983b9034550c7a661bf46bb8e3e782c63d Mon Sep 17 00:00:00 2001 From: Xenhat Hex Date: Sun, 3 May 2020 14:38:43 -0400 Subject: [PATCH 1/2] add remove-version-match script --- src/remove-version-match | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 src/remove-version-match diff --git a/src/remove-version-match b/src/remove-version-match new file mode 100755 index 0000000..1becc67 --- /dev/null +++ b/src/remove-version-match @@ -0,0 +1,13 @@ +#!/bin/sh +# Author: xenhat +# Description: A script to remove explicit version match in portage configuration files. +# Developed for /etc/portage/package.accept_keywords, may or may not +# not work onther files. +# +if [ -z $1 ]; then + echo "Must specify a file to modify..." + exit 1 +fi +regex='^=?(\S+)(?:-[[:digit:]]+\S*)(\s)(\S+)$' +sub='\1\2\3' +perl -pe "s;$regex;$sub;gm" -i "${1}" From 89b23b53420b2be5c0496ffcd377b8ab3c3be554 Mon Sep 17 00:00:00 2001 From: Xenhat Hex Date: Sun, 3 May 2020 14:43:27 -0400 Subject: [PATCH 2/2] remove-version-match: fix warnings --- src/remove-version-match | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/remove-version-match b/src/remove-version-match index 1becc67..61da46f 100755 --- a/src/remove-version-match +++ b/src/remove-version-match @@ -4,7 +4,7 @@ # Developed for /etc/portage/package.accept_keywords, may or may not # not work onther files. # -if [ -z $1 ]; then +if [ -z "$1" ]; then echo "Must specify a file to modify..." exit 1 fi