summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xneuesPerlPaket49
-rw-r--r--perlSubstitutionen12
2 files changed, 23 insertions, 38 deletions
diff --git a/neuesPerlPaket b/neuesPerlPaket
index 05d43045..8ddcf769 100755
--- a/neuesPerlPaket
+++ b/neuesPerlPaket
@@ -6,42 +6,16 @@ then
exit 1
fi
-declare -A substitutionen
-
-substitutionen["perl"]="%skip"
-substitutionen["b"]="%skip"
-substitutionen["strict"]="%skip"
-substitutionen["warnings"]="%skip"
-substitutionen["ipc-open3"]="%skip"
-substitutionen["filehandle"]="%skip"
-substitutionen["file-glob"]="%skip"
-substitutionen["file-find"]="%skip"
-
-substitutionen["moo-role"]="moo"
-
-substitutionen["test-more"]="test-simple"
-substitutionen["test-builder"]="test-simple"
-substitutionen["test-builder-tester"]="test-simple"
-
-substitutionen["http-headers"]="http-message"
-substitutionen["http-request-common"]="http-message"
-
-substitutionen["io-file"]="io"
-substitutionen["io-handle"]="io"
-
-substitutionen["file-spec-functions"]="pathtools"
-substitutionen["file-spec"]="pathtools"
-
-substitutionen["list-util"]="scalar-list-utils"
-substitutionen["scalar-util"]="scalar-list-utils"
-
-substitutionen["pod-coverage-countparents"]="pod-coverage"
-
-substitutionen["pod-find"]="pod-parser"
-
-substitutionen["pod-eventual-simple"]="pod-eventual"
-
-substitutionen["compress-zlib"]="io-compress"
+substituiere() {
+ erg="$(
+ cat "$(dirname "${me}")/perlSubstitutionen" | \
+ sed 's|#.*$||' | \
+ grep "\s$1\(\s\|\$\)" | \
+ cut -d ':' -f 1
+ )"
+ [ -z "${erg}" ] && erg="$1"
+ key="${erg}"
+}
cpanName="$(echo "$1" | sed 's|::|-|g')"
url="https://metacpan.org/release/${cpanName}"
@@ -116,8 +90,7 @@ do
sed "s|::|-|g" | \
tr "[[:upper:]]" "[[:lower:]]"
)"
- [ -n "${substitutionen["${key}"]}" ] && \
- key="${substitutionen["${key}"]}"
+ substituiere "${key}"
[ "${key}" == "%skip" ] && continue
diff --git a/perlSubstitutionen b/perlSubstitutionen
new file mode 100644
index 00000000..4934f9d5
--- /dev/null
+++ b/perlSubstitutionen
@@ -0,0 +1,12 @@
+%skip: perl b strict warnings ipc-open3 filehandle file-glob file-find
+yaml-syck: json-syck
+moo: moo-role
+test-simple: test-more test-builder test-builder-tester
+http-message: http-headers http-request-common
+io: io-file io-handle
+pathtools: file-spec-functions file-spec
+scalar-list-utils: list-util scalar-util
+pod-coverage: pod-coverage-countparents
+pod-parser: pod-find
+pod-eventual: pod-eventual-simple
+io-compress: compress-zlib