[pacman-dev] [PATCH] Install unchanged backup files to get correct timestamps.

Ross Lagerwall rosslagerwall at gmail.com
Tue Jun 4 08:41:07 EDT 2013


On Tue, Jun 04, 2013 at 02:17:07PM +0200, Patrick Steinhardt wrote:
> > Can we not just ignore it if it fails since it is non-fatal?
> 
> If we ignore it we should at least add a debug/warning message if
> it fails, I guess.

Fair enough.

> 
> [snip]
> 
> >  		if(hash_local && hash_pkg && strcmp(hash_local, hash_pkg) == 0) {
> > -			/* local and new files are the same, no sense in installing the file
> > -			 * over itself, regardless of what the original file was */
> > +			/* local and new files are the same, overwrite so that timestamps
> > +			 * are maintained correctly for pacman -Qkk */
> >  			_alpm_log(handle, ALPM_LOG_DEBUG,
> > -					"action: leaving existing file in place\n");
> > -			unlink(checkfile);
> 
> I don't think the checkfile should be unlinked here, should it?
> It will certainly fail if you first unlink and afterwards try to
> rename it.
> 

Of course.  I think you're reading the diff wrong.  The unlink is
*replaced* with a rename in the new code.

Regards
-- 
Ross Lagerwall


More information about the pacman-dev mailing list