1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-22 15:58:50 -05:00

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>
This commit is contained in:
Dan McGee 2012-04-24 21:01:55 -05:00
parent 20ff0cd40f
commit dbc58d9386

View File

@ -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) {