summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/base.bbclass2
-rw-r--r--meta/conf/bitbake.conf5
-rw-r--r--meta/conf/distro/include/poky-default-revisions.inc10
-rw-r--r--meta/packages/pseudo/pseudo/data-as-env.patch382
-rw-r--r--meta/packages/pseudo/pseudo/ld_sacredness.patch76
-rw-r--r--meta/packages/pseudo/pseudo/make_parallel.patch14
-rw-r--r--meta/packages/pseudo/pseudo/path-munge.patch159
-rw-r--r--meta/packages/pseudo/pseudo/tweakflags.patch87
-rw-r--r--meta/packages/pseudo/pseudo_git.bb17
9 files changed, 17 insertions, 735 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 816de3fcf2..a3b5a49621 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -148,7 +148,7 @@ python base_do_setscene () {
148 bb.build.make_stamp("do_setscene", d) 148 bb.build.make_stamp("do_setscene", d)
149} 149}
150do_setscene[selfstamp] = "1" 150do_setscene[selfstamp] = "1"
151do_setscene[dirs] = "${PSEUDO_DATADIR}" 151do_setscene[dirs] = "${PSEUDO_LOCALSTATEDIR}"
152addtask setscene before do_fetch 152addtask setscene before do_fetch
153 153
154addtask fetch 154addtask fetch
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 49ea3fc959..29dab544f7 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -530,9 +530,8 @@ SRC_URI = "file://${FILE}"
530 530
531# We can choose which provider of fake root privileges to use 531# We can choose which provider of fake root privileges to use
532# default is fakeroot but in Poky we use pseudo 532# default is fakeroot but in Poky we use pseudo
533# this is hopefully only temporary, to work around the database becoming corrupt 533PSEUDO_LOCALSTATEDIR ?= "${WORKDIR}/pseudo/"
534PSEUDO_DATADIR ?= "${WORKDIR}/pseudo/" 534FAKEROOT = "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native} PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR} PSEUDO_NOSYMLINKEXP=1 pseudo"
535FAKEROOT = "PSEUDO_DATADIR=${PSEUDO_DATADIR} PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native} PSEUDO_NOSYMLINKEXP=1 pseudo"
536PREFERRED_PROVIDER_virtual/fakeroot-native ?= "pseudo-native" 535PREFERRED_PROVIDER_virtual/fakeroot-native ?= "pseudo-native"
537 536
538 537
diff --git a/meta/conf/distro/include/poky-default-revisions.inc b/meta/conf/distro/include/poky-default-revisions.inc
index 2edc019acc..838d09b10e 100644
--- a/meta/conf/distro/include/poky-default-revisions.inc
+++ b/meta/conf/distro/include/poky-default-revisions.inc
@@ -106,11 +106,13 @@ SRCREV_pn-tcf-agent ??= "1078"
106SRCREV_pn-osc-native ??= "9096" 106SRCREV_pn-osc-native ??= "9096"
107SRCREV_pn-owl-video ??= "394" 107SRCREV_pn-owl-video ??= "394"
108SRCREV_pn-pkgconfig ??= "66d49f1375fec838bcd301bb4ca2ef76cee0e47c" 108SRCREV_pn-pkgconfig ??= "66d49f1375fec838bcd301bb4ca2ef76cee0e47c"
109SRCREV_pn-prelink ??= "909470ee441237563d6236c505cb2d02ddc48704" 109PRELINKSRCREV ??= "909470ee441237563d6236c505cb2d02ddc48704"
110SRCREV_pn-prelink-native ??= "909470ee441237563d6236c505cb2d02ddc48704" 110SRCREV_pn-prelink ??= "${PRELINKSRCREV}"
111SRCREV_pn-prelink-native ??= "${PRELINKSRCREV}"
111SRCREV_pn-psplash ??= "424" 112SRCREV_pn-psplash ??= "424"
112SRCREV_pn-pseudo ??= "973e40da8e5abb080cc0b9c9eaff4d84dea5b42c" 113PSEUDOSRCREV ??= "551bf567c171c9f6f475f02de80e35df9563dce7"
113SRCREV_pn-pseudo-native ??= "973e40da8e5abb080cc0b9c9eaff4d84dea5b42c" 114SRCREV_pn-pseudo ??= "${PSEUDOSRCREV}"
115SRCREV_pn-pseudo-native ??= "${PSEUDOSRCREV}"
114QEMUSRCREV ??= "72bb3c7571226af13cfe9eec020a56add3d30a70" 116QEMUSRCREV ??= "72bb3c7571226af13cfe9eec020a56add3d30a70"
115SRCREV_pn-qemu-native ??= "${QEMUSRCREV}" 117SRCREV_pn-qemu-native ??= "${QEMUSRCREV}"
116SRCREV_pn-qemu-nativesdk ??= "${QEMUSRCREV}" 118SRCREV_pn-qemu-nativesdk ??= "${QEMUSRCREV}"
diff --git a/meta/packages/pseudo/pseudo/data-as-env.patch b/meta/packages/pseudo/pseudo/data-as-env.patch
deleted file mode 100644
index 6cef1b316b..0000000000
--- a/meta/packages/pseudo/pseudo/data-as-env.patch
+++ /dev/null
@@ -1,382 +0,0 @@
1We observed the pseudo database becoming large and corrupted when undergoing
2significant use (generating multiple output package types).
3
4This patch checks for the existence of an PSEUDO_DATADIR environment variable
5and, when it exists, uses the directory specified there to store the pseudo
6database. This should enable us to use a different database for each run of
7pseudo.
8
9JL (23/07/10)
10
11Updates to include lock/log/socket/pid files
12
13RP (24/07/10)
14
15Index: git/pseudo.h
16===================================================================
17--- git.orig/pseudo.h 2010-07-24 00:28:35.762423800 +0100
18+++ git/pseudo.h 2010-07-24 10:34:33.902335659 +0100
19@@ -123,6 +123,7 @@
20 extern char *pseudo_fix_path(const char *, const char *, size_t, size_t, size_t *, int);
21 extern char **pseudo_dropenv(char * const *);
22 extern char **pseudo_setupenv(char * const *, char *);
23+extern char *pseudo_data_path(char *);
24 extern char *pseudo_prefix_path(char *);
25 extern char *pseudo_get_prefix(char *);
26 extern int pseudo_logfile(char *defname);
27@@ -134,10 +135,16 @@
28
29 extern char *pseudo_version;
30
31-#define PSEUDO_LOCKFILE PSEUDO_DATA "/pseudo.lock"
32-#define PSEUDO_LOGFILE PSEUDO_DATA "/pseudo.log"
33-#define PSEUDO_PIDFILE PSEUDO_DATA "/pseudo.pid"
34-#define PSEUDO_SOCKET PSEUDO_DATA "/pseudo.socket"
35+#define PSEUDO_LOCKFILE "/pseudo.lock"
36+#define PSEUDO_LOGFILE "/pseudo.log"
37+#define PSEUDO_PIDFILE "/pseudo.pid"
38+#define PSEUDO_SOCKET "/pseudo.socket"
39+
40+extern char *pseudo_get_pid();
41+extern char *pseudo_get_lockfile();
42+extern char *pseudo_get_logfile();
43+extern char *pseudo_get_socketfile();
44+
45
46 /* some systems might not have *at(). We like to define operations in
47 * terms of each other, and for instance, open(...) is the same as
48Index: git/pseudo_db.c
49===================================================================
50--- git.orig/pseudo_db.c 2010-07-24 00:28:35.762423800 +0100
51+++ git/pseudo_db.c 2010-07-24 00:28:36.282335730 +0100
52@@ -465,17 +465,18 @@
53 char *errmsg;
54 static int registered_cleanup = 0;
55 char *dbfile;
56+ char *data_dir;
57
58 if (!db)
59 return 1;
60 if (*db)
61 return 0;
62 if (db == &file_db) {
63- dbfile = strdup(PSEUDO_DATA "/files.db");
64+ dbfile = pseudo_data_path("files.db");
65 rc = sqlite3_open(dbfile, db);
66 free(dbfile);
67 } else {
68- dbfile = strdup(PSEUDO_DATA "/logs.db");
69+ dbfile = pseudo_data_path("logs.db");
70 rc = sqlite3_open(dbfile, db);
71 free(dbfile);
72 }
73Index: git/pseudo_server.c
74===================================================================
75--- git.orig/pseudo_server.c 2010-07-24 00:28:35.762423800 +0100
76+++ git/pseudo_server.c 2010-07-24 10:27:59.242335869 +0100
77@@ -107,7 +107,7 @@
78 }
79
80 /* cd to the data directory */
81- pseudo_path = strdup(PSEUDO_DATA);
82+ pseudo_path = pseudo_data_path(NULL);
83 if (!pseudo_path) {
84 pseudo_diag("can't find %s directory.\n", PSEUDO_DATA);
85 return 1;
86@@ -138,9 +138,9 @@
87 return 0;
88 }
89 setsid();
90- pseudo_path = strdup(PSEUDO_PIDFILE);
91+ pseudo_path = pseudo_get_pid();
92 if (!pseudo_path) {
93- pseudo_diag("Couldn't get path for %s\n", PSEUDO_PIDFILE);
94+ pseudo_diag("Couldn't get pid path\n");
95 return 1;
96 }
97 fp = fopen(pseudo_path, "w");
98@@ -156,7 +156,7 @@
99 pseudo_new_pid();
100 fclose(stdin);
101 fclose(stdout);
102- if (!pseudo_logfile(PSEUDO_LOGFILE))
103+ if (!pseudo_logfile(pseudo_get_logfile()))
104 fclose(stderr);
105 }
106 signal(SIGHUP, quit_now);
107Index: git/pseudo_util.c
108===================================================================
109--- git.orig/pseudo_util.c 2010-07-24 00:28:35.962336149 +0100
110+++ git/pseudo_util.c 2010-07-24 10:50:48.062336358 +0100
111@@ -593,6 +593,50 @@
112 return new_environ;
113 }
114
115+/* get the full path to the datadir for this run of pseudo
116+ * file parameter is optional and returns the datadir path
117+ * with the file name appended.
118+ */
119+char *
120+pseudo_data_path(char *file) {
121+ static char *datadir = NULL;
122+ static size_t datadir_len;
123+ char *path;
124+
125+ if (!datadir) {
126+ datadir = getenv("PSEUDO_DATADIR");
127+ if (!datadir) {
128+ datadir = strdup(PSEUDO_DATA);
129+ }
130+ datadir_len = strlen(datadir);
131+ }
132+
133+ if (!file) {
134+ return strdup(datadir);
135+ } else {
136+ size_t len = datadir_len + strlen(file) + 2;
137+ path = malloc(len);
138+ if (path) {
139+ char *endptr;
140+ int rc;
141+
142+ rc = snprintf(path, len, "%s", datadir);
143+ /* this certainly SHOULD be impossible */
144+ if ((size_t) rc >= len)
145+ rc = len - 1;
146+ endptr = path + rc;
147+ /* strip extra slashes.
148+ * This probably has no real effect, but I don't like
149+ * seeing " //" in paths.
150+ */
151+ while ((endptr > path) && (endptr[-1] == '/'))
152+ --endptr;
153+ snprintf(endptr, len - (endptr - path), "/%s", file);
154+ }
155+ return path;
156+ }
157+}
158+
159 /* get the full path to a file under $PSEUDO_PREFIX. Other ways of
160 * setting the prefix all set it in the environment.
161 */
162@@ -691,6 +735,26 @@
163 return s;
164 }
165
166+char *
167+pseudo_get_pid() {
168+ return pseudo_data_path(PSEUDO_PIDFILE);
169+}
170+
171+char *
172+pseudo_get_lockfile() {
173+ return pseudo_data_path(PSEUDO_LOCKFILE);
174+}
175+
176+char *
177+pseudo_get_logfile() {
178+ return pseudo_data_path(PSEUDO_LOGFILE);
179+}
180+
181+char *
182+pseudo_get_socketfile() {
183+ return pseudo_data_path(PSEUDO_SOCKET);
184+}
185+
186 /* these functions define the sizes pseudo will try to use
187 * when trying to allocate space, or guess how much space
188 * other people will have allocated; see the GNU man page
189@@ -844,20 +908,14 @@
190
191 /* set up a log file */
192 int
193-pseudo_logfile(char *defname) {
194- char *pseudo_path;
195+pseudo_logfile(char *pseudo_path) {
196 char *filename, *s;
197 extern char *program_invocation_short_name; /* glibcism */
198 int fd;
199
200 if ((filename = getenv("PSEUDO_DEBUG_FILE")) == NULL) {
201- if (!defname) {
202- pseudo_debug(3, "no special log file requested, using stderr.\n");
203- return -1;
204- }
205- pseudo_path = strdup(defname);
206 if (!pseudo_path) {
207- pseudo_diag("can't get path for prefix/%s\n", PSEUDO_LOGFILE);
208+ pseudo_debug(3, "no special log file requested or unable to malloc space, using stderr.\n");
209 return -1;
210 }
211 } else {
212@@ -903,6 +961,7 @@
213 len += 8;
214 if (prog)
215 len += strlen(program_invocation_short_name);
216+ free(pseudo_path);
217 pseudo_path = malloc(len);
218 if (!pseudo_path) {
219 pseudo_diag("can't allocate space for debug file name.\n");
220Index: git/pseudo.c
221===================================================================
222--- git.orig/pseudo.c 2010-07-24 10:22:10.053594896 +0100
223+++ git/pseudo.c 2010-07-24 10:23:20.883585467 +0100
224@@ -272,7 +272,7 @@
225 pseudo_new_pid();
226
227 pseudo_debug(3, "opening lock.\n");
228- lockname = strdup(PSEUDO_LOCKFILE);
229+ lockname = pseudo_get_lockfile();
230 if (!lockname) {
231 pseudo_diag("Couldn't allocate a file path.\n");
232 exit(EXIT_FAILURE);
233Index: git/pseudo_client.c
234===================================================================
235--- git.orig/pseudo_client.c 2010-07-24 10:03:51.933588401 +0100
236+++ git/pseudo_client.c 2010-07-25 00:30:29.152364992 +0100
237@@ -359,6 +359,7 @@
238 FILE *fp;
239 extern char **environ;
240 int cwd_fd;
241+ char *pidpath;
242
243 if ((server_pid = fork()) != 0) {
244 if (server_pid == -1) {
245@@ -383,7 +384,12 @@
246 pseudo_diag("Couldn't change to server dir [%d]: %s\n",
247 pseudo_dir_fd, strerror(errno));
248 }
249- fp = fopen(PSEUDO_PIDFILE, "r");
250+ pidpath = pseudo_get_pid();
251+ if (!pidpath) {
252+ pseudo_diag("Couldn't get pid path\n");
253+ return 1;
254+ }
255+ fp = fopen(pidpath, "r");
256 if (fchdir(cwd_fd) == -1) {
257 pseudo_diag("return to previous directory failed: %s\n",
258 strerror(errno));
259@@ -396,8 +402,9 @@
260 fclose(fp);
261 } else {
262 pseudo_diag("no pid file (%s): %s\n",
263- PSEUDO_PIDFILE, strerror(errno));
264+ pidpath, strerror(errno));
265 }
266+ free(pidpath);
267 pseudo_debug(2, "read new pid file: %d\n", server_pid);
268 /* at this point, we should have a new server_pid */
269 return 0;
270@@ -407,6 +414,8 @@
271 char **new_environ;
272 int args;
273 int fd;
274+ int pseudo_prefix_fd;
275+ char *pseudo_path;
276
277 pseudo_new_pid();
278 base_args[0] = "bin/pseudo";
279@@ -439,9 +448,21 @@
280 } else {
281 argv = base_args;
282 }
283- if (fchdir(pseudo_dir_fd)) {
284+
285+
286+ pseudo_path = pseudo_prefix_path(NULL);
287+ if (pseudo_path) {
288+ pseudo_prefix_fd = open(pseudo_path, O_RDONLY);
289+ pseudo_prefix_fd = pseudo_fd(pseudo_prefix_fd, MOVE_FD);
290+ free(pseudo_path);
291+ } else {
292+ pseudo_diag("No prefix available to to find server.\n");
293+ exit(1);
294+ }
295+
296+ if (fchdir(pseudo_prefix_fd)) {
297 pseudo_diag("Couldn't change to server dir [%d]: %s\n",
298- pseudo_dir_fd, strerror(errno));
299+ pseudo_prefix_fd, strerror(errno));
300 }
301 /* close any higher-numbered fds which might be open,
302 * such as sockets. We don't have to worry about 0 and 1;
303@@ -535,10 +556,17 @@
304
305 static int
306 client_connect(void) {
307+ char *socketfile = pseudo_get_socketfile();
308 /* we have a server pid, is it responsive? */
309- struct sockaddr_un sun = { AF_UNIX, PSEUDO_SOCKET };
310+ struct sockaddr_un sun = { AF_UNIX, "pseudo.socket" };
311 int cwd_fd;
312
313+ if (!socketfile) {
314+ pseudo_diag("Couldn't malloc socketfile");
315+
316+ return 1;
317+ }
318+
319 connect_fd = socket(PF_UNIX, SOCK_STREAM, 0);
320 connect_fd = pseudo_fd(connect_fd, MOVE_FD);
321 if (connect_fd == -1) {
322@@ -564,7 +592,7 @@
323 return 1;
324 }
325 if (connect(connect_fd, (struct sockaddr *) &sun, sizeof(sun)) == -1) {
326- pseudo_debug(3, "can't connect socket to pseudo.socket: (%s)\n", strerror(errno));
327+ pseudo_debug(3, "can't connect socket to %s: (%s)\n", sun.sun_path, strerror(errno));
328 close(connect_fd);
329 if (fchdir(cwd_fd) == -1) {
330 pseudo_diag("return to previous directory failed: %s\n",
331@@ -588,6 +616,7 @@
332 FILE *fp;
333 server_pid = 0;
334 int cwd_fd;
335+ char *pidpath;
336
337 /* avoid descriptor leak, I hope */
338 if (connect_fd >= 0) {
339@@ -604,7 +633,12 @@
340 return 1;
341 }
342 if (fchdir(pseudo_dir_fd) != 1) {
343- fp = fopen(PSEUDO_PIDFILE, "r");
344+ pidpath = pseudo_get_pid();
345+ if (!pidpath) {
346+ pseudo_diag("Couldn't get pid path\n");
347+ return 1;
348+ }
349+ fp = fopen(pidpath, "r");
350 if (fchdir(cwd_fd) == -1) {
351 pseudo_diag("return to previous directory failed: %s\n",
352 strerror(errno));
353@@ -619,6 +653,7 @@
354 pseudo_debug(1, "Opened server PID file, but didn't get a pid.\n");
355 }
356 fclose(fp);
357+ free(pidpath);
358 }
359 if (server_pid) {
360 if (kill(server_pid, 0) == -1) {
361@@ -710,7 +745,7 @@
362 pseudo_msg_t *ack;
363 char *pseudo_path;
364
365- pseudo_path = pseudo_prefix_path(NULL);
366+ pseudo_path = pseudo_data_path(NULL);
367 if (pseudo_dir_fd == -1) {
368 if (pseudo_path) {
369 pseudo_dir_fd = open(pseudo_path, O_RDONLY);
370Index: git/pseudo_wrappers.c
371===================================================================
372--- git.orig/pseudo_wrappers.c 2010-07-25 00:21:35.263587003 +0100
373+++ git/pseudo_wrappers.c 2010-07-25 00:29:03.052345996 +0100
374@@ -180,7 +180,7 @@
375 * value for cwd.
376 */
377 pseudo_client_reset();
378- pseudo_path = pseudo_prefix_path(NULL);
379+ pseudo_path = pseudo_data_path(NULL);
380 if (pseudo_dir_fd == -1) {
381 if (pseudo_path) {
382 pseudo_dir_fd = open(pseudo_path, O_RDONLY);
diff --git a/meta/packages/pseudo/pseudo/ld_sacredness.patch b/meta/packages/pseudo/pseudo/ld_sacredness.patch
deleted file mode 100644
index 568c899d7c..0000000000
--- a/meta/packages/pseudo/pseudo/ld_sacredness.patch
+++ /dev/null
@@ -1,76 +0,0 @@
1Image creation runs under a pseudo context and calls a script which refers
2to the build systems's python. This loads but can find a libpython from staging
3if these are incompatible, anything can break. These scripts should *not* be
4changing LD_LIBRARY_PATH, just adding an LD_PRELOAD with an absolute path. The
5dyanmic linker can figure out anything else with rpaths.
6
7Inspired by RP's patch of a similar intent for fakeroot
8
9JL 15/07/10
10(updated 20/7/2010 - MGH)
11
12--- git.orig/pseudo_util.c 2010-07-20 15:34:41.000000000 -0700
13+++ git/pseudo_util.c 2010-07-20 16:00:35.000000000 -0700
14diff -ur git.orig/pseudo_util.c git/pseudo_util.c
15--- git.orig/pseudo_util.c 2010-07-20 17:02:13.000000000 -0700
16+++ git/pseudo_util.c 2010-07-20 17:03:26.000000000 -0700
17@@ -65,7 +65,7 @@
18 * the end of the string or a space after it.
19 */
20 static char *libpseudo_name = "libpseudo.so";
21-static char *libpseudo_pattern = "(=| )libpseudo[^ ]*\\.so($| )";
22+static char *libpseudo_pattern = "(=| )[^ ]*libpseudo[^ ]*\\.so($| )";
23 static regex_t libpseudo_regex;
24 static int libpseudo_regex_compiled = 0;
25
26@@ -499,8 +499,10 @@
27 found_opts = 1;
28 if (!memcmp(environ[i], "PSEUDO_DEBUG=", 13))
29 found_debug = 1;
30+#if 0
31 if (!memcmp(environ[i], "LD_LIBRARY_PATH=", 16))
32 found_libpath = 1;
33+#endif
34 ++env_count;
35 }
36 env_count += 4 - (found_preload + found_libpath + found_debug + found_opts);
37@@ -520,6 +522,7 @@
38 return NULL;
39 }
40 new_environ[j++] = newenv;
41+#if 0
42 } else if (!memcmp(environ[i], "LD_LIBRARY_PATH=", 16)) {
43 if (!strstr(environ[i], PSEUDO_PREFIX)) {
44 char *e1, *e2;
45@@ -537,10 +540,12 @@
46 } else {
47 new_environ[j++] = environ[i];
48 }
49+#endif
50 } else {
51 new_environ[j++] = environ[i];
52 }
53 }
54+#if 0
55 if (!found_libpath) {
56 char *e1, *e2;
57 e1 = pseudo_prefix_path("lib");
58@@ -553,8 +558,18 @@
59 snprintf(newenv, len, "LD_LIBRARY_PATH=%s:%s", e1, e2);
60 new_environ[j++] = newenv;
61 }
62+#endif
63 if (!found_preload) {
64+#if 0
65 new_environ[j++] = "LD_PRELOAD=libpseudo.so";
66+#else
67+ char *libname = "libpseudo.so";
68+ char *prefix = pseudo_prefix_path("lib");
69+ len = 11 + strlen(prefix) + strlen(libname) + 2;
70+ newenv = malloc(len);
71+ snprintf(newenv, len, "LD_PRELOAD=%s/%s", prefix, libname);
72+ new_environ[j++] = newenv;
73+#endif
74 }
75 if (!found_debug && max_debug_level > 0) {
76 len = 16;
diff --git a/meta/packages/pseudo/pseudo/make_parallel.patch b/meta/packages/pseudo/pseudo/make_parallel.patch
deleted file mode 100644
index 697b576f74..0000000000
--- a/meta/packages/pseudo/pseudo/make_parallel.patch
+++ /dev/null
@@ -1,14 +0,0 @@
1Add a missing dependency to fix a problem with building pseudo in a
2parallel build.
3
4--- git.orig/Makefile.in 2010-07-20 16:15:30.000000000 -0700
5+++ git/Makefile.in 2010-07-20 16:15:58.000000000 -0700
6@@ -105,7 +105,7 @@
7
8 .SECONDARY: wrappers
9
10-pseudo_wrapfuncs.c: wrappers
11+pseudo_wrapfuncs.c pseudo_wrapfuncs.h: wrappers
12
13 # no-strict-aliasing is needed for the function pointer trickery.
14 pseudo_wrappers.o: $(GUTS) pseudo_wrappers.c pseudo_wrapfuncs.c pseudo_wrapfuncs.h
diff --git a/meta/packages/pseudo/pseudo/path-munge.patch b/meta/packages/pseudo/pseudo/path-munge.patch
deleted file mode 100644
index 2ccdea17ea..0000000000
--- a/meta/packages/pseudo/pseudo/path-munge.patch
+++ /dev/null
@@ -1,159 +0,0 @@
1Pseudo defaults to storing state files in ${prefix}/var/pseudo, we want them in
2$(localstatedir) so this quick hack makes pseudo use a data directory specified
3with --data, and defaults to pseudo's way if it's not set.
4
5JL 14/07/10
6(updated 20/7/2010 - MGH)
7
8diff -urN git.orig/Makefile.in git/Makefile.in
9--- git.orig/Makefile.in 2010-07-20 15:47:46.000000000 -0700
10+++ git/Makefile.in 2010-07-20 15:43:31.000000000 -0700
11@@ -20,6 +20,7 @@
12 # configuration flags
13 PREFIX=@PREFIX@
14 SUFFIX=@SUFFIX@
15+DATA=@DATA@
16 SQLITE=@SQLITE@
17 BITS=@BITS@
18 MARK64=@MARK64@
19@@ -27,11 +28,15 @@
20
21 LIBDIR=$(PREFIX)/lib
22 BINDIR=$(PREFIX)/bin
23+ifndef DATA
24 DATADIR=$(PREFIX)/var/pseudo
25+else
26+DATADIR=$(DATA)/pseudo
27+endif
28
29 CFLAGS_BASE=-pipe -std=gnu99 -Wall -W -Wextra
30 CFLAGS_CODE=-fPIC -D_LARGEFILE64_SOURCE -D_ATFILE_SOURCE -m$(BITS)
31-CFLAGS_DEFS=-DPSEUDO_PREFIX='"$(PREFIX)"' -DPSEUDO_SUFFIX='"$(SUFFIX)"' -DPSEUDO_VERSION='"$(VERSION)"'
32+CFLAGS_DEFS=-DPSEUDO_PREFIX='"$(PREFIX)"' -DPSEUDO_SUFFIX='"$(SUFFIX)"' -DPSEUDO_VERSION='"$(VERSION)"' -DPSEUDO_DATA='"$(DATADIR)"'
33 CFLAGS_DEBUG=-O2 -g
34 CFLAGS_SQL=-L$(SQLITE)/lib -I$(SQLITE)/include
35 EXTRA_CFLAGS=$(CFLAGS_BASE) $(CFLAGS_CODE) $(CFLAGS_DEFS) \
36diff -urN git.orig/configure git/configure
37--- git.orig/configure 2010-07-20 15:34:41.000000000 -0700
38+++ git/configure 2010-07-20 15:42:23.000000000 -0700
39@@ -20,13 +20,14 @@
40 # not a real configure script...
41 opt_prefix=
42 opt_suffix=
43+opt_data=
44 opt_bits=32
45 opt_sqlite=/usr
46
47 usage()
48 {
49 echo >&2 "usage:"
50- echo >&2 " configure --prefix=... [--suffix=...] [--with-sqlite=...] [--bits=32|64]"
51+ echo >&2 " configure --prefix=... [--suffix=...] [--data=...] [--with-sqlite=...] [--bits=32|64]"
52 exit 1
53 }
54
55@@ -43,6 +44,9 @@
56 --suffix=*)
57 opt_suffix=${arg#--suffix=}
58 ;;
59+ --data=*)
60+ opt_data=${arg#--data=}
61+ ;;
62 --bits=*)
63 opt_bits=${arg#--bits=}
64 case $opt_bits in
65@@ -65,6 +69,7 @@
66 sed -e '
67 s,@PREFIX@,'"$opt_prefix"',g
68 s,@SUFFIX@,'"$opt_suffix"',g
69+ s,@DATA@,'"$opt_data"',g
70 s,@SQLITE@,'"$opt_sqlite"',g
71 s,@MARK64@,'"$opt_mark64"',g
72 s,@BITS@,'"$opt_bits"',g
73diff -urN git.orig/pseudo.c git/pseudo.c
74--- git.orig/pseudo.c 2010-07-20 15:34:41.000000000 -0700
75+++ git/pseudo.c 2010-07-20 15:42:23.000000000 -0700
76@@ -272,7 +272,7 @@
77 pseudo_new_pid();
78
79 pseudo_debug(3, "opening lock.\n");
80- lockname = pseudo_prefix_path(PSEUDO_LOCKFILE);
81+ lockname = strdup(PSEUDO_LOCKFILE);
82 if (!lockname) {
83 pseudo_diag("Couldn't allocate a file path.\n");
84 exit(EXIT_FAILURE);
85diff -urN git.orig/pseudo.h git/pseudo.h
86--- git.orig/pseudo.h 2010-07-20 15:34:41.000000000 -0700
87+++ git/pseudo.h 2010-07-20 15:44:31.000000000 -0700
88@@ -134,11 +134,10 @@
89
90 extern char *pseudo_version;
91
92-#define PSEUDO_DATA "var/pseudo/"
93-#define PSEUDO_LOCKFILE PSEUDO_DATA "pseudo.lock"
94-#define PSEUDO_LOGFILE PSEUDO_DATA "pseudo.log"
95-#define PSEUDO_PIDFILE PSEUDO_DATA "pseudo.pid"
96-#define PSEUDO_SOCKET PSEUDO_DATA "pseudo.socket"
97+#define PSEUDO_LOCKFILE PSEUDO_DATA "/pseudo.lock"
98+#define PSEUDO_LOGFILE PSEUDO_DATA "/pseudo.log"
99+#define PSEUDO_PIDFILE PSEUDO_DATA "/pseudo.pid"
100+#define PSEUDO_SOCKET PSEUDO_DATA "/pseudo.socket"
101
102 /* some systems might not have *at(). We like to define operations in
103 * terms of each other, and for instance, open(...) is the same as
104diff -urN git.orig/pseudo_db.c git/pseudo_db.c
105--- git.orig/pseudo_db.c 2010-07-20 15:34:41.000000000 -0700
106+++ git/pseudo_db.c 2010-07-20 15:42:23.000000000 -0700
107@@ -471,11 +471,11 @@
108 if (*db)
109 return 0;
110 if (db == &file_db) {
111- dbfile = pseudo_prefix_path(PSEUDO_DATA "files.db");
112+ dbfile = strdup(PSEUDO_DATA "/files.db");
113 rc = sqlite3_open(dbfile, db);
114 free(dbfile);
115 } else {
116- dbfile = pseudo_prefix_path(PSEUDO_DATA "logs.db");
117+ dbfile = strdup(PSEUDO_DATA "/logs.db");
118 rc = sqlite3_open(dbfile, db);
119 free(dbfile);
120 }
121diff -urN git.orig/pseudo_server.c git/pseudo_server.c
122--- git.orig/pseudo_server.c 2010-07-20 15:34:41.000000000 -0700
123+++ git/pseudo_server.c 2010-07-20 15:46:09.000000000 -0700
124@@ -107,9 +107,9 @@
125 }
126
127 /* cd to the data directory */
128- pseudo_path = pseudo_prefix_path(PSEUDO_DATA);
129+ pseudo_path = strdup(PSEUDO_DATA);
130 if (!pseudo_path) {
131- pseudo_diag("can't find prefix/%s directory.\n", PSEUDO_DATA);
132+ pseudo_diag("can't find %s directory.\n", PSEUDO_DATA);
133 return 1;
134 }
135 if (chdir(pseudo_path) == -1) {
136@@ -138,9 +138,9 @@
137 return 0;
138 }
139 setsid();
140- pseudo_path = pseudo_prefix_path(PSEUDO_PIDFILE);
141+ pseudo_path = strdup(PSEUDO_PIDFILE);
142 if (!pseudo_path) {
143- pseudo_diag("Couldn't get path for prefix/%s\n", PSEUDO_PIDFILE);
144+ pseudo_diag("Couldn't get path for %s\n", PSEUDO_PIDFILE);
145 return 1;
146 }
147 fp = fopen(pseudo_path, "w");
148diff -ur git.orig/pseudo_util.c git/pseudo_util.c
149--- git.orig/pseudo_util.c 2010-07-20 17:06:22.000000000 -0700
150+++ git/pseudo_util.c 2010-07-20 17:10:50.000000000 -0700
151@@ -855,7 +855,7 @@
152 pseudo_debug(3, "no special log file requested, using stderr.\n");
153 return -1;
154 }
155- pseudo_path = pseudo_prefix_path(defname);
156+ pseudo_path = strdup(defname);
157 if (!pseudo_path) {
158 pseudo_diag("can't get path for prefix/%s\n", PSEUDO_LOGFILE);
159 return -1;
diff --git a/meta/packages/pseudo/pseudo/tweakflags.patch b/meta/packages/pseudo/pseudo/tweakflags.patch
deleted file mode 100644
index a7458f5f4a..0000000000
--- a/meta/packages/pseudo/pseudo/tweakflags.patch
+++ /dev/null
@@ -1,87 +0,0 @@
1CFLAGS is overridden from the environment by Poky. We need boths sets of
2flags so we adjust the Makefile accordingly.
3
4Also the default target is "test" which runs install which we don't want
5until "make install" time when DESTDIR is set. Change the first target
6to "all" for this reason.
7
8RP 18/3/10
9(updated 20/7/2010 - MGH)
10
11--- git.orig/Makefile.in 2010-07-20 15:34:41.000000000 -0700
12+++ git/Makefile.in 2010-07-20 15:40:42.000000000 -0700
13@@ -25,7 +25,7 @@
14 MARK64=@MARK64@
15 VERSION=0.3
16
17-LIBDIR=$(PREFIX)/lib$(MARK64)
18+LIBDIR=$(PREFIX)/lib
19 BINDIR=$(PREFIX)/bin
20 DATADIR=$(PREFIX)/var/pseudo
21
22@@ -34,7 +34,7 @@
23 CFLAGS_DEFS=-DPSEUDO_PREFIX='"$(PREFIX)"' -DPSEUDO_SUFFIX='"$(SUFFIX)"' -DPSEUDO_VERSION='"$(VERSION)"'
24 CFLAGS_DEBUG=-O2 -g
25 CFLAGS_SQL=-L$(SQLITE)/lib -I$(SQLITE)/include
26-CFLAGS=$(CFLAGS_BASE) $(CFLAGS_CODE) $(CFLAGS_DEFS) \
27+EXTRA_CFLAGS=$(CFLAGS_BASE) $(CFLAGS_CODE) $(CFLAGS_DEFS) \
28 $(CFLAGS_DEBUG) $(CFLAGS_SQL)
29
30 GLOB_PATTERN=guts/*.c
31@@ -47,11 +47,11 @@
32 DBOBJS=pseudo_db.o -ldl -lpthread
33 WRAPOBJS=pseudo_wrappers.o
34
35+all: libpseudo.so pseudo pseudodb pseudolog
36+
37 test: install
38 @echo "No tests yet."
39
40-all: libpseudo.so pseudo pseudodb pseudolog
41-
42 install-lib: libpseudo.so
43 mkdir -p $(DESTDIR)$(LIBDIR)
44 cp libpseudo*.so $(DESTDIR)$(LIBDIR)
45@@ -66,26 +66,29 @@
46 install: all install-lib install-bin install-data
47
48 pseudo: pseudo.o $(SHOBJS) $(DBOBJS) pseudo_client.o pseudo_server.o pseudo_ipc.o
49- $(CC) $(CFLAGS) -o pseudo \
50+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o pseudo \
51 pseudo.o pseudo_server.o pseudo_client.o pseudo_ipc.o \
52 $(DBOBJS) $(SHOBJS) $(DBLDFLAGS)
53
54 pseudolog: pseudolog.o $(SHOBJS) $(DBOBJS) pseudo_client.o pseudo_ipc.o
55- $(CC) $(CFLAGS) -o pseudolog pseudolog.o pseudo_client.o pseudo_ipc.o \
56+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o pseudolog pseudolog.o pseudo_client.o pseudo_ipc.o \
57 $(DBOBJS) $(SHOBJS) $(DBLDFLAGS)
58
59 pseudodb: pseudodb.o $(SHOBJS) $(DBOBJS) pseudo_ipc.o
60- $(CC) $(CFLAGS) -o pseudodb pseudodb.o \
61+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o pseudodb pseudodb.o \
62 $(DBOBJS) $(SHOBJS) $(DBLDFLAGS) pseudo_ipc.o
63
64 libpseudo.so: $(WRAPOBJS) pseudo_client.o pseudo_ipc.o $(SHOBJS)
65- $(CC) $(CFLAGS) -shared -o libpseudo.so \
66+ $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -shared -o libpseudo.so \
67 pseudo_client.o pseudo_ipc.o \
68 $(WRAPOBJS) $(SHOBJS) -ldl
69 if test -n "$(SUFFIX)"; then \
70 cp libpseudo.so libpseudo$(SUFFIX).so ; \
71 fi
72
73+%.o: %.c
74+ $(CC) -c $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) $<
75+
76 pseudo_client.o pseudo_server.o pseudo_ipc.o: pseudo_ipc.h
77
78 pseudo_client.o: pseudo_client.h
79@@ -101,7 +104,7 @@
80
81 # no-strict-aliasing is needed for the function pointer trickery.
82 pseudo_wrappers.o: $(GUTS) pseudo_wrappers.c pseudo_wrapfuncs.c pseudo_wrapfuncs.h
83- $(CC) -fno-strict-aliasing $(CFLAGS) -D_GNU_SOURCE -c -o pseudo_wrappers.o pseudo_wrappers.c
84+ $(CC) -fno-strict-aliasing $(CFLAGS) $(EXTRA_CFLAGS) -D_GNU_SOURCE -c -o pseudo_wrappers.o pseudo_wrappers.c
85
86 offsets32:
87 $(CC) -m32 -o offsets32 offsets.c
diff --git a/meta/packages/pseudo/pseudo_git.bb b/meta/packages/pseudo/pseudo_git.bb
index 9efed11fbf..78d1720501 100644
--- a/meta/packages/pseudo/pseudo_git.bb
+++ b/meta/packages/pseudo/pseudo_git.bb
@@ -6,15 +6,10 @@ LICENSE = "LGPL2.1"
6DEPENDS = "sqlite3" 6DEPENDS = "sqlite3"
7 7
8PV = "0.0+git${SRCPV}" 8PV = "0.0+git${SRCPV}"
9PR = "r10" 9PR = "r11"
10 10
11SRC_URI = "git://github.com/wrpseudo/pseudo.git;protocol=git \ 11SRC_URI = "git://github.com/wrpseudo/pseudo.git;protocol=git \
12 file://tweakflags.patch \ 12 file://static_sqlite.patch"
13 file://path-munge.patch \
14 file://ld_sacredness.patch \
15 file://make_parallel.patch \
16 file://static_sqlite.patch \
17 file://data-as-env.patch"
18 13
19FILES_${PN} = "${libdir}/libpseudo.so ${bindir}/* ${localstatedir}/pseudo" 14FILES_${PN} = "${libdir}/libpseudo.so ${bindir}/* ${localstatedir}/pseudo"
20PROVIDES += "virtual/fakeroot" 15PROVIDES += "virtual/fakeroot"
@@ -24,11 +19,15 @@ S = "${WORKDIR}/git"
24inherit siteinfo 19inherit siteinfo
25 20
26do_configure () { 21do_configure () {
27 ${S}/configure --prefix=${prefix} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=${SITEINFO_BITS} --data=${localstatedir} 22 ${S}/configure --prefix=${prefix} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=${SITEINFO_BITS}
23}
24
25do_compile () {
26 oe_runmake 'LIB=lib/pseudo/lib'
28} 27}
29 28
30do_install () { 29do_install () {
31 oe_runmake 'DESTDIR=${D}' install 30 oe_runmake 'DESTDIR=${D}' 'LIB=lib/pseudo/lib' install
32} 31}
33 32
34BBCLASSEXTEND = "native" 33BBCLASSEXTEND = "native"