[libalpm: modify the behaviour of handling config files
VMiklos <[EMAIL PROTECTED]>**20051209231144
Submitted By: Adam Zlehovszky <[EMAIL PROTECTED]>
Date: 2004.02.09.
Initial Packages: 2.9.5
Upstream Status: Not submitted - Frugalware specific
Description: This patch fixes an annoying bug of pacman.
Always extract config files as .pacnew, instead of
overwriting
the users's configs.
] {
hunk ./doc/pacman.8.in 213
-All three files are different. So we install the new file, but back up the
-old one to a .pacsave extension. This way the user can move the old
configuration
-file back into place if he wishes.
+All three files are different. So we extract the new new file with a .pacnew
+extension, and keep the old one. This way the user can overwrite the old
+configuration with the new one if he wishes.
hunk ./lib/libalpm/add.c 530
- _alpm_log(PM_LOG_DEBUG,
"action: saving current file and installing new one");
- 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));
+ _alpm_log(PM_LOG_DEBUG,
"action: keeping current file and installing new one with .pacnew ending\n");
+ installnew = 0;
+ snprintf(newpath,
PATH_MAX, "%s.pacnew", expath);
+ if(_alpm_copyfile(temp,
newpath)) {
+
_alpm_log(PM_LOG_ERROR, "could not install %s as %s: %s", expath, newpath,
strerror(errno));
+
alpm_logaction(stderr, "error: could not install %s as %s: %s", expath,
newpath, strerror(errno));
hunk ./lib/libalpm/add.c 537
-
_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, "%s installed as %s", expath, newpath);
+
alpm_logaction("warning: %s installed as %s", expath, newpath);
}
_______________________________________________
Frugalware-darcs mailing list
Frugalware-darcs@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-darcs