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 /lib/libalpm/add.c | |
parent | 219808714f94788a66a430786c552f60e95b1a01 (diff) | |
download | pacman-47622eef4dd8fd86a0aa0e3ebdb7b33f7c9d6804.tar.gz pacman-47622eef4dd8fd86a0aa0e3ebdb7b33f7c9d6804.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 'lib/libalpm/add.c')
-rw-r--r-- | lib/libalpm/add.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index 47a885ec..a5885064 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -809,10 +809,7 @@ static int commit_single_pkg(pmpkg_t *newpkg, int pkg_current, int pkg_count, _alpm_pkg_update_requiredby(newpkg); /* make an install date (in UTC) */ - time_t t = time(NULL); - strncpy(newpkg->installdate, asctime(gmtime(&t)), PKG_DATE_LEN); - /* remove the extra line feed appended by asctime() */ - newpkg->installdate[strlen(newpkg->installdate)-1] = 0; + newpkg->installdate = time(NULL); _alpm_log(PM_LOG_DEBUG, "updating database\n"); _alpm_log(PM_LOG_DEBUG, "adding database entry '%s'\n", newpkg->name); |