code cleanup
This commit is contained in:
parent
a26095f8fc
commit
a2b0748b2b
1 changed files with 10 additions and 10 deletions
|
@ -495,7 +495,7 @@ int add_commit(pmtrans_t *trans, pmdb_t *db)
|
||||||
temp = strdup("/tmp/alpm_XXXXXX");
|
temp = strdup("/tmp/alpm_XXXXXX");
|
||||||
mkstemp(temp);
|
mkstemp(temp);
|
||||||
if(tar_extract_file(tar, temp)) {
|
if(tar_extract_file(tar, temp)) {
|
||||||
alpm_logaction("could not extract %s: %s", pathname, strerror(errno));
|
alpm_logaction("could not extract %s (%s)", pathname, strerror(errno));
|
||||||
errors++;
|
errors++;
|
||||||
FREE(md5_local);
|
FREE(md5_local);
|
||||||
continue;
|
continue;
|
||||||
|
@ -534,12 +534,12 @@ int add_commit(pmtrans_t *trans, pmdb_t *db)
|
||||||
char newpath[PATH_MAX];
|
char newpath[PATH_MAX];
|
||||||
snprintf(newpath, PATH_MAX, "%s.pacorig", expath);
|
snprintf(newpath, PATH_MAX, "%s.pacorig", expath);
|
||||||
if(rename(expath, newpath)) {
|
if(rename(expath, newpath)) {
|
||||||
_alpm_log(PM_LOG_ERROR, "could not rename %s: %s", pathname, strerror(errno));
|
_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_logaction("error: could not rename %s (%s)", expath, strerror(errno));
|
||||||
}
|
}
|
||||||
if(_alpm_copyfile(temp, expath)) {
|
if(_alpm_copyfile(temp, expath)) {
|
||||||
_alpm_log(PM_LOG_ERROR, "could not copy %s to %s: %s", temp, pathname, strerror(errno));
|
_alpm_log(PM_LOG_ERROR, "could not copy %s to %s (%s)", temp, pathname, strerror(errno));
|
||||||
alpm_logaction("error: could not copy %s to %s: %s", temp, expath, strerror(errno));
|
alpm_logaction("error: could not copy %s to %s (%s)", temp, expath, strerror(errno));
|
||||||
errors++;
|
errors++;
|
||||||
} else {
|
} else {
|
||||||
_alpm_log(PM_LOG_WARNING, "%s saved as %s.pacorig", pathname, pathname);
|
_alpm_log(PM_LOG_WARNING, "%s saved as %s.pacorig", pathname, pathname);
|
||||||
|
@ -570,8 +570,8 @@ int add_commit(pmtrans_t *trans, pmdb_t *db)
|
||||||
installnew = 1;
|
installnew = 1;
|
||||||
snprintf(newpath, PATH_MAX, "%s.pacsave", expath);
|
snprintf(newpath, PATH_MAX, "%s.pacsave", expath);
|
||||||
if(rename(expath, newpath)) {
|
if(rename(expath, newpath)) {
|
||||||
_alpm_log(PM_LOG_ERROR, "could not rename %s: %s", pathname, strerror(errno));
|
_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_logaction("error: could not rename %s (%s)", expath, strerror(errno));
|
||||||
} else {
|
} else {
|
||||||
_alpm_log(PM_LOG_WARNING, "%s saved as %s.pacsave", pathname, pathname);
|
_alpm_log(PM_LOG_WARNING, "%s saved as %s.pacsave", pathname, pathname);
|
||||||
alpm_logaction("warning: %s saved as %s", expath, newpath);
|
alpm_logaction("warning: %s saved as %s", expath, newpath);
|
||||||
|
@ -581,7 +581,7 @@ int add_commit(pmtrans_t *trans, pmdb_t *db)
|
||||||
if(installnew) {
|
if(installnew) {
|
||||||
/*_alpm_log(PM_LOG_FLOW2, " %s", expath);*/
|
/*_alpm_log(PM_LOG_FLOW2, " %s", expath);*/
|
||||||
if(_alpm_copyfile(temp, expath)) {
|
if(_alpm_copyfile(temp, expath)) {
|
||||||
_alpm_log(PM_LOG_ERROR, "could not copy %s to %s: %s", temp, pathname, strerror(errno));
|
_alpm_log(PM_LOG_ERROR, "could not copy %s to %s (%s)", temp, pathname, strerror(errno));
|
||||||
errors++;
|
errors++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -611,8 +611,8 @@ int add_commit(pmtrans_t *trans, pmdb_t *db)
|
||||||
unlink(expath);
|
unlink(expath);
|
||||||
}
|
}
|
||||||
if(tar_extract_file(tar, expath)) {
|
if(tar_extract_file(tar, expath)) {
|
||||||
_alpm_log(PM_LOG_ERROR, "could not extract %s: %s", pathname, strerror(errno));
|
_alpm_log(PM_LOG_ERROR, "could not extract %s (%s)", pathname, strerror(errno));
|
||||||
alpm_logaction("could not extract %s: %s", pathname, strerror(errno));
|
alpm_logaction("could not extract %s (%s)", pathname, strerror(errno));
|
||||||
errors++;
|
errors++;
|
||||||
}
|
}
|
||||||
/* calculate an md5 hash if this is in info->backup */
|
/* calculate an md5 hash if this is in info->backup */
|
||||||
|
|
Loading…
Add table
Reference in a new issue