From 4ae58bdb9ae926c9ab9751cf4871f38a35b3d4b5 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 29 Apr 2016 17:05:40 +0200 Subject: neuesPerlPaket aufgerÀumt, Substitutionen nach perlSubstitutionen ausgelagert MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- neuesPerlPaket | 49 +++++++++++-------------------------------------- perlSubstitutionen | 12 ++++++++++++ 2 files changed, 23 insertions(+), 38 deletions(-) create mode 100644 perlSubstitutionen diff --git a/neuesPerlPaket b/neuesPerlPaket index 05d430452..8ddcf7695 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 000000000..4934f9d53 --- /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 -- cgit v1.2.3-54-g00ecf