diff options
author | Allan McRae <allan@archlinux.org> | 2010-10-11 07:10:26 +0200 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2010-10-14 05:17:40 +0200 |
commit | 5b17d8f27d9a490a461eb2946f7c209d42c5762e (patch) | |
tree | 7f6588c49b23506b3d636d7dc61595629eee4362 | |
parent | fbcadebcab57d59e460368fb6ed48bba0bbfb8a1 (diff) | |
download | pacman-5b17d8f27d9a490a461eb2946f7c209d42c5762e.tar.gz pacman-5b17d8f27d9a490a461eb2946f7c209d42c5762e.tar.xz |
Clean-up parsing sync database
Remove unnecessary parsing of fields not found in sync desc file.
Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r-- | lib/libalpm/be_sync.c | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c index 2981178c..78038576 100644 --- a/lib/libalpm/be_sync.c +++ b/lib/libalpm/be_sync.c @@ -315,33 +315,12 @@ int _alpm_sync_db_read(pmdb_t *db, struct archive *archive, struct archive_entry } else { pkg->builddate = atol(line); } - } else if(strcmp(line, "%INSTALLDATE%") == 0) { - if(_alpm_archive_fgets(line, sizeof(line), archive) == NULL) { - goto error; - } - _alpm_strtrim(line); - - char first = tolower((unsigned char)line[0]); - if(first > 'a' && first < 'z') { - struct tm tmp_tm = {0}; /* initialize to null in case of failure */ - setlocale(LC_TIME, "C"); - strptime(line, "%a %b %e %H:%M:%S %Y", &tmp_tm); - pkg->installdate = mktime(&tmp_tm); - setlocale(LC_TIME, ""); - } else { - pkg->installdate = atol(line); - } } else if(strcmp(line, "%PACKAGER%") == 0) { if(_alpm_archive_fgets(line, sizeof(line), archive) == NULL) { goto error; } STRDUP(pkg->packager, _alpm_strtrim(line), goto error); - } else if(strcmp(line, "%REASON%") == 0) { - if(_alpm_archive_fgets(line, sizeof(line), archive) == NULL) { - goto error; - } - pkg->reason = (pmpkgreason_t)atol(_alpm_strtrim(line)); - } else if(strcmp(line, "%SIZE%") == 0 || strcmp(line, "%CSIZE%") == 0) { + } else if(strcmp(line, "%CSIZE%") == 0) { /* NOTE: the CSIZE and SIZE fields both share the "size" field * in the pkginfo_t struct. This can be done b/c CSIZE * is currently only used in sync databases, and SIZE is @@ -356,15 +335,11 @@ int _alpm_sync_db_read(pmdb_t *db, struct archive *archive, struct archive_entry pkg->isize = pkg->size; } } else if(strcmp(line, "%ISIZE%") == 0) { - /* ISIZE (installed size) tag only appears in sync repositories, - * not the local one. */ if(_alpm_archive_fgets(line, sizeof(line), archive) == NULL) { goto error; } pkg->isize = atol(_alpm_strtrim(line)); } else if(strcmp(line, "%MD5SUM%") == 0) { - /* MD5SUM tag only appears in sync repositories, - * not the local one. */ if(_alpm_archive_fgets(line, sizeof(line), archive) == NULL) { goto error; } |