xbps-bin: added support for the show target.

--HG--
extra : convert_revision : 24b2d30a94c95b22b1c524203cf578da03314335
This commit is contained in:
Juan RP
2009-02-16 16:24:33 +01:00
parent 54cce657ec
commit 2b24128059
6 changed files with 60 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
TOPDIR = ../..
include $(TOPDIR)/vars.mk
OBJS = main.o
OBJS = main.o ../xbps-repo/util.o
BIN = xbps-bin
all: $(BIN)
@@ -18,6 +18,7 @@ clean-bins:
clean-objs:
-rm -f *.o
-rm -f ../xbps-repo/util.o
install: $(BIN)
install -d $(SBINDIR)

View File

@@ -33,6 +33,7 @@
#include <unistd.h>
#include <xbps_api.h>
#include "../xbps-repo/util.h"
static void usage(void);
static void show_missing_deps(prop_dictionary_t, const char *);
@@ -188,6 +189,16 @@ main(int argc, char **argv)
printf("Package %s removed successfully.\n", argv[1]);
}
} else if (strcasecmp(argv[0], "show") == 0) {
/* Shows info about an installed binary package. */
if (argc != 2)
usage();
rv = show_pkg_info_from_metadir(argv[1]);
if (rv != 0) {
printf("Package %s not installed\n", argv[1]);
exit(EXIT_FAILURE);
}
} else {
usage();
}