From 77beaa3018f5cacf8bc51251b50e76041c7eb6cd Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Mon, 6 Jun 2011 20:27:27 -0400 Subject: 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 --- functions | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'functions') 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" -- cgit v1.2.3-24-g4f1b