File: waf-uncompress.sh

package info (click to toggle)
py3cairo 1.10.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,308 kB
  • sloc: python: 12,287; ansic: 4,349; makefile: 141; sh: 32
file content (39 lines) | stat: -rwxr-xr-x 765 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh

BASEDIR=$1
OLD_IFS=$IFS
IFS="
"

script=""
tar_bz2=""

WAF="$BASEDIR/waf"
inputdata=`sed -e "s|\\\\x0|#0000|g" $WAF | sed -e "s|\\\\\\\\|#005c|g"`
is_script=1
for line in $inputdata
do
    case $line in
        \#==\>)
            is_script=0
        ;;
        
        \#\<==)
            is_script=1
        ;;
        
        *)
            if test $is_script -eq 1; then
                script=$script$line"\n"
            else
                tar_bz2=$line
            fi
        ;;
    esac
done
echo "$script" > "$BASEDIR/waf-uncompressed"
chmod +x "$BASEDIR/waf-uncompressed"
echo -n "$tar_bz2" | sed "s|^#||g" | sed "s|#\\/|\\n|g" | sed "s|#\\*|\\r|g" | sed "s|#0000|\\x0|g" | sed "s|#005c|\\\\|g" | \
    tar -xjf - -C $BASEDIR
IFS=$OLD_IFS