From 51f23fd9e19ed8debb1ebeca31ed6b451d8583c5 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 22 Feb 2015 18:23:46 +0100 Subject: [PATCH] xbps: merge patch from master to store pkg files mtime in the binpkg metadata. --- srcpkgs/xbps-static/template | 2 +- ...ore-file-mtime-in-metadata-for-upcom.patch | 64 +++++++++++++++++++ srcpkgs/xbps/template | 2 +- 3 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/xbps/patches/0011-xbps-create-8-store-file-mtime-in-metadata-for-upcom.patch diff --git a/srcpkgs/xbps-static/template b/srcpkgs/xbps-static/template index 5b7d7b3ff4..e9a87b4b27 100644 --- a/srcpkgs/xbps-static/template +++ b/srcpkgs/xbps-static/template @@ -3,7 +3,7 @@ # NOTE: keep this package synchronized with "srcpkgs/xbps". pkgname=xbps-static version=0.43.1 -revision=9 +revision=10 build_style=configure short_desc="The XBPS package system utilities - static binaries" maintainer="Juan RP " diff --git a/srcpkgs/xbps/patches/0011-xbps-create-8-store-file-mtime-in-metadata-for-upcom.patch b/srcpkgs/xbps/patches/0011-xbps-create-8-store-file-mtime-in-metadata-for-upcom.patch new file mode 100644 index 0000000000..536d673f31 --- /dev/null +++ b/srcpkgs/xbps/patches/0011-xbps-create-8-store-file-mtime-in-metadata-for-upcom.patch @@ -0,0 +1,64 @@ +From 2cae0cba01fc4baab98073006187d6edb94eedf0 Mon Sep 17 00:00:00 2001 +From: Juan RP +Date: Sun, 22 Feb 2015 18:20:32 +0100 +Subject: [PATCH] xbps-create(8): store file mtime in metadata for upcoming + changes. + +--- + NEWS | 3 +++ + bin/xbps-create/main.c | 12 ++++++++++-- + 2 files changed, 13 insertions(+), 2 deletions(-) + +diff --git a/bin/xbps-create/main.c b/bin/xbps-create/main.c +index e089700..5f2e101 100644 +--- bin/xbps-create/main.c ++++ bin/xbps-create/main.c +@@ -1,5 +1,5 @@ + /*- +- * Copyright (c) 2012-2014 Juan Romero Pardines. ++ * Copyright (c) 2012-2015 Juan Romero Pardines. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without +@@ -57,6 +57,7 @@ + + struct xentry { + TAILQ_ENTRY(xentry) entries; ++ uint64_t mtime; + char *file, *type, *target, *hash; + ino_t inode; + }; +@@ -272,6 +273,8 @@ ftw_cb(const char *fpath, const struct stat *sb, int type, struct FTW *ftwbuf _u + */ + xe->type = strdup("links"); + assert(xe->type); ++ /* store modification time for regular files and links */ ++ xe->mtime = (uint64_t)sb->st_mtime; + buf = malloc(sb->st_size+1); + assert(buf); + r = readlink(fpath, buf, sb->st_size+1); +@@ -348,6 +351,8 @@ ftw_cb(const char *fpath, const struct stat *sb, int type, struct FTW *ftwbuf _u + die("failed to process hash for %s:", fpath); + + xe->inode = sb->st_ino; ++ /* store modification time for regular files and links */ ++ xe->mtime = (uint64_t)sb->st_mtime; + + } else if (type == FTW_D || type == FTW_DP) { + /* directory */ +@@ -409,8 +414,11 @@ process_xentry(const char *key, const char *mutable_files) + xbps_dictionary_set_cstring(d, "file", p); + if (xe->target) + xbps_dictionary_set_cstring(d, "target", xe->target); +- else if (xe->hash) ++ if (xe->hash) + xbps_dictionary_set_cstring(d, "sha256", xe->hash); ++ if (xe->mtime) ++ xbps_dictionary_set_uint64(d, "mtime", xe->mtime); ++ + xbps_array_add(a, d); + xbps_object_release(d); + } +-- +2.3.0 + diff --git a/srcpkgs/xbps/template b/srcpkgs/xbps/template index a8c222a210..ee7506f95f 100644 --- a/srcpkgs/xbps/template +++ b/srcpkgs/xbps/template @@ -1,7 +1,7 @@ # Template file for 'xbps' pkgname=xbps version=0.43.1 -revision=9 +revision=10 bootstrap=yes build_style=configure short_desc="The XBPS package system utilities"