Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Readd possibility to pack with epoch timestamp via the UNSET_TIMESTAMP option
Baptiste Daroussin committed 13 years ago
commit dde1fd5d4237ed3c88ef8b3c832234fe91ed9f35
parent c75301b
3 files changed +9 -14
modified libpkg/packing.c
@@ -149,9 +149,7 @@ packing_append_file_attr(struct packing *pack, const char *filepath,
	int ret;
	struct stat st;
	struct archive_entry *entry, *sparse_entry;
-
	/* ugly hack for python and emacs */
-
	/*char *p;*/
-
	/*bool unset_timestamp = true;*/
+
	bool unset_timestamp;

	entry = archive_entry_new();
	archive_entry_copy_sourcepath(entry, filepath);
@@ -187,23 +185,14 @@ packing_append_file_attr(struct packing *pack, const char *filepath,
	if (perm != 0)
		archive_entry_set_perm(entry, perm);

-
	/* XXX ugly hack for python and emacs */
-
/*	p = strrchr(filepath, '.');
-

-
	if (p != NULL && (strcmp(p, ".pyc") == 0 ||
-
	    strcmp(p, ".py") == 0 ||
-
	    strcmp(p, ".pyo") == 0 ||
-
	    strcmp(p, ".elc") == 0 ||
-
	    strcmp(p, ".el") == 0
-
	    ))
-
		unset_timestamp = false;
+
	pkg_config_bool(PKG_CONFIG_UNSET_TIMESTAMP, &unset_timestamp);

	if (unset_timestamp) {
		archive_entry_unset_atime(entry);
		archive_entry_unset_ctime(entry);
		archive_entry_unset_mtime(entry);
		archive_entry_unset_birthtime(entry);
-
	}*/
+
	}

	archive_entry_linkify(pack->resolver, &entry, &sparse_entry);

modified libpkg/pkg.h.in
@@ -335,6 +335,7 @@ typedef enum _pkg_config_key {
	PKG_CONFIG_NAMESERVER,
	PKG_CONFIG_EVENT_PIPE,
	PKG_CONFIG_FETCH_TIMEOUT,
+
	PKG_CONFIG_UNSET_TIMESTAMP,
} pkg_config_key;

typedef enum {
modified libpkg/pkg_config.c
@@ -230,6 +230,11 @@ static struct config_entry c[] = {
		PKG_CONFIG_INTEGER,
		"FETCH_TIMEOUT",
		"30",
+
	},
+
	[PKG_CONFIG_UNSET_TIMESTAMP] = {
+
		PKG_CONFIG_BOOL,
+
		"UNSET_TIMESTAMP",
+
		"NO",
	}
};