#!/bin/sh # # Un Rpm, ver 0.0.1 # Rpm installation witouth database modification # # May 2004, Aleksey Barabanov # # PKG=$1 NULL=/dev/null TS=/var/tmp/unrpm-$$ ROOT="/" # save configures rpm --configfiles -qp $PKG | while read f ; do [ -w $f ] && { echo "save $f" cp -f $f $f.rpmsave } done # preinstall echo -e "#!/bin/sh\necho run preinstall\n" >$TS rpm --scripts -qp $PKG | sed -ne '/^preinstall/,/^\(postinstall\|preuninstall\|postuninstall\)/ p' | \ grep -v "install scriptlet" >>$TS (cd $ROOT ; sh $TS) # install echo "run installation" rpm2cpio $PKG | \ (cd $ROOT ; \ cpio -iumd --quiet --no-absolute-filenames \ ) >$NULL # postinstall echo -e "#!/bin/sh\necho run postinstall\n" >$TS rpm --scripts -qp $PKG | sed -ne '/^postinstall/,/^\(preinstall\|preuninstall\|postuninstall\)/ p' | \ grep -v "install scriptlet" >>$TS (cd $ROOT ; sh $TS) rm -rf $TS exit # ##############################################