1 |
vapier 11/03/02 02:40:19 |
2 |
|
3 |
Modified: main.c |
4 |
Log: |
5 |
convert grab_vdb_item to eat_file, and drop the leading slash on vdb path for now |
6 |
|
7 |
Revision Changes Path |
8 |
1.187 portage-utils/main.c |
9 |
|
10 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/main.c?rev=1.187&view=markup |
11 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/main.c?rev=1.187&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-projects/portage-utils/main.c?r1=1.186&r2=1.187 |
13 |
|
14 |
Index: main.c |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-projects/portage-utils/main.c,v |
17 |
retrieving revision 1.186 |
18 |
retrieving revision 1.187 |
19 |
diff -u -r1.186 -r1.187 |
20 |
--- main.c 28 Feb 2011 18:16:11 -0000 1.186 |
21 |
+++ main.c 2 Mar 2011 02:40:19 -0000 1.187 |
22 |
@@ -1,7 +1,7 @@ |
23 |
/* |
24 |
* Copyright 2005-2008 Gentoo Foundation |
25 |
* Distributed under the terms of the GNU General Public License v2 |
26 |
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/main.c,v 1.186 2011/02/28 18:16:11 vapier Exp $ |
27 |
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/main.c,v 1.187 2011/03/02 02:40:19 vapier Exp $ |
28 |
* |
29 |
* Copyright 2005-2008 Ned Ludd - <solar@g.o> |
30 |
* Copyright 2005-2008 Mike Frysinger - <vapier@g.o> |
31 |
@@ -688,7 +688,10 @@ |
32 |
_Q_EVS(STR, PORTAGE_TMPDIR, port_tmpdir, EPREFIX "/var/tmp/portage/") |
33 |
_Q_EVS(STR, PKGDIR, pkgdir, EPREFIX "/usr/portage/packages/") |
34 |
_Q_EVS(STR, ROOT, portroot, "/") |
35 |
- _Q_EVS(STR, Q_VDB, portvdb, EPREFIX "/var/db/pkg") |
36 |
+ /* XXX: This needs to not have a leading slash since some of the q |
37 |
+ * utils use chdir(root) && chdir(portvdb). Once those are |
38 |
+ * fixed, we can add a proper leading slash here. */ |
39 |
+ _Q_EVS(STR, Q_VDB, portvdb, EPREFIX "var/db/pkg") |
40 |
{ } |
41 |
|
42 |
#undef _Q_EV |
43 |
@@ -1022,21 +1025,12 @@ |
44 |
return (atom->PR_int == 0 ? atom->P : atom->PVR ); |
45 |
} |
46 |
|
47 |
-char *grab_vdb_item(const char *, const char *, const char *); |
48 |
-char *grab_vdb_item(const char *item, const char *CATEGORY, const char *PF) |
49 |
+static char *grab_vdb_item(const char *item, const char *CATEGORY, const char *PF) |
50 |
{ |
51 |
static char buf[_Q_PATH_MAX]; |
52 |
- char *p; |
53 |
- FILE *fp; |
54 |
|
55 |
snprintf(buf, sizeof(buf), "%s%s/%s/%s/%s", portroot, portvdb, CATEGORY, PF, item); |
56 |
- if ((fp = fopen(buf, "r")) == NULL) |
57 |
- return NULL; |
58 |
- if (fgets(buf, sizeof(buf), fp) == NULL) |
59 |
- buf[0] = '\0'; |
60 |
- if ((p = strchr(buf, '\n')) != NULL) |
61 |
- *p = 0; |
62 |
- fclose(fp); |
63 |
+ eat_file(buf, buf, sizeof(buf)); |
64 |
rmspace(buf); |
65 |
|
66 |
return buf; |