From 3a3e1b2c344fe49284216116ae886cb8a4cb75c2 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Thu, 8 May 2003 05:19:57 +0000 Subject: [PATCH] * extfs/rpm: If rpm doesn't support --info as in Red Hat 9, ignore it and don't show HEADER in the listing. --- vfs/ChangeLog | 5 +++++ vfs/extfs/rpm | 13 ++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/vfs/ChangeLog b/vfs/ChangeLog index 493b9ec87..8b4782174 100644 --- a/vfs/ChangeLog +++ b/vfs/ChangeLog @@ -1,3 +1,8 @@ +2003-05-08 Pavel Roskin + + * extfs/rpm: If rpm doesn't support --info as in Red Hat 9, + ignore it and don't show HEADER in the listing. + 2003-04-29 Michael Shigorin * extfs/iso9660.in: Determine presence of Rock Ridge and Joliet diff --git a/vfs/extfs/rpm b/vfs/extfs/rpm index ceac09a53..94269e61b 100644 --- a/vfs/extfs/rpm +++ b/vfs/extfs/rpm @@ -32,13 +32,16 @@ mcrpmfs_list () MCFASTRPM=$MCFASTRPM_DFLT fi FILEPREF="-r--r--r-- 1 root root " - DESC=`$RPM -qip "$1" 2>/dev/null` || { + $RPM -qp "$1" >/dev/null 2>&1 || { echo "$FILEPREF 0 "`date +"%b %d %H:%M"`" ERROR" - exit 1 + exit 0 } + DESC=`$RPM -qip "$1" 2>/dev/null` DATE=`$RPM -qp --qf "%{BUILDTIME:date}\n" "$1" | cut -c 5-11,21-24` - HEADERSIZE=`echo "$DESC" | wc -c` - echo "-r--r--r-- 1 root root $HEADERSIZE $DATE HEADER" + if test -n "$DESC"; then + HEADERSIZE=`echo "$DESC" | wc -c` + echo "-r--r--r-- 1 root root $HEADERSIZE $DATE HEADER" + fi echo "-r-xr-xr-x 1 root root 39 $DATE INSTALL" echo "-r-xr-xr-x 1 root root 39 $DATE UPGRADE" echo "dr-xr-xr-x 3 root root 0 $DATE INFO" @@ -127,7 +130,7 @@ mcrpmfs_list () mcrpmfs_copyout () { case "$2" in - HEADER) $RPM -qip "$1" > "$3"; exit 0;; + HEADER) $RPM -qip "$1" > "$3" 2>/dev/null; exit 0;; INSTALL) echo "# Run this to install this RPM package" > "$3"; exit 0;; UPGRADE) echo "# Run this to upgrade this RPM package" > "$3"; exit 0;; ERROR) $RPM -qip "$1" > /dev/null 2> "$3"; exit 0;;