1 |
grobian 09/03/24 20:53:24 |
2 |
|
3 |
Modified: Makefile main.c qlop.c |
4 |
Log: |
5 |
Add support for Gentoo Prefix, by adding the offset to the code where necessary |
6 |
|
7 |
Revision Changes Path |
8 |
1.64 portage-utils/Makefile |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/portage-utils/Makefile?rev=1.64&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/portage-utils/Makefile?rev=1.64&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/portage-utils/Makefile?r1=1.63&r2=1.64 |
13 |
|
14 |
Index: Makefile |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-projects/portage-utils/Makefile,v |
17 |
retrieving revision 1.63 |
18 |
retrieving revision 1.64 |
19 |
diff -u -r1.63 -r1.64 |
20 |
--- Makefile 12 Apr 2008 17:25:59 -0000 1.63 |
21 |
+++ Makefile 24 Mar 2009 20:53:24 -0000 1.64 |
22 |
@@ -1,6 +1,6 @@ |
23 |
# Copyright 2005-2008 Gentoo Foundation |
24 |
# Distributed under the terms of the GNU General Public License v2 |
25 |
-# $Header: /var/cvsroot/gentoo-projects/portage-utils/Makefile,v 1.63 2008/04/12 17:25:59 solar Exp $ |
26 |
+# $Header: /var/cvsroot/gentoo-projects/portage-utils/Makefile,v 1.64 2009/03/24 20:53:24 grobian Exp $ |
27 |
#################################################################### |
28 |
|
29 |
check_gcc=$(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \ |
30 |
@@ -21,11 +21,14 @@ |
31 |
#LDFLAGS := -pie |
32 |
LIBADD += $(shell echo | $(CC) -dM -E - | grep -q ' __FreeBSD__' && echo '-lkvm') |
33 |
DESTDIR := |
34 |
-PREFIX := $(DESTDIR)/usr |
35 |
+EPREFIX := |
36 |
+PREFIX := $(DESTDIR)$(EPREFIX)/usr |
37 |
STRIP := strip |
38 |
MKDIR := mkdir -p |
39 |
CP := cp |
40 |
|
41 |
+HFLAGS += -DEPREFIX=\"$(EPREFIX)\" |
42 |
+ |
43 |
ifdef PV |
44 |
HFLAGS += -DVERSION=\"$(PV)\" |
45 |
else |
46 |
@@ -51,7 +54,7 @@ |
47 |
|
48 |
debug: |
49 |
$(MAKE) CFLAGS="$(CFLAGS) -DEBUG -g3 -ggdb -fno-pie" clean symlinks |
50 |
- @-/usr/bin/scanelf -o /dev/null -BXxz permsx q |
51 |
+ @-$(EPREFIX)/usr/bin/scanelf -o /dev/null -BXxz permsx q |
52 |
|
53 |
q: $(SRC) libq/*.c *.h libq/*.h |
54 |
ifeq ($(subst s,,$(MAKEFLAGS)),$(MAKEFLAGS)) |
55 |
|
56 |
|
57 |
|
58 |
1.162 portage-utils/main.c |
59 |
|
60 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/portage-utils/main.c?rev=1.162&view=markup |
61 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/portage-utils/main.c?rev=1.162&content-type=text/plain |
62 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/portage-utils/main.c?r1=1.161&r2=1.162 |
63 |
|
64 |
Index: main.c |
65 |
=================================================================== |
66 |
RCS file: /var/cvsroot/gentoo-projects/portage-utils/main.c,v |
67 |
retrieving revision 1.161 |
68 |
retrieving revision 1.162 |
69 |
diff -u -r1.161 -r1.162 |
70 |
--- main.c 24 Mar 2009 18:53:33 -0000 1.161 |
71 |
+++ main.c 24 Mar 2009 20:53:24 -0000 1.162 |
72 |
@@ -1,7 +1,7 @@ |
73 |
/* |
74 |
* Copyright 2005-2008 Gentoo Foundation |
75 |
* Distributed under the terms of the GNU General Public License v2 |
76 |
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/main.c,v 1.161 2009/03/24 18:53:33 grobian Exp $ |
77 |
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/main.c,v 1.162 2009/03/24 20:53:24 grobian Exp $ |
78 |
* |
79 |
* Copyright 2005-2008 Ned Ludd - <solar@g.o> |
80 |
* Copyright 2005-2008 Mike Frysinger - <vapier@g.o> |
81 |
@@ -56,15 +56,15 @@ |
82 |
char pretend = 0; |
83 |
char reinitialize = 0; |
84 |
char reinitialize_metacache = 0; |
85 |
-char portdir[_Q_PATH_MAX] = "/usr/portage"; |
86 |
-char portarch[20] = ""; |
87 |
+char portdir[_Q_PATH_MAX] = EPREFIX "/usr/portage"; |
88 |
+char portarch[20] = ""; |
89 |
char portvdb[_Q_PATH_MAX] = "var/db/pkg"; |
90 |
char portcachedir[] = "metadata/cache"; |
91 |
char portroot[_Q_PATH_MAX] = "/"; |
92 |
-char config_protect[_Q_PATH_MAX] = "/etc/"; |
93 |
+char config_protect[_Q_PATH_MAX] = EPREFIX "/etc/"; |
94 |
|
95 |
-char pkgdir[512] = "/usr/portage/packages/"; |
96 |
-char port_tmpdir[512] = "/var/tmp/portage/"; |
97 |
+char pkgdir[512] = EPREFIX "/usr/portage/packages/"; |
98 |
+char port_tmpdir[512] = EPREFIX "/var/tmp/portage/"; |
99 |
|
100 |
char binhost[1024] = PORTAGE_BINHOST; |
101 |
char features[2048] = "noman noinfo nodoc"; |
102 |
@@ -475,9 +475,10 @@ |
103 |
struct stat st; |
104 |
FILE *fp; |
105 |
char buf[BUFSIZE], *s, *p; |
106 |
+ char *e = EPREFIX; |
107 |
|
108 |
char profile[_Q_PATH_MAX], portage_file[_Q_PATH_MAX]; |
109 |
- const char *files[] = {portage_file, "/etc/make.globals", "/etc/make.conf"}; |
110 |
+ const char *files[] = {portage_file, EPREFIX "/etc/make.globals", EPREFIX "/etc/make.conf"}; |
111 |
typedef enum { _Q_BOOL, _Q_STR, _Q_ISTR } var_types; |
112 |
struct { |
113 |
const char *name; |
114 |
@@ -503,6 +504,10 @@ |
115 |
if (s) { |
116 |
strncpy(portvdb, s, sizeof(portvdb)); |
117 |
portvdb[sizeof(portvdb) - 1] = '\0'; |
118 |
+ } else if ((i = strlen(e)) > 1) { |
119 |
+ memmove(portvdb + i, portvdb, strlen(portvdb)); |
120 |
+ memcpy(portvdb, e + 1, i - 1); |
121 |
+ portvdb[i - 1] = '/'; |
122 |
} |
123 |
|
124 |
if ((p = strchr(portroot, '/')) != NULL) |
125 |
@@ -510,15 +515,15 @@ |
126 |
strncat(portroot, "/", sizeof(portroot)); |
127 |
|
128 |
f = 0; |
129 |
- profilelen = readlink("/etc/make.profile", profile, sizeof(profile) - 1); |
130 |
+ profilelen = readlink(EPREFIX "/etc/make.profile", profile, sizeof(profile) - 1); |
131 |
if (profilelen == -1) |
132 |
- strcpy(profile, "/etc/make.profile"); |
133 |
+ strcpy(profile, EPREFIX "/etc/make.profile"); |
134 |
else |
135 |
profile[profilelen]='\0'; |
136 |
|
137 |
if (profile[0] != '/') { |
138 |
- memmove(profile+5, profile, strlen(profile)+1); |
139 |
- memcpy(profile, "/etc/", 5); |
140 |
+ memmove(profile+5+strlen(EPREFIX), profile, strlen(profile)+1); |
141 |
+ memcpy(profile, EPREFIX "/etc/", strlen(EPREFIX) + 5); |
142 |
} |
143 |
do { |
144 |
if (f == 0) |
145 |
@@ -1057,7 +1062,7 @@ |
146 |
|
147 |
#ifdef ENABLE_NLS /* never tested */ |
148 |
setlocale(LC_ALL, ""); |
149 |
- bindtextdomain(argv0, "/usr/share/locale"); |
150 |
+ bindtextdomain(argv0, EPREFIX "/usr/share/locale"); |
151 |
textdomain(argv0); |
152 |
#endif |
153 |
#if 1 |
154 |
|
155 |
|
156 |
|
157 |
1.45 portage-utils/qlop.c |
158 |
|
159 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/portage-utils/qlop.c?rev=1.45&view=markup |
160 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/portage-utils/qlop.c?rev=1.45&content-type=text/plain |
161 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/portage-utils/qlop.c?r1=1.44&r2=1.45 |
162 |
|
163 |
Index: qlop.c |
164 |
=================================================================== |
165 |
RCS file: /var/cvsroot/gentoo-projects/portage-utils/qlop.c,v |
166 |
retrieving revision 1.44 |
167 |
retrieving revision 1.45 |
168 |
diff -u -r1.44 -r1.45 |
169 |
--- qlop.c 24 Mar 2009 18:52:09 -0000 1.44 |
170 |
+++ qlop.c 24 Mar 2009 20:53:24 -0000 1.45 |
171 |
@@ -1,7 +1,7 @@ |
172 |
/* |
173 |
* Copyright 2005-2007 Gentoo Foundation |
174 |
* Distributed under the terms of the GNU General Public License v2 |
175 |
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/qlop.c,v 1.44 2009/03/24 18:52:09 grobian Exp $ |
176 |
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qlop.c,v 1.45 2009/03/24 20:53:24 grobian Exp $ |
177 |
* |
178 |
* Copyright 2005-2007 Ned Ludd - <solar@g.o> |
179 |
* Copyright 2005-2007 Mike Frysinger - <vapier@g.o> |
180 |
@@ -27,7 +27,7 @@ |
181 |
# include <sys/sysctl.h> |
182 |
#endif |
183 |
|
184 |
-#define QLOP_DEFAULT_LOGFILE "/var/log/emerge.log" |
185 |
+#define QLOP_DEFAULT_LOGFILE EPREFIX "/var/log/emerge.log" |
186 |
|
187 |
#define QLOP_FLAGS "gtHluscf:" COMMON_FLAGS |
188 |
static struct option const qlop_long_opts[] = { |
189 |
@@ -52,7 +52,7 @@ |
190 |
"Read emerge logfile instead of " QLOP_DEFAULT_LOGFILE, |
191 |
COMMON_OPTS_HELP |
192 |
}; |
193 |
-static const char qlop_rcsid[] = "$Id: qlop.c,v 1.44 2009/03/24 18:52:09 grobian Exp $"; |
194 |
+static const char qlop_rcsid[] = "$Id: qlop.c,v 1.45 2009/03/24 20:53:24 grobian Exp $"; |
195 |
#define qlop_usage(ret) usage(ret, QLOP_FLAGS, qlop_long_opts, qlop_opts_help, lookup_applet_idx("qlop")) |
196 |
|
197 |
#define QLOP_LIST 0x01 |
198 |
@@ -554,7 +554,7 @@ |
199 |
#else |
200 |
void show_current_emerge(void) |
201 |
{ |
202 |
- errf("not supported on your crapbox OS"); |
203 |
+ errf("not supported on your OS"); |
204 |
} |
205 |
#endif |