summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2005-11-07 09:43:25 +0000
committerAurelien Foret <aurelien@archlinux.org>2005-11-07 09:43:25 +0000
commit6a2230dce1544418112c85bf46f3669cc7fed7dc (patch)
tree02644dc12ad45891aebc18ce9be6d4618633799c /lib
parent096e531236c48e3dfaed236a9653a473b146ee00 (diff)
downloadpacman-6a2230dce1544418112c85bf46f3669cc7fed7dc.tar.xz
added more pm_errnos
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/package.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c
index 93f234e7..33b9d079 100644
--- a/lib/libalpm/package.c
+++ b/lib/libalpm/package.c
@@ -267,6 +267,11 @@ pmpkg_t *pkg_load(char *pkgfile)
RET_ERR(PM_ERR_MEMORY, NULL);
}
+ /* ORE
+ * We should get the name and version information from the file name
+ * by using pkg_splitname()
+ */
+
for(i = 0; !th_read(tar); i++) {
if(config && filelist && scriptcheck) {
/* we have everything we need */
@@ -281,16 +286,20 @@ pmpkg_t *pkg_load(char *pkgfile)
tar_extract_file(tar, descfile);
/* parse the info file */
if(parse_descfile(descfile, info, 0) == -1) {
+ _alpm_log(PM_LOG_ERROR, "could not parse the package description file");
+ pm_errno = PM_ERR_PKG_INVALID;
FREE(descfile);
goto error;
}
if(!strlen(info->name)) {
_alpm_log(PM_LOG_ERROR, "missing package name in %s", pkgfile);
+ pm_errno = PM_ERR_PKG_INVALID;
FREE(descfile);
goto error;
}
if(!strlen(info->version)) {
_alpm_log(PM_LOG_ERROR, "missing package version in %s", pkgfile);
+ pm_errno = PM_ERR_PKG_INVALID;
FREE(descfile);
goto error;
}