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 | |
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')
-rw-r--r-- | Functions/DEB | 6 | ||||
-rw-r--r-- | Functions/RPM | 15 |
2 files changed, 17 insertions, 4 deletions
diff --git a/Functions/DEB b/Functions/DEB index 1c0e498..5d59135 100644 --- a/Functions/DEB +++ b/Functions/DEB @@ -17,7 +17,7 @@ function thirdparty_arch() { fi } -function thirdparty_distribution() { +function thirdparty_distribution_name() { local debfile="$1" local distro=$(dpkg-deb --field "$debfile" "Distribution") if [ -z "$distro" ] @@ -26,6 +26,10 @@ function thirdparty_distribution() { fi } +function thirdparty_distribution_code() { + return +} + function thirdparty_dependencies() { local debfile="$1" local deps=$(dpkg-deb --field "$debfile" "Depends") 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() { |