Last active
August 29, 2015 14:08
-
-
Save marcoemorais/4edd8b40f640423d3ae8 to your computer and use it in GitHub Desktop.
look at the contents of an rpm without installing it on your system
This file contains hidden or 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
#!/usr/bin/env bash | |
EXPECTED_ARGS=2 | |
if [ $# -ne $EXPECTED_ARGS ] | |
then | |
echo "Usage: `basename $0` rpm-file target-dir" | |
exit 1 | |
fi | |
set -e | |
RPM=$1 | |
RPM_BASE=$(basename $RPM) | |
DIR=$2 | |
if [ ! -d "$DIR" ]; then | |
mkdir -p "$DIR" | |
fi | |
cp $RPM $DIR | |
cd $DIR | |
rpm2cpio "$RPM_BASE" | cpio -idmv | |
rm $RPM_BASE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment