Use "set -o errexit" to error out when a command failed. Make sure parent

directories are created as needed.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35784 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Matt Madia
2010-03-08 02:28:23 +00:00
parent b745c2a919
commit 7eb9b5f4af
3 changed files with 7 additions and 4 deletions
+1
View File
@@ -1,4 +1,5 @@
#!/bin/sh
set -o errexit
# The first argument is the shell script that initializes the variables:
# sourceDir
+3 -2
View File
@@ -1,4 +1,5 @@
#!/bin/sh
set -o errexit
if [ $# -lt 2 ]; then
echo "Usage: $0 <archive> <scripts> ..."
@@ -34,7 +35,7 @@ rm=rm
# clear output dir
$rm -rf $outputDir
$mkdir $outputDir
$mkdir -p $outputDir
# populate output dir
echo "Preparing contents of archive $archive ..."
@@ -47,7 +48,7 @@ done
echo "Building archive $archive ..."
$rm -f $archive
contents=$(cd $outputDir; ls)
tar -C $outputDir --format ustar -czf $archive $contents || exit 1
tar -C $outputDir --format ustar -czf $archive $contents
# clean up
$rm -rf $outputDir
+3 -2
View File
@@ -1,4 +1,5 @@
#!/bin/sh
set -o errexit
if [ $# -lt 2 ]; then
echo "Usage: $0 <archive> <scripts> ..."
@@ -36,7 +37,7 @@ rm=rm
# clear output dir
$rmAttrs -rf $outputDir
$mkdir $outputDir
$mkdir -p $outputDir
# populate output dir
echo "Preparing contents of archive $archive ..."
@@ -55,7 +56,7 @@ cd $cwd
echo "Building archive $archive ..."
$rm -f $archive
cd $outputDir
$zip -ryq $archive . || exit 1
$zip -ryq $archive .
cd $cwd
# clean up