diff options
author | Aaron Griffin <aaronmgriffin@gmail.com> | 2007-09-19 07:21:56 +0200 |
---|---|---|
committer | Aaron Griffin <aaronmgriffin@gmail.com> | 2007-09-28 07:25:57 +0200 |
commit | 47622eef4dd8fd86a0aa0e3ebdb7b33f7c9d6804 (patch) | |
tree | 4fb65c38ad6a8c8fb4577977d78b07b891be3a2f /src | |
parent | 219808714f94788a66a430786c552f60e95b1a01 (diff) | |
download | pacman-47622eef.tar.gz pacman-47622eef.tar.xz |
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 <aaronmgriffin@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/pacman/package.c | 7 |
1 files changed, 4 insertions, 3 deletions
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"), |