From dbc58d9386170a193d951c926c87075450de3bb1 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 24 Apr 2012 21:01:55 -0500 Subject: be_local: write all single-valued attributes first There isn't a whole lot of reason other than code clarity for this, but it makes it a bit more obvious where multivalued attributes start. Signed-off-by: Dan McGee --- lib/libalpm/be_local.c | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) (limited to 'lib/libalpm') diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index 39df15b0..aab6718f 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -783,7 +783,8 @@ int _alpm_local_db_write(alpm_db_t *db, alpm_pkg_t *info, alpm_dbinfrq_t inforeq /* DESC */ if(inforeq & INFRQ_DESC) { char *path; - _alpm_log(db->handle, ALPM_LOG_DEBUG, "writing %s-%s DESC information back to db\n", + _alpm_log(db->handle, ALPM_LOG_DEBUG, + "writing %s-%s DESC information back to db\n", info->name, info->version); path = _alpm_local_db_pkgpath(db, info, "desc"); if(!path || (fp = fopen(path, "w")) == NULL) { @@ -800,26 +801,10 @@ int _alpm_local_db_write(alpm_db_t *db, alpm_pkg_t *info, alpm_dbinfrq_t inforeq fprintf(fp, "%%DESC%%\n" "%s\n\n", info->desc); } - if(info->groups) { - fputs("%GROUPS%\n", fp); - for(lp = info->groups; lp; lp = lp->next) { - fputs(lp->data, fp); - fputc('\n', fp); - } - fputc('\n', fp); - } if(info->url) { fprintf(fp, "%%URL%%\n" "%s\n\n", info->url); } - if(info->licenses) { - fputs("%LICENSE%\n", fp); - for(lp = info->licenses; lp; lp = lp->next) { - fputs(lp->data, fp); - fputc('\n', fp); - } - fputc('\n', fp); - } if(info->arch) { fprintf(fp, "%%ARCH%%\n" "%s\n\n", info->arch); @@ -845,6 +830,22 @@ int _alpm_local_db_write(alpm_db_t *db, alpm_pkg_t *info, alpm_dbinfrq_t inforeq fprintf(fp, "%%REASON%%\n" "%u\n\n", info->reason); } + if(info->groups) { + fputs("%GROUPS%\n", fp); + for(lp = info->groups; lp; lp = lp->next) { + fputs(lp->data, fp); + fputc('\n', fp); + } + fputc('\n', fp); + } + if(info->licenses) { + fputs("%LICENSE%\n", fp); + for(lp = info->licenses; lp; lp = lp->next) { + fputs(lp->data, fp); + fputc('\n', fp); + } + fputc('\n', fp); + } if(info->validation) { fputs("%VALIDATION%\n", fp); if(info->validation & ALPM_PKG_VALIDATION_NONE) { @@ -875,7 +876,8 @@ int _alpm_local_db_write(alpm_db_t *db, alpm_pkg_t *info, alpm_dbinfrq_t inforeq /* FILES */ if(inforeq & INFRQ_FILES) { char *path; - _alpm_log(db->handle, ALPM_LOG_DEBUG, "writing %s-%s FILES information back to db\n", + _alpm_log(db->handle, ALPM_LOG_DEBUG, + "writing %s-%s FILES information back to db\n", info->name, info->version); path = _alpm_local_db_pkgpath(db, info, "files"); if(!path || (fp = fopen(path, "w")) == NULL) { -- cgit v1.2.3-24-g4f1b