Skip to content

Instantly share code, notes, and snippets.

@virtuald
Created October 31, 2015 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save virtuald/6b86f1c09cf06cf542e3 to your computer and use it in GitHub Desktop.
Save virtuald/6b86f1c09cf06cf542e3 to your computer and use it in GitHub Desktop.
Download and unpack source RPM in one command
#!/bin/bash -e
PKG="$1"
SRPM=$(dnf download --source -v $PKG | tee /dev/stderr | grep -o '.*--> Package \:.*\:.*\.src\.rpm$' | rev | cut -f 1 -d' ' | rev | uniq)
rpm2cpio $SRPM | cpio -idmv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment