On 2002.05.15 22:34 Jan Schmidt wrote:
> <quote who="Jos? Fonseca">
> 
> > ...
> >
> > The problem is that the existence of those dri-old files are the only
> > proof that anything was installed before. If we default to delete file
> > when there is no backup then someone mistakenly trying to restore with
> no
> > previous installation (or, e.g., accidental second restore) will delete
> > all the drivers, and I think that this can be far more annoying than
> > having a dummy mach64.o floating around.
> 
> But, if before you had:
> fileA, fileB
> 
> then install
> fileA, fileB, fileC
> 
> when you restore, it will copy the fileA and fileB back from dri-old, but
> doesn't remove fileC... so you haven't really restored the system to the
> way it was in that case.
> 

Yep. I know.. but although the fileC remains it has no effect. This 
affects mostly new drivers which aren't supported in the stock distro 
(e.g., Mach64). The orginal fileA and fileB have no knowledge of the fileC 
so it won't be used.

> Possibly, you can say that the stray file doesn't matter, since if they
> didn't have it before, it won't be used in the config, but how about:
> 
> for FILE in *o; do
>         if [ -f $XF86_DRV_DIR/$FILE ]; then
>                 mv -f $XF86_DRV_DIR/$FILE $XF86_DRV_DIR/dri-old.$FILE >&
>                 $LOGFILE
>                 rm -f $XF86_DRV_DIR/dri-old.n.$FILE >& $LOGFILE
>         else
>                 rm -f $XF86_DRV_DIR/dri-old.$FILE >& $LOGFILE
>                 touch $XF86_DRV_DIR/dri-old.n.$FILE >& $LOGFILE
>         fi
> done
> 
> Then, to restore, check for the existence of dri-old.n.$FILE and remove
> the installed version if that exists...
> 
> for FILE in *o; do
>         if [ -f $XF86_DRV_DIR/dri-old.$FILE ]; then
>                 mv -f $XF86_DRV_DIR/dri-old.$FILE $XF86_DRV_DIR/$FILE >&
>                 $LOGFILE
>         else
>                 if [ -f $XF86_DRV_DIR/dri-old.n.$FILE ]; then
>                         rm -f $XF86_DRV_DIR/$FILE >& $LOGFILE
>                         # Clean up touch fileE
>                         rm -f $XF86_DRV_DIR/dri-old.n.$FILE >& LOGFILE
>                 fi
>         fi
> done
> 

Yes, this would do it. When I have some time I'll use your ideas to make 
an "install" and "uninstall" bash functions to be reused across the 
install.sh script. Then I'll also try to address another problem which is 
to avoid that two consequtive installs irreversibily remove the original 
drivers...

José Fonseca

_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to