From 47622eef4dd8fd86a0aa0e3ebdb7b33f7c9d6804 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Wed, 19 Sep 2007 00:21:56 -0500 Subject: Support for localized times in metadata Packages and DBs now support using the UNIX epoch (seconds since Jan 1, 1970) for use in builddate and installdate. This will only affect newly built packages. Old existing packages with the text format are still supported, but this is deprecated. In the case of removal of text time support, this code will fail gracefully, returning the start of the epoch for broken packages. Signed-off-by: Aaron Griffin --- src/pacman/package.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/pacman/package.c b/src/pacman/package.c index 01f4e973..459cb8d4 100644 --- a/src/pacman/package.c +++ b/src/pacman/package.c @@ -43,7 +43,8 @@ */ void dump_pkg_full(pmpkg_t *pkg, int level) { - const char *bdate, *idate, *reason, *descheader; + const char *reason, *descheader; + time_t bdate, idate; if(pkg == NULL) { return; @@ -85,9 +86,9 @@ void dump_pkg_full(pmpkg_t *pkg, int level) printf(_("Installed Size : %6.2f K\n"), (float)alpm_pkg_get_size(pkg) / 1024.0); printf(_("Packager : %s\n"), (char *)alpm_pkg_get_packager(pkg)); printf(_("Architecture : %s\n"), (char *)alpm_pkg_get_arch(pkg)); - printf(_("Build Date : %s %s\n"), bdate, strlen(bdate) ? "UTC" : ""); + printf(_("Build Date : %s"), ctime(&bdate)); /*ctime implicit newline */ if(level > 0) { - printf(_("Install Date : %s %s\n"), idate, strlen(idate) ? "UTC" : ""); + printf(_("Install Date : %s"), ctime(&idate)); /*ctime implicit newline */ printf(_("Install Reason : %s\n"), reason); } printf(_("Install Script : %s\n"), -- cgit v1.2.3-24-g4f1b