summaryrefslogtreecommitdiffstats
path: root/src/filearch.c
Commit message (Collapse)AuthorAgeFilesLines
* lib: Rework temporary and cache directory code.Richard W.M. Jones2012-11-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New APIs: set-tmpdir, get-tmpdir, set-cachedir, get-cachedir. The current code has evolved over time and has a number of problems: (a) A single environment variable ($TMPDIR) controls the location of several directories. (b) It's hard for the library user to predict which directory libguestfs will use, unless the user simulates the same internal steps that libguestfs performs. This commit fixes these issues. (a) Now three environment variables control the location of all small temporary files, and the appliance cache: For temporary files: $LIBGUESTFS_TMPDIR or $TMPDIR or /tmp. For the appliance cache: $LIBGUESTFS_CACHEDIR or $TMPDIR or /var/tmp. The user can also set these directories explicitly through API calls (guestfs_set_tmpdir and guestfs_set_cachedir). (b) The user can also retrieve the actual directories that libguestfs will use, by calling guestfs_get_tmpdir and guestfs_get_cachedir. These functions are also used internally. This commit also: - reworks the internal tmpdir code - removes the internal (undocumented) guestfs_tmpdir call (replacing it with calls to the documented guestfs_get_tmpdir API instead) - changes the ./run script to set LIBGUESTFS_TMPDIR and LIBGUESTFS_CACHEDIR - adds a test - fixes a few places like libguestfs-make-fixed-appliance which depended on $TMPDIR
* filearch: Use command mini-library to run external cpio command.Richard W.M. Jones2012-10-181-8/+14
|
* lib: Change guestfs___remove_tmpdir function to use command mini-library.Richard W.M. Jones2012-10-181-1/+1
|
* Fix multiple errors where jump skips variable initialization.Richard W.M. Jones2012-09-171-6/+7
| | | | | | | <file>: error: jump skips variable initialization [-Werror=jump-misses-init] This has only just appeared, possibly related to previous gnulib update. In any case, this is just code motion / cleanup.
* lib: Add guestfs___remove_tmpdir helper function.Richard W.M. Jones2011-12-231-6/+1
| | | | | | | This function does 'rm -rf <dir>' for temporary directories, safely working if '<dir>' contains shell meta-characters. Replace existing code for removing directories with this.
* Require PCRE library.Richard W.M. Jones2011-07-251-6/+5
| | | | This library is widely available in distros.
* filearch: Refuse to download initrd if it is huge.Richard W.M. Jones2010-11-131-0/+8
|
* lib: Make pcre, libmagic and hivex libraries optional.Richard Jones2010-11-101-0/+267
This change makes these libraries optional. If they are not available at compile time then certain core API features will be disabled (see below). This also changes PCRE detection to use pkg-config instead of the ad hoc autoconf checks. The large inspect.c file has been split out into separate function-specific files. file-architecture: requires pcre & libmagic inspection: requires pcre & hivex