… | |
… | |
180 | shared. If $wait is true, then it will wait until the lock can be |
180 | shared. If $wait is true, then it will wait until the lock can be |
181 | acquired, otherwise it only attempts to acquire it and returns |
181 | acquired, otherwise it only attempts to acquire it and returns |
182 | immediately if it can't. |
182 | immediately if it can't. |
183 | |
183 | |
184 | If successful it returns a lock object - the lock will be given up |
184 | If successful it returns a lock object - the lock will be given up |
185 | when the lock object is destroyed. |
185 | when the lock object is destroyed or when the process exits (even on |
|
|
186 | a crash) and has a good chance of working on network drives as well. |
186 | |
187 | |
187 | If the lock could not be acquired, "undef" is returned. |
188 | If the lock could not be acquired, "undef" is returned. |
188 | |
189 | |
189 | This function will probably go awway in the future, but is provided |
190 | This function is provided to assist applications that want to clean |
190 | to assist applications that want to clean up old versions, see "TIPS |
191 | up old versions, see "TIPS AND TRICKS", below. |
191 | AND TRICKS", below. |
|
|
192 | |
192 | |
193 | TIPS AND TRICKS |
193 | TIPS AND TRICKS |
194 | Gathering files |
194 | Gathering files |
195 | Gathering all the files needed for distribution cna be a big |
195 | Gathering all the files needed for distribution can be a big |
196 | problem. Right now, Urlader does not assist you in this task in any |
196 | problem. Right now, Urlader does not assist you in this task in any |
197 | way, however, just like perl source stripping, it is planned to |
197 | way, however, just like perl source stripping, it is planned to |
198 | unbundle the relevant technology from staticperl |
198 | unbundle the relevant technology from staticperl |
199 | (<http://staticperl.plan9.de>) for use with this module. |
199 | (<http://staticperl.plan9.de>) for use with this module. |
200 | |
200 | |
… | |
… | |
260 | |
260 | |
261 | These can be found at |
261 | These can be found at |
262 | <http://cvs.schmorp.de/deliantra/Deliantra-Client/util/>, but |
262 | <http://cvs.schmorp.de/deliantra/Deliantra-Client/util/>, but |
263 | looking at them can lead to premature blindless. |
263 | looking at them can lead to premature blindless. |
264 | |
264 | |
|
|
265 | Shared Libraries |
|
|
266 | It is often desirable to package shared libraries - for example the |
|
|
267 | Deliantra client packages SD>, Berkely DB, Pango and amny other |
|
|
268 | libraries that are unlikely to be available on the target system. |
|
|
269 | |
|
|
270 | This usually requires some fiddling (see below), and additionally |
|
|
271 | some environment variables to be set. |
|
|
272 | |
|
|
273 | For example, on ELF systems you usually want LD_LIBRARY_PATH=. and |
|
|
274 | on OS X, you want DYLD_LIBRARY_PATH=. (these are effectively the |
|
|
275 | default on windows). |
|
|
276 | |
|
|
277 | These can most easily be specified when building the packfile: |
|
|
278 | |
|
|
279 | urlader-util ... LD_LIBRARY_PATH=. ./perl run |
|
|
280 | |
|
|
281 | Portability: RPATH |
|
|
282 | Often perl is linked against a shared libperl.so - and might be so |
|
|
283 | using an rpath. Perl extensikns likewise might use an rpath, which |
|
|
284 | means the binary will mostly ignore LD_LIBRARY_PATH, which leads to |
|
|
285 | trouble. |
|
|
286 | |
|
|
287 | There is an utility called chrpath, whose -d option can remove the |
|
|
288 | rpath from binaries, shared library and shared objects. |
|
|
289 | |
|
|
290 | Portability: OS X DLL HELL |
|
|
291 | OS X has the most severe form of DLL hell I have seen - if you link |
|
|
292 | against system libraries, which is practically unavoidable, you get |
|
|
293 | libraries of well-known names (e.g. libjpeg) that have nothing to do |
|
|
294 | with what you normally expect libjpeg to be, and there is no way to |
|
|
295 | get your version of libjpeg into your program. |
|
|
296 | |
|
|
297 | Moreover, even if apple ships well-known libraries (e.g. libiconv), |
|
|
298 | they often ship patched versions which have a different ABI or even |
|
|
299 | API then the real releases. |
|
|
300 | |
|
|
301 | The only way aorund this I found was to change all library names in |
|
|
302 | my releases (libjpeg.dylib becomes libdeliantra-jpeg.dylin and so |
|
|
303 | on), by patching the paths in the share dlibraries and shared |
|
|
304 | objects. install-name-tool (with -id and -change) works in many |
|
|
305 | cases, but often paths are embedded indirectly, so you might have to |
|
|
306 | use a *dirty* string replacement. |
|
|
307 | |
|
|
308 | SECURITY CONSIDERATIONS |
|
|
309 | The urlader executable itself does not support setuig/setgid operation, |
|
|
310 | or running with elevated privileges - it does no input sanitisation, and |
|
|
311 | is trivially exploitable. |
|
|
312 | |
265 | AUTHOR |
313 | AUTHOR |
266 | Marc Lehmann <schmorp@schmorp.de> |
314 | Marc Lehmann <schmorp@schmorp.de> |
267 | http://home.schmorp.de/ |
315 | http://home.schmorp.de/ |
268 | |
316 | |