diff options
Diffstat (limited to 'meta/packages/pseudo/pseudo/path-munge.patch')
-rw-r--r-- | meta/packages/pseudo/pseudo/path-munge.patch | 161 |
1 files changed, 161 insertions, 0 deletions
diff --git a/meta/packages/pseudo/pseudo/path-munge.patch b/meta/packages/pseudo/pseudo/path-munge.patch new file mode 100644 index 0000000000..2327f2e5af --- /dev/null +++ b/meta/packages/pseudo/pseudo/path-munge.patch | |||
@@ -0,0 +1,161 @@ | |||
1 | Pseudo 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 | ||
3 | with --data, and defaults to pseudo's way if it's not set. | ||
4 | |||
5 | JL 14/07/10 | ||
6 | |||
7 | Index: git/Makefile.in | ||
8 | =================================================================== | ||
9 | --- git.orig/Makefile.in 2010-07-14 16:50:45.772094105 +0100 | ||
10 | +++ git/Makefile.in 2010-07-14 16:50:45.897400059 +0100 | ||
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 | ||
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) \ | ||
36 | Index: git/configure | ||
37 | =================================================================== | ||
38 | --- git.orig/configure 2010-03-25 17:57:24.000000000 +0000 | ||
39 | +++ git/configure 2010-07-14 16:50:45.897400059 +0100 | ||
40 | @@ -20,13 +20,14 @@ | ||
41 | # not a real configure script... | ||
42 | opt_prefix= | ||
43 | opt_suffix= | ||
44 | +opt_data= | ||
45 | opt_bits=32 | ||
46 | opt_sqlite=/usr | ||
47 | |||
48 | usage() | ||
49 | { | ||
50 | echo >&2 "usage:" | ||
51 | - echo >&2 " configure --prefix=... [--suffix=...] [--with-sqlite=...] [--bits=32|64]" | ||
52 | + echo >&2 " configure --prefix=... [--suffix=...] [--data=...] [--with-sqlite=...] [--bits=32|64]" | ||
53 | exit 1 | ||
54 | } | ||
55 | |||
56 | @@ -43,6 +44,9 @@ | ||
57 | --suffix=*) | ||
58 | opt_suffix=${arg#--suffix=} | ||
59 | ;; | ||
60 | + --data=*) | ||
61 | + opt_data=${arg#--data=} | ||
62 | + ;; | ||
63 | --bits=*) | ||
64 | opt_bits=${arg#--bits=} | ||
65 | case $opt_bits in | ||
66 | @@ -65,6 +69,7 @@ | ||
67 | sed -e ' | ||
68 | s,@PREFIX@,'"$opt_prefix"',g | ||
69 | s,@SUFFIX@,'"$opt_suffix"',g | ||
70 | + s,@DATA@,'"$opt_data"',g | ||
71 | s,@SQLITE@,'"$opt_sqlite"',g | ||
72 | s,@MARK64@,'"$opt_mark64"',g | ||
73 | s,@BITS@,'"$opt_bits"',g | ||
74 | Index: git/pseudo.c | ||
75 | =================================================================== | ||
76 | --- git.orig/pseudo.c 2010-03-25 17:57:24.000000000 +0000 | ||
77 | +++ git/pseudo.c 2010-07-14 16:50:45.898400595 +0100 | ||
78 | @@ -191,7 +191,7 @@ | ||
79 | pseudo_new_pid(); | ||
80 | |||
81 | pseudo_debug(3, "opening lock.\n"); | ||
82 | - lockname = pseudo_prefix_path(PSEUDO_LOCKFILE); | ||
83 | + lockname = strdup(PSEUDO_LOCKFILE); | ||
84 | if (!lockname) { | ||
85 | pseudo_diag("Couldn't allocate a file path.\n"); | ||
86 | exit(1); | ||
87 | Index: git/pseudo.h | ||
88 | =================================================================== | ||
89 | --- git.orig/pseudo.h 2010-03-25 17:57:24.000000000 +0000 | ||
90 | +++ git/pseudo.h 2010-07-14 16:50:45.899360463 +0100 | ||
91 | @@ -121,8 +121,7 @@ | ||
92 | |||
93 | extern char *pseudo_version; | ||
94 | |||
95 | -#define PSEUDO_DATA "var/pseudo/" | ||
96 | -#define PSEUDO_LOCKFILE PSEUDO_DATA "pseudo.lock" | ||
97 | -#define PSEUDO_LOGFILE PSEUDO_DATA "pseudo.log" | ||
98 | -#define PSEUDO_PIDFILE PSEUDO_DATA "pseudo.pid" | ||
99 | -#define PSEUDO_SOCKET PSEUDO_DATA "pseudo.socket" | ||
100 | +#define PSEUDO_LOCKFILE PSEUDO_DATA "/pseudo.lock" | ||
101 | +#define PSEUDO_LOGFILE PSEUDO_DATA "/pseudo.log" | ||
102 | +#define PSEUDO_PIDFILE PSEUDO_DATA "/pseudo.pid" | ||
103 | +#define PSEUDO_SOCKET PSEUDO_DATA "/pseudo.socket" | ||
104 | Index: git/pseudo_db.c | ||
105 | =================================================================== | ||
106 | --- git.orig/pseudo_db.c 2010-03-25 17:57:24.000000000 +0000 | ||
107 | +++ git/pseudo_db.c 2010-07-14 16:51:07.506464213 +0100 | ||
108 | @@ -458,11 +458,11 @@ | ||
109 | if (*db) | ||
110 | return 0; | ||
111 | if (db == &file_db) { | ||
112 | - dbfile = pseudo_prefix_path(PSEUDO_DATA "files.db"); | ||
113 | + dbfile = strdup(PSEUDO_DATA "/files.db"); | ||
114 | rc = sqlite3_open(dbfile, db); | ||
115 | free(dbfile); | ||
116 | } else { | ||
117 | - dbfile = pseudo_prefix_path(PSEUDO_DATA "logs.db"); | ||
118 | + dbfile = strdup(PSEUDO_DATA "/logs.db"); | ||
119 | rc = sqlite3_open(dbfile, db); | ||
120 | free(dbfile); | ||
121 | } | ||
122 | Index: git/pseudo_server.c | ||
123 | =================================================================== | ||
124 | --- git.orig/pseudo_server.c 2010-03-25 17:57:24.000000000 +0000 | ||
125 | +++ git/pseudo_server.c 2010-07-14 16:50:45.901462874 +0100 | ||
126 | @@ -101,9 +101,9 @@ | ||
127 | } | ||
128 | |||
129 | /* cd to the data directory */ | ||
130 | - pseudo_path = pseudo_prefix_path(PSEUDO_DATA); | ||
131 | + pseudo_path = strdup(PSEUDO_DATA); | ||
132 | if (!pseudo_path) { | ||
133 | - pseudo_diag("can't find prefix/%s directory.\n", PSEUDO_DATA); | ||
134 | + pseudo_diag("can't find %s directory.\n", PSEUDO_DATA); | ||
135 | return 1; | ||
136 | } | ||
137 | if (chdir(pseudo_path) == -1) { | ||
138 | @@ -132,9 +132,9 @@ | ||
139 | return 0; | ||
140 | } | ||
141 | setsid(); | ||
142 | - pseudo_path = pseudo_prefix_path(PSEUDO_PIDFILE); | ||
143 | + pseudo_path = strdup(PSEUDO_PIDFILE); | ||
144 | if (!pseudo_path) { | ||
145 | - pseudo_diag("Couldn't get path for prefix/%s\n", PSEUDO_PIDFILE); | ||
146 | + pseudo_diag("Couldn't get path for %s\n", PSEUDO_PIDFILE); | ||
147 | return 1; | ||
148 | } | ||
149 | fp = fopen(pseudo_path, "w"); | ||
150 | @@ -152,9 +152,9 @@ | ||
151 | pseudo_new_pid(); | ||
152 | fclose(stdin); | ||
153 | fclose(stdout); | ||
154 | - pseudo_path = pseudo_prefix_path(PSEUDO_LOGFILE); | ||
155 | + pseudo_path = strdup(PSEUDO_LOGFILE); | ||
156 | if (!pseudo_path) { | ||
157 | - pseudo_diag("can't get path for prefix/%s\n", PSEUDO_LOGFILE); | ||
158 | + pseudo_diag("can't get path for %s\n", PSEUDO_LOGFILE); | ||
159 | return 1; | ||
160 | } | ||
161 | fd = open(pseudo_path, O_WRONLY | O_APPEND | O_CREAT, 0644); | ||