Subversion Repositories MB01 Project

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 - 1
#!/bin/bash -x
2
 
3
#
4
# Generated - do not edit!
5
#
6
 
7
# Macros
8
TOP=`pwd`
9
CND_CONF=default
10
CND_DISTDIR=dist
11
TMPDIR=build/${CND_CONF}/${IMAGE_TYPE}/tmp-packaging
12
TMPDIRNAME=tmp-packaging
13
OUTPUT_PATH=dist/${CND_CONF}/${IMAGE_TYPE}/KEYBPS2.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
14
OUTPUT_BASENAME=KEYBPS2.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}
15
PACKAGE_TOP_DIR=keybps2.x/
16
 
17
# Functions
18
function checkReturnCode
19
{
20
    rc=$?
21
    if [ $rc != 0 ]
22
    then
23
        exit $rc
24
    fi
25
}
26
function makeDirectory
27
# $1 directory path
28
# $2 permission (optional)
29
{
30
    mkdir -p "$1"
31
    checkReturnCode
32
    if [ "$2" != "" ]
33
    then
34
      chmod $2 "$1"
35
      checkReturnCode
36
    fi
37
}
38
function copyFileToTmpDir
39
# $1 from-file path
40
# $2 to-file path
41
# $3 permission
42
{
43
    cp "$1" "$2"
44
    checkReturnCode
45
    if [ "$3" != "" ]
46
    then
47
        chmod $3 "$2"
48
        checkReturnCode
49
    fi
50
}
51
 
52
# Setup
53
cd "${TOP}"
54
mkdir -p ${CND_DISTDIR}/${CND_CONF}/package
55
rm -rf ${TMPDIR}
56
mkdir -p ${TMPDIR}
57
 
58
# Copy files and create directories and links
59
cd "${TOP}"
60
makeDirectory ${TMPDIR}/keybps2.x/bin
61
copyFileToTmpDir "${OUTPUT_PATH}" "${TMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
62
 
63
 
64
# Generate tar file
65
cd "${TOP}"
66
rm -f ${CND_DISTDIR}/${CND_CONF}/package/keybps2.x.tar
67
cd ${TMPDIR}
68
tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/package/keybps2.x.tar *
69
checkReturnCode
70
 
71
# Cleanup
72
cd "${TOP}"
73
rm -rf ${TMPDIR}