1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-22 15:58:50 -05:00

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>
This commit is contained in:
Xavier Chantry 2008-05-28 23:25:40 +02:00 committed by Dan McGee
parent d030d12542
commit 5ae02e6ae7
2 changed files with 6 additions and 6 deletions

View File

@ -144,6 +144,10 @@ static pmpkg_t *pkg_load(const char *pkgfile, unsigned short full)
RET_ERR(PM_ERR_WRONG_ARGS, NULL); 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) { if((archive = archive_read_new()) == NULL) {
RET_ERR(PM_ERR_LIBARCHIVE, 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); RET_ERR(PM_ERR_MEMORY, NULL);
} }
if(stat(pkgfile, &st) == 0) { newpkg->filename = strdup(pkgfile);
newpkg->size = st.st_size; newpkg->size = st.st_size;
}
/* If full is false, only read through the archive until we find our needed /* 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 * metadata. If it is true, read through the entire archive, which serves

View File

@ -90,9 +90,6 @@ void dump_pkg_full(pmpkg_t *pkg, int level)
} }
/* actual output */ /* actual output */
if(level == 0) {
string_display(_("Filename :"), alpm_pkg_get_filename(pkg));
}
string_display(_("Name :"), alpm_pkg_get_name(pkg)); string_display(_("Name :"), alpm_pkg_get_name(pkg));
string_display(_("Version :"), alpm_pkg_get_version(pkg)); string_display(_("Version :"), alpm_pkg_get_version(pkg));
string_display(_("URL :"), alpm_pkg_get_url(pkg)); string_display(_("URL :"), alpm_pkg_get_url(pkg));