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

Patrick Steinhardt steinhardt.ptk at gmail.com
Tue Jun 4 05:20:14 EDT 2013


Fixes FS#35515.
---
 lib/libalpm/add.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index c20e7c6..cab04a8 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -309,11 +309,13 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive,
 		_alpm_log(handle, ALPM_LOG_DEBUG, "original: %s\n", hash_orig);
 
 		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 */
-			_alpm_log(handle, ALPM_LOG_DEBUG,
-					"action: leaving existing file in place\n");
-			unlink(checkfile);
+			/* local and new files are the same, updating anyway to get
+			 * correct timestamps */
+			_alpm_log(handle, ALPM_LOG_DEBUG, "action: installing new file: %s\n",
+					entryname_orig);
+			if(try_rename(handle, checkfile, filename)) {
+				errors++;
+			}
 		} else if(hash_orig && hash_pkg && strcmp(hash_orig, hash_pkg) == 0) {
 			/* original and new files are the same, leave the local version alone,
 			 * including any user changes */
-- 
1.8.3

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://mailman.archlinux.org/pipermail/pacman-dev/attachments/20130604/b081d6a8/attachment.asc>


More information about the pacman-dev mailing list