#! /bin/bash pkg_name=$1 # First get the dependency dictionary... count=0 for each in `mvl-edition-rpm -qp $pkg_name --qf "[%{dependsdict}\n]"` ; do echo -e "\x$(printf "%02X" $(($each>>24))) $(($each&0xFFFFFF))" count=$((count+1)) done > /tmp/dependsdict # Next get the deps... mvl-edition-rpm -qp $pkg_name --qf "[%{REQUIRES}\n]" > /tmp/dependsR mvl-edition-rpm -qp $pkg_name --qf "[%{PROVIDES}\n]" > /tmp/dependsP # Now get the per-file info mvl-edition-rpm -qp $pkg_name --qf "[%{FILENAMES} %{FILEDEPENDSX} %{FILEDEPENDSN}\n]" > /tmp/depfileinfo # Do Provides echo echo Provides: echo while read FNAME DEPSX DEPSN ; do if [ $DEPSN -ne 0 ]; then head -n "$(( DEPSX + DEPSN ))" /tmp/dependsdict | tail -n $DEPSN > /tmp/depcurinfo echo -n "$FNAME: " while read DTYPE DNUM ; do if [ "$DTYPE" = "P" ]; then dep="`head -n "$(( DNUM + 1 ))" /tmp/depends${DTYPE} | tail -n 1`" echo -n "$dep " fi done < /tmp/depcurinfo echo fi done < /tmp/depfileinfo # Do Requires echo echo Requires: echo while read FNAME DEPSX DEPSN ; do if [ $DEPSN -ne 0 ]; then head -n "$(( DEPSX + DEPSN ))" /tmp/dependsdict | tail -n $DEPSN > /tmp/depcurinfo echo -n "$FNAME: " while read DTYPE DNUM ; do if [ "$DTYPE" = "R" ]; then dep="`head -n "$(( DNUM + 1 ))" /tmp/depends${DTYPE} | tail -n 1`" echo -n "$dep " fi done < /tmp/depcurinfo echo fi done < /tmp/depfileinfo #rm /tmp/depfileinfo #rm /tmp/depcurinfo #rm /tmp/dependsR #rm /tmp/dependsP #rm /tmp/dependsdict