aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKylie McClain <somasissounds@gmail.com>2015-02-19 01:54:46 -0500
committerKylie McClain <somasissounds@gmail.com>2015-02-19 01:54:46 -0500
commit0b1263a9914e3dde9787b58641193d99341b1000 (patch)
tree6a733032187fd1cf5c2ee407dcd3800fbfd76cac
parentfe3ea3a5e441ebbaa305bfaa563d8f2860c663b4 (diff)
downloadclang-compat-utils-0b1263a9914e3dde9787b58641193d99341b1000.tar.gz
clang-compat-utils-0b1263a9914e3dde9787b58641193d99341b1000.tar.xz
clang-compat-utils-0b1263a9914e3dde9787b58641193d99341b1000.zip
clang-blacklist: we should check for dupes before writing it :)
-rwxr-xr-xclang-blacklist12
1 files changed, 6 insertions, 6 deletions
diff --git a/clang-blacklist b/clang-blacklist
index fe3909b..926584a 100755
--- a/clang-blacklist
+++ b/clang-blacklist
@@ -23,19 +23,19 @@ fi
temp=$(mktemp)
for pkg in $@;do
- if [[ "$pkg" != */* ]];then
+ if [[ "$pkg" != *'/'* ]] && [[ "$pkg" != */*-* ]] && [[ "$pkg" != */*:* ]] && [[ "$pkg" != */*-*:* ]];then
echo "\"$pkg\" isn't in the right format. category/pn, category/pn-pv, category/pn:slot, category/pn-pv:slot."
exit 3
fi
+ if grep -q "^$pkg$" "$packages_gcc";then
+ echo "\"$pkg\" already exists in packages.gcc."
+ exit 4
+ fi
echo "$pkg" >> "$packages_gcc" || exit 2
sort -ud "$packages_gcc" > "$temp"
yes | mv "$temp" "$packages_gcc" || :
cd "$(dirname $packages_gcc)"
- if grep -q "$pkg" "$packages_gcc";then
- echo "\"$pkg\" already exists in packages.gcc."
- else
- git commit -m "clang-compat: add $pkg to packages.gcc" -v packages.gcc
- fi
+ git commit -m "clang-compat: add $pkg to packages.gcc" -v packages.gcc
done
rm -f "$temp" >/dev/null 2>&1