Skip to content

Instantly share code, notes, and snippets.

@ralt
Created July 3, 2015 13:03
Show Gist options
  • Save ralt/61457c270a80978cf1ba to your computer and use it in GitHub Desktop.
Save ralt/61457c270a80978cf1ba to your computer and use it in GitHub Desktop.
Check that 2 debian packages have the same files
#!/bin/bash
FIRST_TMP=$RANDOM
SECOND_TMP=$RANDOM
mkdir -p $FIRST_TMP $SECOND_TMP
cp $1 $FIRST_TMP
cd $FIRST_TMP
ar vx $1 > /dev/null
tar xf control.tar*
cd -
cp $2 $SECOND_TMP
cd $SECOND_TMP
ar vx $2 > /dev/null
tar xf control.tar*
cd -
diff <($FIRST_TMP/md5sums) <($SECOND_TMP/md5sums)
if [ $? -ne 0 ]; then
echo "Packages don't match."
exit 1
else
echo "Packages match."
exit 0
fi
@ralt
Copy link
Author

ralt commented Jul 3, 2015

Or just use debdiff, duh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment