From d1c93bed52ec0b1d825948c4432c0e3c3f9a8b69 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 29 Dec 2019 09:57:54 +0100 Subject: [PATCH] xbps-rindex: stop adding the "build-date" pkg obj. This was just setting the current date when the pkg is being added to the repository index. It does not make any sense, so get rid of it completely. This "build-date" string obj needs to be added via xbps-create(1) not xbps-rindex(1)! Another step towards reproducability (#55) --- bin/xbps-rindex/index-add.c | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/bin/xbps-rindex/index-add.c b/bin/xbps-rindex/index-add.c index 0d4a5e63..92c4b6de 100644 --- a/bin/xbps-rindex/index-add.c +++ b/bin/xbps-rindex/index-add.c @@ -37,23 +37,6 @@ #include #include "defs.h" -static int -set_build_date(const xbps_dictionary_t pkgd, time_t timestamp) -{ - char outstr[64]; - struct tm tmp; - - if (!localtime_r(×tamp, &tmp)) - return -1; - - if (strftime(outstr, sizeof(outstr)-1, "%F %R %Z", &tmp) == 0) - return -1; - - if (!xbps_dictionary_set_cstring(pkgd, "build-date", outstr)) - return -1; - return 0; -} - static bool repodata_commit(struct xbps_handle *xhp, const char *repodir, xbps_dictionary_t idx, xbps_dictionary_t meta, xbps_dictionary_t stage, @@ -190,8 +173,7 @@ repodata_commit(struct xbps_handle *xhp, const char *repodir, } xbps_object_iterator_release(iter); rv = repodata_flush(xhp, repodir, "stagedata", stage, NULL, compression, privkey); - } - else { + } else { char *stagefile; iter = xbps_dictionary_iterator(stage); while ((keysym = xbps_object_iterator_next(iter))) { @@ -378,13 +360,6 @@ index_add(struct xbps_handle *xhp, int args, int argmax, char **argv, bool force rv = EINVAL; goto out; } - if (set_build_date(binpkgd, st.st_mtime) < 0) { - xbps_object_release(binpkgd); - free(pkgver); - free(pkgname); - rv = EINVAL; - goto out; - } /* Remove unneeded objects */ xbps_dictionary_remove(binpkgd, "pkgname"); xbps_dictionary_remove(binpkgd, "version");