Subject: contribution to pkgsrc
To: None <tech-pkg@netbsd.org>
From: Roland Illig <roland.illig@gmx.de>
List: tech-pkg
Date: 01/21/2004 21:44:59
Hello,
I added a make target "status" that tells you in what state your current
pkgsrc directory is.
Roland
Index: mk/bsd.pkg.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.mk,v
retrieving revision 1.1349
diff -u -r1.1349 bsd.pkg.mk
--- mk/bsd.pkg.mk 2004/01/19 23:47:41 1.1349
+++ mk/bsd.pkg.mk 2004/01/21 20:27:59
@@ -5055,3 +5055,20 @@
.if defined(BATCH)
. include "../../mk/bulk/bsd.bulk-pkg.mk"
.endif
+
+status:
+ @\
+ if test ! -d "work"; then echo "clean"; \
+ elif test ! -f "work/.extract_done"; then echo "not extracted"; \
+ elif test ! -f "work/.patch_done"; then echo "extracted"; \
+ elif test ! -f "work/.tools_done"; then echo "patched"; \
+ elif test ! -f "work/.configure_done"; then echo "created tools"; \
+ elif test ! -f "work/.build_done"; then echo "configured"; \
+ elif test ! -f "work/.buildlink_done"; then echo "built"; \
+ elif test ! -f "work/.install_done"; then echo "buildlinked"; \
+ elif test ! -f "work/.package_done"; then \
+ if pkg_info ${PKGNAME} >/dev/null 2>&1; then \
+ echo "installed"; \
+ else echo "marked as installed but not installed"; fi; \
+ else echo "packaged"; \
+ fi