diff options
author | Will Woods <wwoods@redhat.com> | 2009-02-04 17:29:03 -0500 |
---|---|---|
committer | Will Woods <wwoods@redhat.com> | 2009-02-04 17:29:03 -0500 |
commit | de4332cdc2763511146ac6dcb61d28245cf03cf1 (patch) | |
tree | 8e41c880474c4f8363b4b170b5c5cb4302a1bdc2 | |
parent | b452c8e4e3aacb6274bb03091f9b0ecea1613900 (diff) | |
download | debuginfofs-de4332cdc2763511146ac6dcb61d28245cf03cf1.tar.gz debuginfofs-de4332cdc2763511146ac6dcb61d28245cf03cf1.tar.xz debuginfofs-de4332cdc2763511146ac6dcb61d28245cf03cf1.zip |
Use nevra instead of envra (like repofs)
-rwxr-xr-x | unpack-debuginfo.sh | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/unpack-debuginfo.sh b/unpack-debuginfo.sh index b31a179..7152133 100755 --- a/unpack-debuginfo.sh +++ b/unpack-debuginfo.sh @@ -20,6 +20,20 @@ if [ $# -lt 2 ]; then exit 1 fi +function rpm_nevra { + if [ -z "$1" ]; then return; fi + n_evra="$(rpm -qp $1 --qf '%{N} %{E}:%{V}-%{R}.%{ARCH}' 2>/dev/null)" + set -- $n_evra + n=$1 + evra=$2 + if [ "${evra:0:1}" == ":" ]; then + evra="0$evra" + elif [ "${evra:0:6}" == "(none)" ]; then + evra="0${evra:6}" + fi + echo ${n}-${evra} +} + function rpm_envra { if [ -z "$1" ]; then return; fi envra="$(rpm -qp $1 --qf '%{E}:%{N}-%{V}-%{R}.%{ARCH}' 2>/dev/null)" @@ -54,12 +68,11 @@ if [ ! -d "$libdir/$reponame" ]; then fi while [ $# -gt 0 ]; do - envra="$(rpm_envra $1)" - nvra="${envra#*:}" - first_letter="${nvra:0:1}" - targetdir="$libdir/$reponame/$first_letter/$envra" + nevra="$(rpm_nevra $1)" + first_letter="${nevra:0:1}" + targetdir="$libdir/$reponame/$first_letter/$nevra" if [ -d $targetdir ]; then - [ "$verbose" ] && echo "$envra already unpacked; skipping..." + [ "$verbose" ] && echo "$nevra already unpacked; skipping..." else mkdir -p $targetdir unpack_rpm $1 $targetdir |