summaryrefslogtreecommitdiff
path: root/lib/libalpm/be_files.c
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2006-11-22 09:03:41 +0000
committerAaron Griffin <aaron@archlinux.org>2006-11-22 09:03:41 +0000
commit986409f9bd7b84e63352b9ec1f825b0c917627a6 (patch)
treef74350bb415326724e86408985ea0d43fe93c7b0 /lib/libalpm/be_files.c
parent54691771831c97c7366bf8ee7c54da3952c22120 (diff)
downloadpacman-986409f9bd7b84e63352b9ec1f825b0c917627a6.tar.xz
* Completed getinfo api changes (pmmissing_t, pmtrans_t, etc)
* Modified some dependancy checking * Changed "performing local database upgrade" message to be more clear * Change 'usize' to 'isize' in database files * Scriptlet output is now sent to pacman's log file * Limited some debugging output to be more clear
Diffstat (limited to 'lib/libalpm/be_files.c')
-rw-r--r--lib/libalpm/be_files.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/lib/libalpm/be_files.c b/lib/libalpm/be_files.c
index 33dd78b5..ccd0b246 100644
--- a/lib/libalpm/be_files.c
+++ b/lib/libalpm/be_files.c
@@ -198,6 +198,10 @@ int _alpm_db_read(pmdb_t *db, unsigned int inforeq, pmpkg_t *info)
return(-1);
}
+ if(info->infolevel & inforeq) {
+ /* already loaded this info, do nothing */
+ return(0);
+ }
_alpm_log(PM_LOG_FUNCTION, _("loading package data for %s : level=%d"), info->name, inforeq);
/* clear out 'line', to be certain - and to make valgrind happy */
@@ -223,7 +227,16 @@ int _alpm_db_read(pmdb_t *db, unsigned int inforeq, pmpkg_t *info)
break;
}
_alpm_strtrim(line);
- if(!strcmp(line, "%DESC%")) {
+ if(!strcmp(line, "%FILENAME%")) {
+ /* filename is _new_ - it provides the real name of the package, on the
+ * server, to allow for us to not tie the name of the actual file to the
+ * data of the package
+ */
+ if(fgets(info->filename, sizeof(info->filename), fp) == NULL) {
+ goto error;
+ }
+ _alpm_strtrim(info->filename);
+ } else if(!strcmp(line, "%DESC%")) {
while(fgets(line, 512, fp) && strlen(_alpm_strtrim(line))) {
info->desc_localized = _alpm_list_add(info->desc_localized, strdup(line));
}
@@ -305,15 +318,15 @@ int _alpm_db_read(pmdb_t *db, unsigned int inforeq, pmpkg_t *info)
}
_alpm_strtrim(tmp);
info->size = atol(tmp);
- } else if(!strcmp(line, "%USIZE%")) {
- /* USIZE (uncompressed size) tag only appears in sync repositories,
+ } else if(!strcmp(line, "%ISIZE%")) {
+ /* ISIZE (installed size) tag only appears in sync repositories,
* not the local one. */
char tmp[32];
if(fgets(tmp, sizeof(tmp), fp) == NULL) {
goto error;
}
_alpm_strtrim(tmp);
- info->usize = atol(tmp);
+ info->isize = atol(tmp);
} else if(!strcmp(line, "%SHA1SUM%")) {
/* SHA1SUM tag only appears in sync repositories,
* not the local one. */
@@ -525,9 +538,9 @@ int _alpm_db_write(pmdb_t *db, pmpkg_t *info, unsigned int inforeq)
fprintf(fp, "%%CSIZE%%\n"
"%ld\n\n", info->size);
}
- if(info->usize) {
- fprintf(fp, "%%USIZE%%\n"
- "%ld\n\n", info->usize);
+ if(info->isize) {
+ fprintf(fp, "%%ISIZE%%\n"
+ "%ld\n\n", info->isize);
}
if(info->sha1sum) {
fprintf(fp, "%%SHA1SUM%%\n"