From 26ec9573ef6a7c71caea25c498a81acefc9544be Mon Sep 17 00:00:00 2001 From: Judd Vinet Date: Sun, 22 Jan 2006 02:30:15 +0000 Subject: changed behaviour with original=X,current=Y,new=Z backup scenario -- install new file as .pacnew and keep old one in place --- lib/libalpm/add.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index e8dfb491..a91634af 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -504,16 +504,11 @@ int add_commit(pmtrans_t *trans, pmdb_t *db) installnew = 1; } else { char newpath[PATH_MAX]; - _alpm_log(PM_LOG_DEBUG, "action: saving current file and installing new one"); + _alpm_log(PM_LOG_DEBUG, "action: leaving file in place, installing new one as .pacnew\n"); + strncat(expath, ".pacnew", PATH_MAX); installnew = 1; - snprintf(newpath, PATH_MAX, "%s.pacsave", expath); - if(rename(expath, newpath)) { - _alpm_log(PM_LOG_ERROR, "could not rename %s (%s)", pathname, strerror(errno)); - alpm_logaction("error: could not rename %s (%s)", expath, strerror(errno)); - } else { - _alpm_log(PM_LOG_WARNING, "%s saved as %s.pacsave", pathname, pathname); - alpm_logaction("warning: %s saved as %s", expath, newpath); - } + _alpm_log(PM_LOG_WARNING, "extracting %s as %s.pacnew", pathname, pathname); + alpm_logaction("warning: extracting %s%s as %s", handle->root, pathname, expath); } if(installnew) { -- cgit v1.2.3-24-g4f1b