- Previously any failure on replacing the original package with the
newly signed one would silently fail, causing rather confusing
behavior when eg attempting to (re)sign readable but not writable
packages.
/* Move final target into place, restore file permissions. */
if (stat(rpm, &st) == 0 && unlink(rpm) == 0 &&
- rename(trpm, rpm) == 0 && chmod(rpm, st.st_mode) == 0)
+ rename(trpm, rpm) == 0 && chmod(rpm, st.st_mode) == 0) {
res = 0;
+ } else {
+ rpmlog(RPMLOG_ERR, _("replacing %s failed: %s\n"),
+ rpm, strerror(errno));
+ }
}
exit: