Skip to content

Commit

Permalink
Add new script to compare two RPMs or source RPMs
Browse files Browse the repository at this point in the history
  • Loading branch information
stormi committed Sep 19, 2018
1 parent 6c70b41 commit 8222565
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions scripts/diff_rpms.sh
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"

0 comments on commit 8222565

Please sign in to comment.