Radish alpha
H
HardenedBSD Package Manager
Radicle
Git (anonymous pull)
Log in to clone via SSH
Ugly workaround for .py .pyo and .pyc, same for emacs files, for them the timestamp isn't ignored
Baptiste Daroussin committed 13 years ago
commit f4eb24c032c323bf3d4e12062b6911f71f614561
parent 130ed8ea5cd7fc1efedcf070dc92b7410549602e
1 file changed +20 -4
modified libpkg/packing.c
@@ -132,6 +132,9 @@ packing_append_file_attr(struct packing *pack, const char *filepath, const char
	int ret;
	struct stat st;
	struct archive_entry *entry, *sparse_entry;
+
	/* ugly hack for python and emacs */
+
	char *p;
+
	bool unset_timestamp = true;

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

-
	archive_entry_unset_atime(entry);
-
	archive_entry_unset_ctime(entry);
-
	archive_entry_unset_mtime(entry);
-
	archive_entry_unset_birthtime(entry);
+
	/* 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;
+

+
	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);