Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
info: Add the timestamp to the raw output
Baptiste Daroussin committed 5 years ago
commit 2fd581708db2a6cd32e55d2fabfdff86dfac2eaf
parent bfc2020
3 files changed +7 -1
modified libpkg/pkg.h.in
@@ -754,6 +754,7 @@ void pkg_manifest_parser_free(struct pkg_manifest_parser *p);
#define PKG_MANIFEST_EMIT_PRETTY (0x1 << 2)
#define PKG_MANIFEST_EMIT_JSON (0x1 << 3)
#define PKG_MANIFEST_EMIT_UCL (0x1 << 4)
+
#define PKG_MANIFEST_EMIT_LOCAL_METADATA (0x1 << 5)

/**
 * Emit a manifest according to the attributes of pkg.
modified libpkg/pkg_manifest.c
@@ -1016,6 +1016,11 @@ pkg_emit_object(struct pkg *pkg, short flags)
		ucl_object_insert_key(top, ucl_object_fromstring_common(pkg->dep_formula, 0,
		    UCL_STRING_TRIM), "dep_formula", 11, false);
	}
+
	if (pkg->type == PKG_INSTALLED &&
+
	    (flags & PKG_MANIFEST_EMIT_LOCAL_METADATA) == PKG_MANIFEST_EMIT_LOCAL_METADATA) {
+
		ucl_object_insert_key(top, ucl_object_fromint(pkg->timestamp), "timestamp", 9, false);
+
	}
+

	/*
	 * XXX: dirty hack to be compatible with pkg 1.2
	 */
modified src/utils.c
@@ -334,7 +334,7 @@ print_info(struct pkg * const pkg, uint64_t options)
	int64_t flatsize, oldflatsize, pkgsize;
	int cout = 0;		/* Number of characters output */
	int info_num;		/* Number of different data items to print */
-
	int outflags = 0;
+
	int outflags = PKG_MANIFEST_EMIT_LOCAL_METADATA;

	pkg_get(pkg,
		PKG_REPOURL,       &repourl,