Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorXavier Chantry <shiningxc@gmail.com>2008-05-28 23:25:40 +0200
committerDan McGee <dan@archlinux.org>2008-06-04 16:25:31 -0500
commit5ae02e6ae72b7648318e319eba9ab02f489d858a (patch)
treea240818b6c8782472f88d02edb14a6feb52dd8f7 /lib
parentd030d12542dabfe0b6c648f48d2ff08b4feb4d41 (diff)
Don't display filename on -Qip operation.
Some previous commits apparently broke the get_filename function for package loaded with pkg_load (on a -Qip operation) because this field was no longer filled. Now pkg_load fills it. But the -Qip operation needs to be run like this : -Qip <filename>, so the filename is already known. There is no need to display it again. Besides, on a normal -Qi operation, the filename is not displayed either because this information is not stored in the local database. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/be_package.c9
1 files changed, 6 insertions, 3 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