Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix timestamp in packages, when no timestamps are specified
Baptiste Daroussin committed 6 years ago
commit 4074eb197cb0986de35edb7f190474660a812118
parent bbe9b00
1 file changed +2 -3
modified libpkg/packing.c
@@ -62,8 +62,8 @@ packing_init(struct packing **pack, const char *path, pkg_formats format,

	*pack = xcalloc(1, sizeof(struct packing));

-
	if (timestamp == (time_t)-1) {
-
		if ((source_date_epoch = getenv("SOURCE_DATE_EPOCH")) != NULL) {
+
	if (timestamp == (time_t)-1 &&
+
		(source_date_epoch = getenv("SOURCE_DATE_EPOCH")) != NULL) {
			ts = (time_t)strtoimax(source_date_epoch, &endptr, 10);
			if (*endptr != '\0') {
				pkg_emit_error("Ignoring bad environment variable "
@@ -71,7 +71,6 @@ packing_init(struct packing **pack, const char *path, pkg_formats format,
			} else {
				(*pack)->timestamp = ts;
			}
-
	    }
	} else {
		(*pack)->timestamp = timestamp;
	}