AnacondaUpdateRpms

= rpmupdates =

The rpmupdates script is a small bash program that updates the RPMs in you tree. Put your updated RPMs in new/new/. This script will compare them to the RPMs in i386/Fedora/RPMS/. If the RPMs in new/new/ are newer, this script will move the old RPMs to olddir/, and copy the new RPMs to i386/Fedora/RPMS/ and new/done. If they are not newer, it will move them to new/ and give a warning message. I have seen several perl programs that do the same thing, but I would really like to see a python program that could be included with anaconda.

Move the rpmupdates script to /fedora (or /dvd), and run it from that directory.

diff -urN anaconda-9.2/scripts/rpmupdates anaconda-9.2.new/scripts/rpmupdates --- anaconda-9.2/scripts/rpmupdates  1969-12-31 16:00:00.000000000 -0800 +++ anaconda-9.2.new/scripts/rpmupdates  2003-01-22 16:21:22.000000000 -0800 @@ -0,0 +1,85 @@ +#!/bin/bash +# +# UPDATES_DIR  The directory that contains the updates +# RPM1DIR  The original RH tree +# RPM2DIR  Disc 2 of the tree +# ARCH     Arch +# EXTRA_DIR  The directory that contains extra RPMS +# OLDDIR  All old rpms will be dumped here + +RPM1DIR=i386/Fedora/RPMS +UPDATES_DIR=new/new +OLDDIR=olddir +DONE_DIR=new/done +EXTRA_DIR=extra +# DEBUG=0 + +   echo NOTICE: beginning to apply updated packages to ${RPM1DIR} +   echo NOTICE: from ${UPDATES_DIR}  ### and ${EXTRA_DIR} +   echo NOTICE: this may take a few minutes +   echo + +   if [ [ ! -d $OLDDIR ] ; then +           echo making directory $OLDDIR +           mkdir $OLDDIR +   fi + +   if [ [ $DEBUG ] +   then +  echo 'in update_cd' +  echo PWD = +  echo RPM1DIR=$RPM1DIR +  echo ARCH=$ARCH +  echo UPDATES_DIR=$UPDATES_DIR +  echo +   fi +    allow_null_glob_expansion=1 + +#   for rpm in ${UPDATES_DIR}/*.rpm ${EXTRA_DIR}/*.rpm  ; do +    for rpm in ${UPDATES_DIR}/*.rpm; do +   RPMDIR=${RPM1DIR} +#   NAME=  for BETAs (4x) +       NAME= +       ARCH= +       unset OLDNAME +       for oldrpm in ${RPM1DIR}/${NAME}*.${ARCH}.rpm ; do +            if [ [ x  = x$NAME ] ; then +              if [ [ x  = x$ARCH ] ; then +                  OLDNAME=$oldrpm +        RPMDIR=${RPM1DIR} +                  break +     fi +            fi +        done + +  if [ [ ! -d $DONE_DIR ] ;then +     echo Making $DONE_DIR +     mkdir $DONE_DIR +  fi + +       if [ [ -z $OLDNAME ] ; then +           echo $NAME $ARCH is new +           cp -pv $rpm $RPMDIR +      mv $rpm $DONE_DIR +       else +           if [ [ x  != x  ] +      then +     if [ [ $DEBUG ] +         then +             echo mv $OLDNAME $OLDDIR +                  echo cp -pv $rpm $RPMDIR +        echo mv $rpm $DONE_DIR +         else +                  mv $OLDNAME $OLDDIR +                  #echo removing $OLDNAME +                  #rm $OLDNAME +                  cp -pv $rpm $RPMDIR +        mv $rpm $DONE_DIR +     fi +            else +          echo NOTICE:      update already applied +     echo NOTICE:   Now moving   to new/ +     mv $rpm new +           fi +        fi +    done