summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libalpm/be_package.c9
-rw-r--r--src/pacman/package.c3
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c
index 85112fd4..c0ec3bcf 100644
--- a/lib/libalpm/be_package.c
+++ b/lib/libalpm/be_package.c
@@ -144,6 +144,10 @@ static pmpkg_t *pkg_load(const char *pkgfile, unsigned short full)
RET_ERR(PM_ERR_WRONG_ARGS, NULL);
}
+ if(stat(pkgfile, &st) != 0) {
+ RET_ERR(PM_ERR_PKG_OPEN, NULL);
+ }
+
if((archive = archive_read_new()) == NULL) {
RET_ERR(PM_ERR_LIBARCHIVE, NULL);
}
@@ -162,9 +166,8 @@ static pmpkg_t *pkg_load(const char *pkgfile, unsigned short full)
RET_ERR(PM_ERR_MEMORY, NULL);
}
- if(stat(pkgfile, &st) == 0) {
- newpkg->size = st.st_size;
- }
+ newpkg->filename = strdup(pkgfile);
+ newpkg->size = st.st_size;
/* If full is false, only read through the archive until we find our needed
* metadata. If it is true, read through the entire archive, which serves
diff --git a/src/pacman/package.c b/src/pacman/package.c
index 21213c4a..1698806f 100644
--- a/src/pacman/package.c
+++ b/src/pacman/package.c
@@ -90,9 +90,6 @@ void dump_pkg_full(pmpkg_t *pkg, int level)
}
/* actual output */
- if(level == 0) {
- string_display(_("Filename :"), alpm_pkg_get_filename(pkg));
- }
string_display(_("Name :"), alpm_pkg_get_name(pkg));
string_display(_("Version :"), alpm_pkg_get_version(pkg));
string_display(_("URL :"), alpm_pkg_get_url(pkg));