diff options
Diffstat (limited to 'Functions/RPM')
-rw-r--r-- | Functions/RPM | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Functions/RPM b/Functions/RPM index 635f643..a166fb0 100644 --- a/Functions/RPM +++ b/Functions/RPM @@ -11,11 +11,16 @@ function thirdparty_arch() { rpminfo --arch "$rpmfile" } -function thirdparty_distribution() { +function thirdparty_distribution_name() { local rpmfile="$1" rpminfo --distribution "$rpmfile" } +function thirdparty_distribution_code() { + local rpmfile="$1" + echo "$rpmfile" | awk -F. '{print $(NF-2)}' +} + function thirdparty_dependencies() { local rpmfile="$1" rpminfo --dependencies "$rpmfile" @@ -64,8 +69,12 @@ function thirdparty_url() { function thirdparty_search_remotedb() { local path="$1" local arch="$2" - local distro="$3" - RPMFinder --path="$path" --arch="$arch" --distro="$distro" + local distroname="$3" + local distrocode="$4" + local result=$(RPMFinder --path="$path" --arch="$arch" --distroname="$distroname" --distrocode="$distrocode") + [ -z "$result" ] && [ "$arch" = "noarch" ] && result=$(RPMFinder --path="$path" --arch="$(uname -m)" --distroname="$distroname" --distrocode="$distrocode") + [ -z "$result" ] && return + echo "$result" } function thirdparty_uncompress() { |