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 --- lib/libalpm/add.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'lib/libalpm/add.c') 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); -- cgit v1.2.3-54-g00ecf