diff options
author | Lucas C. Villa Real <lucasvr@gmail.com> | 2016-12-30 01:25:23 -0200 |
---|---|---|
committer | Lucas C. Villa Real <lucasvr@gmail.com> | 2016-12-30 01:25:23 -0200 |
commit | 777e18ec5bfc4771541a1685abe36cdde204ee64 (patch) | |
tree | 71609d28a6dd4769c7fda75d55453f333283dfe7 /bin | |
parent | b418221f7ea103f76d7adeb295450ca888419270 (diff) | |
download | ThirdPartyInstallers-777e18ec5bfc4771541a1685abe36cdde204ee64.tar.xz |
When merging multiple RPM files under a single /Programs entry, it is
possible that some of the RPM files processed will list some of the
other RPMs as their dependencies. Since all of them will be saved under
the same /Programs entry, it's pointless to record those on
Resources/Dependencies. This commit implements a filter using the
rpminfo utility to take that into consideration when producing the
Dependencies file.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/InstallPackage-RPM | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/bin/InstallPackage-RPM b/bin/InstallPackage-RPM index a977188..ae93772 100755 --- a/bin/InstallPackage-RPM +++ b/bin/InstallPackage-RPM @@ -156,6 +156,13 @@ function flatten_rpm() { rmdir * 2> /dev/null } +function is_inputfile() { + local dependency="$1" + local pkgname=$(echo "$dependency" | cut -d'(' -f1 | awk {'print $1'}) + printf "%s\n" "${rpmnames[@]}" | grep -q "^${pkgname}$" && return 0 + return 1 +} + function populate_dependencies() { local rpmfile="$1" rpminfo --dependencies "$rpmfile" | while read dependency @@ -167,7 +174,7 @@ function populate_dependencies() { then echo "$depinfo" else echo "# Unresolved dependency: $dependency" fi - elif echo "$dependency" | grep -q "^lib.*.so*" + elif echo "$dependency" | grep -q "^lib.*\.so*" then libname=$(echo "$dependency" | cut -d'(' -f1) wantedsymbol=$(echo "$dependency" | cut -d'(' -f2 | cut -d')' -f1) @@ -182,6 +189,9 @@ function populate_dependencies() { elif is_rpmlib_symbol "$dependency" then Log_Verbose "Skipping internal symbol: $dependency" + elif is_inputfile "$dependency" + then + Log_Verbose "Skipping dependency passed as input file: $dependency" else depinfo=$(lookup_pkgname "$dependency") if [ "$depinfo" ] @@ -407,11 +417,15 @@ then verbose="--verbose" else verbose= fi +# The rpmfiles array holds the full path of all RPM input files +# The rpmnames array holds the package name of all RPM input files rpmfiles=() +rpmnames=() eval `Args_To_Array rpmfiles_` for entry in "${rpmfiles_[@]}" do rpmfiles+=( "$(readlink -f ${entry} || echo ${entry})" ) + rpmnames+=( "$(rpminfo --name $entry)" ) done # These will be set by prepare_program_entry() |