summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorU-XPBUILDBOT\mario <[email protected](none)>2013-09-10 22:13:08 (GMT)
committer U-XPBUILDBOT\mario <[email protected](none)>2013-09-10 22:13:08 (GMT)
commit8ad86744fcadb26452e3d6abf9339102c8cbd56d (patch)
treecc6baeb3dd646a555e862cebad1215eb8265cc14 /lib
parentdf3c29f0d90c1c6afa11de4b948ec038745fe1e0 (diff)
update all the functiosn now used in the msvc pack
Diffstat (limited to 'lib')
-rw-r--r--lib/builder-targets.sh33
-rw-r--r--lib/builder-utils.sh125
2 files changed, 128 insertions, 30 deletions
diff --git a/lib/builder-targets.sh b/lib/builder-targets.sh
index ab38ac5..baff09b 100644
--- a/lib/builder-targets.sh
+++ b/lib/builder-targets.sh
@@ -11,18 +11,20 @@
builder_config() {
# Define commands
- CMD_7z="`which 7z.exe`" ; builder_check_error "Command '7z' not installed"
- CMD_unzip="`which unzip.exe`" ; builder_check_error "Command 'unzip' not installed"
- CMD_unrar="`which UnRAR.exe`" ; builder_check_error "Command 'UnRAR' not installed"
- CMD_zip="`which zip.exe`" ; builder_check_error "Command 'zip' not installed"
- CMD_lha="`which lha.exe`" ; builder_check_error "Command 'lha' not installed"
- CMD_tar="`which tar.exe`" ; builder_check_error "Command 'tar' not installed"
- CMD_cabextract="`which cabextract.exe`" ; builder_check_error "Command 'cabextract' not installed"
- CMD_unix2dos="`which unix2dos.exe`" ; builder_check_error "Command 'unix2dos' not installed"
- CMD_sha1sum="`which sha1sum.exe`" ; builder_check_error "Command 'sha1sum' not installed"
- CMD_inifile="`which inifile.exe`" ; builder_check_error "Command 'inifile' not installed (http://www.horstmuc.de/wbat32d.htm#inifile)"
- CMD_showver="`which ShowVer.exe`" ; builder_check_error "Command 'ShowVer' not installed (http://www.codeproject.com/Articles/2457/ShowVer-exe-command-line-VERSIONINFO-display-progr)"
- CMD_tidy="`which tidy.exe`" ; builder_check_error "Command 'tidy' not installed"
+ CMD_7z="`which 7z`" ; builder_check_error "Command '7z' not installed"
+ CMD_unzip="`which unzip.exe`" ; builder_check_error "Command 'unzip' not installed"
+ CMD_unrar="`which UnRAR.exe`" ; builder_check_error "Command 'UnRAR' not installed"
+ CMD_zip="`which zip.exe`" ; builder_check_error "Command 'zip' not installed"
+ CMD_tar="`which tar.exe`" ; builder_check_error "Command 'tar' not installed"
+ CMD_cabextract="`which cabextract.exe`" ; builder_check_error "Command 'cabextract' not installed"
+ CMD_unix2dos="`which unix2dos.exe`" ; builder_check_error "Command 'unix2dos' not installed"
+ CMD_sha1sum="`which sha1sum.exe`" ; builder_check_error "Command 'sha1sum' not installed"
+ CMD_inifile="`which inifile.exe`" ; builder_check_error "Command 'inifile' not installed (http://www.horstmuc.de/wbat32d.htm#inifile)"
+ CMD_showver="`which ShowVer.exe`" ; builder_check_error "Command 'ShowVer' not installed (http://www.codeproject.com/Articles/2457/ShowVer-exe-command-line-VERSIONINFO-display-progr)"
+ CMD_tidy="`which tidy.exe`" ; builder_check_error "Command 'tidy' not installed"
+ CMD_msiexec="`which msiexec.exe`" ; builder_check_error "Command 'msiexec' not installed"
+ CMD_innounp="`which innounp.exe`" ; builder_check_error "Command 'innounp' not installed"
+ CMD_xmlstarlet="`which xmlstarlet.exe`" ; builder_check_error "Command 'xmlstarlat' not installed"
# Check temp dir
test -d ${TMP_DIR}
@@ -188,14 +190,14 @@ builder_create() {
# Copy files and convert text files to dos format
# cp -Rv ${PRODUCT_DIR}/AIO $INST_DIR
- # cp -Rv ${PRODUCT_DIR}/CLIENT_DATA $INST_DIR
+ # cp -Rv ${PRODUCT_DIR}/Temp $INST_DIR
# if [ -d "${PRODUCT_DIR}/SERVER_DATA" ] ; then
# cp -Rv ${PRODUCT_DIR}/SERVER_DATA $INST_DIR
# fi
# copy binaries
for (( i = 0 ; i < ${#DL_SOURCE[@]} ; i++ )) ; do
- DL_EXTRACT_PATH[$i]=${INST_DIR}/CLIENT_DATA/${DL_ARCH[$i]}/${DL_EXTRACT_TO[$i]}
+ DL_EXTRACT_PATH[$i]=${INST_DIR}/Temp/${DL_ARCH[$i]}/${DL_EXTRACT_TO[$i]}
local format=${DL_EXTRACT_FORMAT[$i]}
if [ -z "$format" ] ; then format="cp"; fi
local option=${DL_EXTRACT_OPTION[$i]}
@@ -240,9 +242,10 @@ builder_package() {
local release_new=${CREATOR_TAG}${RELEASE}
local aio_file=${PN}_${VERSION}-${release_new}.7z
+ rm -rf $INST_DIR/Temp
pushd ${OUTPUT_DIR}
rm -f ${aio_file} ${AIO_REPOS_FILE_PATTERN}.7z
- 7z a ${AIO_REPOS_FILE_PATTERN}.7z -v $INST_DIR/*
+ $CMD_7z a ${AIO_REPOS_FILE_PATTERN}.7z $INST_DIR/*
builder_check_error "Building AIO-package"
popd
diff --git a/lib/builder-utils.sh b/lib/builder-utils.sh
index 88b5e77..ae08bf5 100644
--- a/lib/builder-utils.sh
+++ b/lib/builder-utils.sh
@@ -1,3 +1,4 @@
+
#############################################
# void retrieve_file (src, dst)
#
@@ -67,8 +68,6 @@ function process_file() {
$CMD_unzip $option -o $src -d $dst
elif [ "$format" = "unrar" ]; then
$CMD_unrar x -y $option $src $dst
- elif [ "$format" = "lha" ]; then
- $CMD_lha x $option -w=$dst $src
elif [ "$format" = "targz" ]; then
$CMD_tar xzvf $option $src -C $dst
elif [ "$format" = "tarbz2" ]; then
@@ -201,16 +200,28 @@ write_ini_file() {
# Var:
#
###################
-get_file_version() {
- local getver_file=$1
- local getver_var=$2
-
- if [ -f "$getver_file" ] ; then
- $CMD_showver $getver_file | grep FileVersion: | rev | cut -d: -f1 | rev | tr -d ' ' > $getver_ver
- echo "file $getver_file has version $getver_ver"
- else
- echo "$getver_file not found"
- fi
+vercomp() {
+ [ ! $(echo -e "$1\n$2" | sort --version-sort | head -1) = "$1" ]
+}
+
+###################
+# Get Verison of File
+#
+# Copy file only if it is newer
+#
+# Parameter
+# File: to process
+# Var:
+#
+###################
+
+
+get_file_ver() {
+ local getver_file=$2
+ local __resultvar=$1
+ local myresult=`$CMD_showver $(cygpath -pw "$getver_file") | grep FileVersion: | rev | cut -d: -f1 | rev | tr -d ' '`
+ echo "$getver_file -> $myresult"
+ eval $__resultvar="'$myresult'"
}
###################
@@ -226,10 +237,29 @@ get_file_version() {
copyver() {
local source_file=$1
local target_file=$2
- local source_ver
- local target_ver
+ local source_ver=""
+ local target_ver=""
- get_file_version $source_file $source_ver
+ echo "Source File: $source_file Target Version: $target_file"
+ if [ -f "$source_file" ] && [ -f "$target_file" ] ; then
+ get_file_ver source_ver $source_file
+ get_file_ver target_ver $target_file
+ if [ vercomp $source_ver $target_ver ] ; then
+ echo "Source Verssion: $source_ver > Target Version: $target_ver"
+ echo "Copying File"
+ cp $source_file $target_file
+ else
+ echo "Source Verssion: $source_ver =< Target Version: $target_ver"
+ echo "Not Copying File"
+ fi
+ elif [ -f "$source_file" ] && [ ! -f "$target_file" ] ; then
+ source_ver=$(get_file_version $source_file)
+ echo "Source Verssion: $source_ver"
+ echo "Copying File"
+ cp $source_file $target_file
+ else
+ echo "Nothing to copy"
+ fi
}
###################
@@ -249,3 +279,68 @@ tidy_xml() {
cat $source_file | $CMD_tidy -utf8 -xml -w 255 -i -c -q -asxml | sed -e 's!&gt;!>!g' -e 's!&lt;!<!g' > $target_file
}
+#############################################
+# void extract_file (format, src, dst)
+#
+# Description: Extract a file
+#
+# Parameter
+# format: compression format
+# src: source file to be used
+# dst: path to extract the file
+#
+#############################################
+function extract_file() {
+
+ local format=$1
+ local src=$2
+ local dst=$3
+ local option=$4
+ local src_dir=`dirname "$src"`
+ local src_file=`basename "$src"`
+ local dst_dir=`dirname "$dst"`
+ local dst_file=`basename "$dst"`
+
+ log_debug "Compression format: $format"
+
+ mkdir -p $dst
+ if [ "$format" = "msi-a" ]; then
+ mkdir /cygdrive/c/msi-adm
+ pushd $src_dir
+ echo $src_file
+ $CMD_msiexec /a "$src_file" $option TARGETDIR="c:\msi-adm"
+ popd
+ cp -r /cygdrive/c/msi-adm/* $dst
+ rm -rf /cygdrive/c/msi-adm
+ elif [ "$format" = "msp-a" ]; then
+ pushd $dst_dir
+ cp $src $dst_dir
+ $CMD_msiexec /p "$src_file" /a "$dst_file" SHORTFILENAMES=TRUE /qb
+ popd
+ elif [ "$format" = "7zip" ]; then
+ $CMD_7z x -y $option -o$dst $src
+ elif [ "$format" = "unzip" ]; then
+ $CMD_unzip $option -o $src -d $dst
+ elif [ "$format" = "unrar" ]; then
+ $CMD_unrar x -y $option $(cygpath -pw "$src") $(cygpath -pw "$dst")
+ elif [ "$format" = "cab" ]; then
+ $CMD_cabextract $option -d $dst $src
+ elif [ "$format" = "cab-sfx" ]; then
+ $CMD_cabextract $option -d $dst $src
+ $CMD_xmlstarlet sel -N X="http://schemas.microsoft.com/wix/2008/Burn" -t -m "//X:Payload" -v "concat(@SourcePath,'-',@FilePath)" -n $dst/0 | tr '\\' '/' > $dst/rename.list
+ for i in `cat $dst/rename.list`
+ do
+ pushd $dst
+ local src_var=$(echo $i | cut -f1 -d-)
+ local dst_var=$(echo $i | cut -f2 -d-)
+ mkdir -p $(dirname $dst_var)
+ mv -v $src_var $dst_var
+ popd
+ done
+ elif [ "$format" = "inno" ]; then
+ $CMD_innounp $option -d $dst $src
+ else
+ fatal_error "Unknown compression format: $format"
+ fi
+}
+

Powered by Domaintechnik.at | Hosting - Domain - Webspace