summaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2011-06-07 02:27:27 +0200
committerDave Reisner <d@falconindy.com>2011-06-19 23:33:34 +0200
commit77beaa3018f5cacf8bc51251b50e76041c7eb6cd (patch)
treee27bc2089fc70fcc3fe781db19370a8e047e5033 /functions
parentf751758256ca9ab3db2b73e157542a2719296603 (diff)
downloadmkinitcpio-77beaa3018f5cacf8bc51251b50e76041c7eb6cd.tar.gz
mkinitcpio-77beaa3018f5cacf8bc51251b50e76041c7eb6cd.tar.xz
add -t option to specify alternate build directory
This requires some refactoring of how we handle TMPDIR declaration and creation, as well as protecting the way we do cleanup so that we don't error out when cleanup is called prior to TMPDIR being declared. We also add a shortcut to the build root based on the TMPDIR for convenience. Signed-off-by: Dave Reisner <d@falconindy.com>
Diffstat (limited to 'functions')
-rw-r--r--functions10
1 files changed, 5 insertions, 5 deletions
diff --git a/functions b/functions
index a4f6c0c..dbbcb3c 100644
--- a/functions
+++ b/functions
@@ -132,9 +132,9 @@ add_dir() {
# Add a directory to the initcpio image.
# $1: absolute path of directory on image
- if [[ ! -e "$TMPDIR/root/$1" ]]; then
+ if [[ ! -e "$BUILDROOT/$1" ]]; then
(( QUIET )) || plain "adding dir: %s" "$1"
- command install -dm755 "$TMPDIR/root/$1"
+ command install -dm755 "$BUILDROOT/$1"
fi
}
@@ -148,7 +148,7 @@ add_symlink() {
add_dir $(get_dirname "$file")
if [[ ! -e "$TMPDIR/root/$dest" ]]; then
(( QUIET )) || plain "adding symlink: $file -> $dest"
- ln -s "$dest" "$TMPDIR/root/$file"
+ ln -s "$dest" "$BUILDROOT/$file"
fi
}
@@ -170,9 +170,9 @@ add_file() {
return
fi
- if [[ ! -e "$TMPDIR/root/$dest" ]]; then
+ if [[ ! -e "$BUILDROOT/$dest" ]]; then
(( QUIET )) || plain "adding file: %s" "$dest"
- command install -Dm$(stat -c '%a' "$file") "$file" "$TMPDIR/root/$dest"
+ command install -Dm$(stat -c '%a' "$file") "$file" "$BUILDROOT/$dest"
fi
else
error "file '$file' does not exist"