Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=85b38243bc1696c4a362b2417ffc8a193e1139e6

commit 85b38243bc1696c4a362b2417ffc8a193e1139e6
Author: Michel Hermier <herm...@frugalware.org>
Date:   Sat Nov 9 15:07:58 2013 +0100

libpacman: Group db_local functions inside of _pacman_db_read.

diff --git a/lib/libpacman/be_files.c b/lib/libpacman/be_files.c
index 6fccbba..4ff93cd 100644
--- a/lib/libpacman/be_files.c
+++ b/lib/libpacman/be_files.c
@@ -267,8 +267,6 @@ static int suffixcmp(const char *str, const char *suffix)

int _pacman_db_read(pmdb_t *db, unsigned int inforeq, pmpkg_t *info)
{
-       struct stat buf;
-       char path[PATH_MAX];

ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1));

@@ -277,18 +275,33 @@ int _pacman_db_read(pmdb_t *db, unsigned int inforeq, 
pmpkg_t *info)
return(-1);
}

-       snprintf(path, PATH_MAX, "%s/%s-%s", db->path, info->name, 
info->version);
-       if(islocal(db) && stat(path, &buf)) {
-               /* directory doesn't exist or can't be opened */
-               return(-1);
-       }
-
if (islocal(db)) {
+               struct stat buf;
+               char path[PATH_MAX];
+
+               snprintf(path, PATH_MAX, "%s/%s-%s", db->path, info->name, 
info->version);
+               if(stat(path, &buf)) {
+                       /* directory doesn't exist or can't be opened */
+                       return(-1);
+               }
+
if (_pacman_db_read_desc(db, inforeq, info) == -1)
return -1;

if (_pacman_db_read_depends(db, inforeq, info) == -1)
return -1;
+
+               /* FILES */
+               if (_pacman_db_read_files(db, inforeq, info) == -1)
+                       return -1;
+
+               /* INSTALL */
+               if(inforeq & INFRQ_SCRIPLET) {
+                       snprintf(path, PATH_MAX, "%s/%s-%s/install", db->path, 
info->name, info->version);
+                       if(!stat(path, &buf)) {
+                               info->scriptlet = 1;
+                       }
+               }
} else {
int descdone = 0, depsdone = 0;
while (!descdone || !depsdone) {
@@ -309,18 +322,6 @@ int _pacman_db_read(pmdb_t *db, unsigned int inforeq, 
pmpkg_t *info)
}
}

-       /* FILES */
-       if (_pacman_db_read_files(db, inforeq, info) == -1)
-               return -1;
-
-       /* INSTALL */
-       if(inforeq & INFRQ_SCRIPLET) {
-               snprintf(path, PATH_MAX, "%s/%s-%s/install", db->path, 
info->name, info->version);
-               if(!stat(path, &buf)) {
-                       info->scriptlet = 1;
-               }
-       }
-
/* internal */
info->infolevel |= inforeq;
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to