-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new script to compare two RPMs or source RPMs
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
# Compares 2 RPMs | ||
set -e | ||
|
||
if [ -z $2 ] | ||
then | ||
echo "Usage: $0 RPM1 RPM2" | ||
exit | ||
fi | ||
|
||
rpm1=$(realpath $1) | ||
rpm2=$(realpath $2) | ||
|
||
TMPDIR=$(mktemp -d) | ||
pushd "$TMPDIR" | ||
|
||
mkdir rpm1 | ||
cd rpm1 | ||
rpm2cpio $rpm1 | cpio -idm | ||
rpm -qp $rpm1 --scripts > scripts.txt | ||
rpm -qp --qf "Name : %{name} | ||
License : %{license} | ||
URL : %{url} | ||
Summary : %{summary} | ||
Description : %{description} | ||
" $rpm1 > info.txt | ||
cd .. | ||
|
||
mkdir rpm2 | ||
cd rpm2 | ||
rpm2cpio $rpm2 | cpio -idm | ||
rpm -qp $rpm2 --scripts > scripts.txt | ||
rpm -qp --qf "Name : %{name} | ||
License : %{license} | ||
URL : %{url} | ||
Summary : %{summary} | ||
Description : %{description} | ||
" $rpm2 > info.txt | ||
cd .. | ||
|
||
meld rpm1 rpm2 | ||
|
||
popd | ||
|
||
\rm -rv "$TMPDIR" |