c++/sql-dk/nbproject/Package-Debug.bash
author František Kučera <franta-hg@frantovo.cz>
Tue, 26 Feb 2019 18:19:49 +0100
branchv_0
changeset 236 a3ec71fa8e17
parent 230 8bae71482622
permissions -rw-r--r--
Avoid reusing/rewriting the DB connection properties.
There was weird random errors while testing connection to multiple DB in parallel when one of them was meta connection to same DB connection.
Two kinds of exception: 1) missing password 2) „Passing DB password as CLI parameter is insecure!“
     1 #!/bin/bash -x
     2 
     3 #
     4 # Generated - do not edit!
     5 #
     6 
     7 # Macros
     8 TOP=`pwd`
     9 CND_PLATFORM=GNU-Linux
    10 CND_CONF=Debug
    11 CND_DISTDIR=dist
    12 CND_BUILDDIR=build
    13 CND_DLIB_EXT=so
    14 NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
    15 TMPDIRNAME=tmp-packaging
    16 OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/sql-dk
    17 OUTPUT_BASENAME=sql-dk
    18 PACKAGE_TOP_DIR=sql-dk/
    19 
    20 # Functions
    21 function checkReturnCode
    22 {
    23     rc=$?
    24     if [ $rc != 0 ]
    25     then
    26         exit $rc
    27     fi
    28 }
    29 function makeDirectory
    30 # $1 directory path
    31 # $2 permission (optional)
    32 {
    33     mkdir -p "$1"
    34     checkReturnCode
    35     if [ "$2" != "" ]
    36     then
    37       chmod $2 "$1"
    38       checkReturnCode
    39     fi
    40 }
    41 function copyFileToTmpDir
    42 # $1 from-file path
    43 # $2 to-file path
    44 # $3 permission
    45 {
    46     cp "$1" "$2"
    47     checkReturnCode
    48     if [ "$3" != "" ]
    49     then
    50         chmod $3 "$2"
    51         checkReturnCode
    52     fi
    53 }
    54 
    55 # Setup
    56 cd "${TOP}"
    57 mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
    58 rm -rf ${NBTMPDIR}
    59 mkdir -p ${NBTMPDIR}
    60 
    61 # Copy files and create directories and links
    62 cd "${TOP}"
    63 makeDirectory "${NBTMPDIR}/sql-dk/bin"
    64 copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
    65 
    66 
    67 # Generate tar file
    68 cd "${TOP}"
    69 rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/sql-dk.tar
    70 cd ${NBTMPDIR}
    71 tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/sql-dk.tar *
    72 checkReturnCode
    73 
    74 # Cleanup
    75 cd "${TOP}"
    76 rm -rf ${NBTMPDIR}