mirror of
https://github.com/moparisthebest/pacman
synced 2024-11-11 20:05:07 -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:
parent
20ff0cd40f
commit
dbc58d9386
@ -783,7 +783,8 @@ int _alpm_local_db_write(alpm_db_t *db, alpm_pkg_t *info, alpm_dbinfrq_t inforeq
|
|||||||
/* DESC */
|
/* DESC */
|
||||||
if(inforeq & INFRQ_DESC) {
|
if(inforeq & INFRQ_DESC) {
|
||||||
char *path;
|
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);
|
info->name, info->version);
|
||||||
path = _alpm_local_db_pkgpath(db, info, "desc");
|
path = _alpm_local_db_pkgpath(db, info, "desc");
|
||||||
if(!path || (fp = fopen(path, "w")) == NULL) {
|
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"
|
fprintf(fp, "%%DESC%%\n"
|
||||||
"%s\n\n", info->desc);
|
"%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) {
|
if(info->url) {
|
||||||
fprintf(fp, "%%URL%%\n"
|
fprintf(fp, "%%URL%%\n"
|
||||||
"%s\n\n", info->url);
|
"%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) {
|
if(info->arch) {
|
||||||
fprintf(fp, "%%ARCH%%\n"
|
fprintf(fp, "%%ARCH%%\n"
|
||||||
"%s\n\n", info->arch);
|
"%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"
|
fprintf(fp, "%%REASON%%\n"
|
||||||
"%u\n\n", info->reason);
|
"%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) {
|
if(info->validation) {
|
||||||
fputs("%VALIDATION%\n", fp);
|
fputs("%VALIDATION%\n", fp);
|
||||||
if(info->validation & ALPM_PKG_VALIDATION_NONE) {
|
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 */
|
/* FILES */
|
||||||
if(inforeq & INFRQ_FILES) {
|
if(inforeq & INFRQ_FILES) {
|
||||||
char *path;
|
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);
|
info->name, info->version);
|
||||||
path = _alpm_local_db_pkgpath(db, info, "files");
|
path = _alpm_local_db_pkgpath(db, info, "files");
|
||||||
if(!path || (fp = fopen(path, "w")) == NULL) {
|
if(!path || (fp = fopen(path, "w")) == NULL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user