summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schwager <[email protected]>2012-02-03 13:41:08 (GMT)
committer Daniel Schwager <[email protected]>2012-02-03 13:41:08 (GMT)
commit78d96bffad10463f31db57a9543d6a533c69b529 (patch)
treeabbb1ab6298826c220e0a536a041445f95f55270
parent72c8c4b9a9a3b13cc030b139678b7d6e76a64e88 (diff)
Improvement: commands (7z, unzip, ..) are defined by global variables now. Added checking of command's availablility.
-rw-r--r--lib/builder-targets.sh10
-rw-r--r--lib/builder-utils.sh4
2 files changed, 10 insertions, 4 deletions
diff --git a/lib/builder-targets.sh b/lib/builder-targets.sh
index 8082a9d..ede1de1 100644
--- a/lib/builder-targets.sh
+++ b/lib/builder-targets.sh
@@ -10,6 +10,12 @@
####################
builder_config() {
+ # Define commands
+ CMD_7z="`which 7z`" ; builder_check_error "No 7z installed"
+ CMD_unzip="`which unzip`" ; builder_check_error "No unzip installed"
+ CMD_zip="`which zip`" ; builder_check_error "No zip installed"
+
+
# Check temp dir
test -d ${TMP_DIR}
builder_check_error "temp directory not available: $TMP_DIR"
@@ -232,8 +238,8 @@ builder_package() {
fi
# create source- and binary package package
- test "${OPSI_REPOS_UPLOAD_BIN}" = "true" && zip -r ${OUTPUT_DIR}/${OPSI_REPOS_FILE_PATTERN}.zip $INST_DIR
- test "${OPSI_REPOS_UPLOAD_SOURCE}" = "true" && zip -r ${OUTPUT_DIR}/${OPSI_REPOS_FILE_PATTERN}-src.zip ${PRODUCT_DIR}
+ test "${OPSI_REPOS_UPLOAD_BIN}" = "true" && $CMD_zip -r ${OUTPUT_DIR}/${OPSI_REPOS_FILE_PATTERN}.zip $INST_DIR
+ test "${OPSI_REPOS_UPLOAD_SOURCE}" = "true" && $CMD_zip -r ${OUTPUT_DIR}/${OPSI_REPOS_FILE_PATTERN}-src.zip ${PRODUCT_DIR}
}
diff --git a/lib/builder-utils.sh b/lib/builder-utils.sh
index fc791a9..ba62596 100644
--- a/lib/builder-utils.sh
+++ b/lib/builder-utils.sh
@@ -57,9 +57,9 @@ function process_file() {
if [ "$format" = "cp" ]; then
cp $src $dst
elif [ "$format" = "7zip" ]; then
- 7z x -o$dst $src
+ $CMD_7z x -o$dst $src
elif [ "$format" = "unzip" ]; then
- unzip $src -d $dst
+ $CMD_unzip $src -d $dst
else
fatal_error "Unknown compression format: $format"
fi

Powered by Domaintechnik.at | Hosting - Domain - Webspace