[pacman-dev] [patch] Modified info query so unknown attributes are not shown
Dan McGee
dpmcgee at gmail.com
Sat Jan 27 16:32:13 EST 2007
(Patched on my local tree, so it may not line up perfectly, but it is
very straightforward.)
* Modified info query so it doesn't show more than available when querying a
package file.
Signed-off-by: Dan McGee <dpmcgee at gmail.com>
#
# old_revision [6ed5dfeba6a29ca2c5158f88f2d76b21fc8938f3]
#
# patch "src/pacman/package.c"
# from [1c53121b062b4ee21f6b372e5e3ffbceb3b2b36f]
# to [d935dbb664984fa0b60ea08b3132946f49be2214]
#
============================================================
--- src/pacman/package.c 1c53121b062b4ee21f6b372e5e3ffbceb3b2b36f
+++ src/pacman/package.c d935dbb664984fa0b60ea08b3132946f49be2214
@@ -34,6 +34,10 @@
#include "package.h"
/* Display the content of an installed package
+ *
+ * level: <1 - omits N/A info for file query (-Qp)
+ * 1 - normal level
+ * >1 - extra information (backup files)
*/
void dump_pkg_full(pmpkg_t *pkg, int level)
{
@@ -69,26 +73,26 @@ void dump_pkg_full(pmpkg_t *pkg, int lev
list_display(_("Provides :"), alpm_pkg_get_provides(pkg));
list_display(_("Depends On :"), alpm_pkg_get_depends(pkg));
list_display(_("Removes :"), alpm_pkg_get_removes(pkg));
- /* TODO only applicable if querying installed package, not a file */
- list_display(_("Required By :"), alpm_pkg_get_requiredby(pkg));
+ if(level > 0) { /* Only applicable if installed package */
+ list_display(_("Required By :"), alpm_pkg_get_requiredby(pkg));
+ }
list_display(_("Conflicts With :"), alpm_pkg_get_conflicts(pkg));
printf(_("Installed Size : %ld K\n"), (long)alpm_pkg_get_size(pkg) / 1024);
printf(_("Packager : %s\n"), (char *)alpm_pkg_get_packager(pkg));
printf(_("Architecture : %s\n"), (char *)alpm_pkg_get_arch(pkg));
printf(_("Build Date : %s %s\n"), bdate, strlen(bdate) ? "UTC" : "");
printf(_("Build Type : %s\n"), strlen(type) ? type : _("Unknown"));
- /* TODO only applicable if querying installed package, not a file */
- printf(_("Install Date : %s %s\n"), idate, strlen(idate) ? "UTC" : "");
+ if(level > 0) {
+ printf(_("Install Date : %s %s\n"), idate, strlen(idate) ? "UTC" : "");
+ printf(_("Install Reason : %s\n"), reason);
+ }
printf(_("Install Script : %s\n"), alpm_pkg_has_scriptlet(pkg) ?
_("Yes") : _("No"));
- printf(_("Reason : %s\n"), reason);
- /* TODO only applicable if querying installed package, not a file */
printf(_("Description : "));
indentprint(alpm_pkg_get_desc(pkg), 17);
printf("\n");
/* Print additional package info if info flag passed more than once */
- /* TODO only applicable if querying installed package, not a file */
if(level > 1) {
/* call new backup function */
dump_pkg_backups(pkg);
More information about the pacman-dev
mailing list