diff options
author | Lucas C. Villa Real <lucasvr@gmail.com> | 2018-06-30 01:02:39 -0300 |
---|---|---|
committer | Lucas C. Villa Real <lucasvr@gmail.com> | 2018-06-30 01:02:39 -0300 |
commit | 37b51b2a5fd3644c6b1842cbe504da6e9bbc588a (patch) | |
tree | 4b3694b515472068f271a416648aaef625f643af /Functions/RPM | |
parent | e80b7ab3e9847eb8bf3a30d536d6301893c6be38 (diff) | |
download | ThirdPartyInstallers-37b51b2a5fd3644c6b1842cbe504da6e9bbc588a.tar.xz |
Improved dependency search on rpmfind.net: we now include the distro
code (i.e., fc26, fc27, etc) and have a placeholder to check versions
when a range filter is given. We can probably use some of the code from
Scripts' FindDependencies.c here.
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() { |