head 1.2; access; symbols RPM_3_0_4:1.1.1.3 RPM_3_0_3:1.1.1.2 RPM_3_0_2:1.1.1.2 RPM_3_0_1:1.1.1.2 RPM_3_0:1.1.1.2 RPM_2_5_6:1.1.1.1 RPM:1.1.1; locks; strict; comment @# @; 1.2 date 2003.08.24.12.04.16; author rse; state dead; branches; next 1.1; 1.1 date 98.07.30.14.19.59; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 98.07.30.14.19.59; author rse; state Exp; branches; next 1.1.1.2; 1.1.1.2 date 99.03.27.19.04.32; author rse; state Exp; branches; next 1.1.1.3; 1.1.1.3 date 2000.03.01.17.16.47; author rse; state Exp; branches; next ; desc @@ 1.2 log @Resolve: RPM 3.0.4 -> RPM 3.0.5 @ text @#!/bin/sh # Implements --freshen option in RPM. --freshen is mostly like upgrade, but # go through each file and make sure the package is actually installed before # upgrading it. This won't work properly if there are any odd options # specified (i.e. filenames with " specified). I'm sure some shell-hacker # out there can fix that . if [ $1 = ";" ]; then RPM=rpm shift else RPM=$1 shift 2 fi args="-U" while [ $# -gt 0 ]; do if [ "$1" = "--" ]; then break fi args="$args $1" shift done if [ $# = 0 ]; then exec $RPM $args fi args="$args -- " shift # Just filenames left now for n in $*; do # if the file doesn't exist, we'll let RPM give the error message if [ ! -f $n ]; then args="$args $n" else name=`rpm --qf "%{NAME}" -qp $n` $RPM -q $name >/dev/null 2>&1 && args="$args $n" fi done exec $RPM $args @ 1.1 log @Initial revision @ text @@ 1.1.1.1 log @Import: RPM 2.5.6 @ text @@ 1.1.1.2 log @Import: RPM 3.0 @ text @d39 2 a40 4 if ! rpm -q `rpm -qp $n` >/dev/null 2>&1; then name=`rpm --qf "%{NAME}" -qp $n` $RPM -q $name >/dev/null 2>&1 && args="$args $n" fi @ 1.1.1.3 log @Import: RPM 3.0.4 @ text @a29 1 origargs="$args" d39 1 a39 4 if rpm -q `rpm -qp $n` >/dev/null 2>&1 then : else d46 1 a46 5 if [ "$args" = "$origargs -- " ]; then echo no packages require freshening else exec $RPM $args fi @