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