summaryrefslogtreecommitdiffstats
path: root/lib/libalpm
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2007-02-01 02:51:12 +0100
committerAaron Griffin <aaron@archlinux.org>2007-02-01 02:51:12 +0100
commit4cd65c0a31a199e1ee7ce119e4619b230b03645e (patch)
treef26bd8c0591e766d81be25e17d457da828199ba8 /lib/libalpm
parent55f406fd67afe91c8fb8878f452e481e2e8d1d50 (diff)
downloadpacman-4cd65c0a31a199e1ee7ce119e4619b230b03645e.tar.gz
pacman-4cd65c0a31a199e1ee7ce119e4619b230b03645e.tar.xz
* !strcmp reads funny (as "not string compare" - switch those to == 0, which has
a positive connotation. * Added a nice TODO
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/package.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c
index e92ba571..6951bf7d 100644
--- a/lib/libalpm/package.c
+++ b/lib/libalpm/package.c
@@ -268,12 +268,15 @@ pmpkg_t *_alpm_pkg_load(char *pkgfile)
RET_ERR(PM_ERR_MEMORY, NULL);
}
+ /* TODO there is no reason to make temp files to read
+ * from a libarchive archive, it can be done by reading
+ * directly from the archive */
for(i = 0; archive_read_next_header (archive, &entry) == ARCHIVE_OK; i++) {
if(config && filelist && scriptcheck) {
/* we have everything we need */
break;
}
- if(!strcmp(archive_entry_pathname (entry), ".PKGINFO")) {
+ if(strcmp(archive_entry_pathname (entry), ".PKGINFO") == 0) {
/* extract this file into /tmp. it has info for us */
descfile = strdup("/tmp/alpm_XXXXXX");
fd = mkstemp(descfile);
@@ -296,10 +299,10 @@ pmpkg_t *_alpm_pkg_load(char *pkgfile)
FREE(descfile);
close(fd);
continue;
- } else if(!strcmp(archive_entry_pathname (entry), "._install") || !strcmp(archive_entry_pathname (entry), ".INSTALL")) {
+ } else if(strcmp(archive_entry_pathname (entry), ".INSTALL") == 0) {
info->scriptlet = 1;
scriptcheck = 1;
- } else if(!strcmp(archive_entry_pathname (entry), ".FILELIST")) {
+ } else if(strcmp(archive_entry_pathname (entry), ".FILELIST") == 0) {
/* Build info->files from the filelist */
FILE *fp;
char *fn;