summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-04-24 21:01:55 -0500
committerDan McGee <dan@archlinux.org>2012-04-24 21:01:55 -0500
commitdbc58d9386170a193d951c926c87075450de3bb1 (patch)
tree1b681b307c91c31e330b4747f845366b43860ed2
parent20ff0cd40fd228f56251634a7429439244c24eac (diff)
downloadpacman-dbc58d9386170a193d951c926c87075450de3bb1.tar.xz
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 <dan@archlinux.org>
-rw-r--r--lib/libalpm/be_local.c38
1 files changed, 20 insertions, 18 deletions
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) {