Add more error checking and logging
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
7467fb9e76
commit
c12ccbfb2c
3 changed files with 8 additions and 2 deletions
|
@ -296,7 +296,11 @@ static int download_internal(const char *url, const char *localpath,
|
||||||
tv[1].tv_sec = ust.mtime;
|
tv[1].tv_sec = ust.mtime;
|
||||||
utimes(tempfile, tv);
|
utimes(tempfile, tv);
|
||||||
}
|
}
|
||||||
rename(tempfile, destfile);
|
if(rename(tempfile, destfile)) {
|
||||||
|
_alpm_log(PM_LOG_ERROR, _("could not rename %s to %s (%s)\n"),
|
||||||
|
tempfile, destfile, strerror(errno));
|
||||||
|
ret = -1;
|
||||||
|
}
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
|
|
@ -621,7 +621,7 @@ char *_alpm_filecache_find(const char* filename)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* package wasn't found in any cachedir */
|
/* package wasn't found in any cachedir */
|
||||||
return(NULL);
|
RET_ERR(PM_ERR_PKG_NOT_FOUND, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check the alpm cachedirs for existance and find a writable one.
|
/** Check the alpm cachedirs for existance and find a writable one.
|
||||||
|
|
|
@ -55,6 +55,8 @@ int pacman_upgrade(alpm_list_t *targets)
|
||||||
if(strstr(i->data, "://")) {
|
if(strstr(i->data, "://")) {
|
||||||
char *str = alpm_fetch_pkgurl(i->data);
|
char *str = alpm_fetch_pkgurl(i->data);
|
||||||
if(str == NULL) {
|
if(str == NULL) {
|
||||||
|
pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n",
|
||||||
|
(char *)i->data, alpm_strerrorlast());
|
||||||
return(1);
|
return(1);
|
||||||
} else {
|
} else {
|
||||||
free(i->data);
|
free(i->data);
|
||||||
|
|
Loading…
Add table
Reference in a new issue