source: soft/build_system/build_system/upload/robot/trunk/process-obsoletes-old @ 1

Last change on this file since 1 was 1, checked in by fasma, 13 years ago

Initial Import from Mandriva's soft revision 224062 and package revision 45733

File size: 1.1 KB
Line 
1#!/bin/sh
2#---------------------------------------------------------------
3# Project         : Linux-Mandrake
4# Module          : robot
5# File            : process-obsoletes
6# Version         : $Id: process-obsoletes-old 867 2004-07-21 08:16:07Z mandrake $
7# Author          : Frederic Lepied
8# Created On      : Mon Nov 27 07:54:13 2000
9# Purpose         : move obsoleted packages to another dir.
10#---------------------------------------------------------------
11
12if [ $# != 3 ]; then
13    echo "usage: `basename $0` <binary rpm> <srpm dir> <rpm dir>" 1>&2
14    exit 1
15fi
16
17RPM=$1
18SRPMS=$2
19RPMS=$3
20
21OLDDIR=${OLDDIR=$HOME/old}
22
23if [ ! -d "$OLDDIR" ]; then
24    echo "`basename $0`: invalid OLDDIR: $OLDDIR" 1>&2
25    exit 1
26fi
27
28obsoletes=`$HOME/robot/rpmheader $RPM OBSOLETES`
29
30if [ -n "$obsoletes" ]; then
31    for o in $obsoletes; do
32        for f in `ls $RPMS/$o-[0-9]*.rpm 2> /dev/null`; do
33            if [ `rpm -qp --qf %{NAME} $f` = $o ]; then
34                echo "processing obsoletes for $RPM"
35                srpm=`rpm -qp --qf %{SOURCERPM} $f`
36                mv -fv $f $OLDDIR
37                if [ -f "$SRPMS/$srpm" ]; then
38                    mv -fv $SRPMS/$srpm $OLDDIR
39                fi
40            fi
41        done
42    done
43fi
44
45# process-obsoletes ends here
Note: See TracBrowser for help on using the repository browser.