File: check_Client7z.sh

package info (click to toggle)
p7zip 9.20.1~dfsg.1-4.1%2Bdeb8u3
  • links: PTS
  • area: main
  • in suites: jessie
  • size: 13,368 kB
  • sloc: cpp: 104,670; ansic: 12,930; makefile: 1,899; sh: 1,031; asm: 159
file content (90 lines) | stat: -rwxr-xr-x 1,987 bytes parent folder | download | duplicates (9)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#! /bin/sh

sure()
{
  eval $*
  if [ "$?" != "0" ]
  then
    echo "ERROR during : $*"
    echo "ERROR during : $*" > last_error
    exit 1
  fi
}

LD_LIBRARY_PATH=`cd ../bin ; pwd`:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}"

PZIP7=`pwd`"/$1"

REP=TMP_$$
echo "REP=${REP}"

chmod -R 777 ${REP} 2> /dev/null
rm -fr   ${REP}
mkdir -p ${REP}

cd ${REP}

# sure rm -fr 7za433_ref 7za433_7zip_bzip2 7za433_7zip_lzma 7za433_7zip_lzma_crypto 7za433_7zip_ppmd 7za433_tar
# sure rm -fr 7za433_7zip_bzip2.7z 7za433_7zip_lzma.7z 7za433_7zip_lzma_crypto.7z 7za433_7zip_ppmd.7z 7za433_tar.tar

# for Beos or MacOSX
ln -s ../../bin/7z.so .

echo ""
echo "# TESTING ..."
echo "#############"

sure ${PZIP7} l ../test/7za433_7zip_lzma.7z
# sure ${PZIP7} t -pqwerty ../test/7za433_7zip_lzma_crypto.7z
sure ${PZIP7} l ../test/7za433_7zip_ppmd.7z
sure ${PZIP7} l ../test/7za433_7zip_bzip2.7z



echo ""
echo "# EXTRACTING ..."
echo "################"

sure tar xf ../test/7za433_tar.tar
sure mv 7za433_tar 7za433_ref

sure ${PZIP7} x ../test/7za433_7zip_lzma.7z
sure diff -r 7za433_ref 7za433_7zip_lzma

# sure ${PZIP7} x -pqwerty ../test/7za433_7zip_lzma_crypto.7z
# sure diff -r 7za433_ref 7za433_7zip_lzma_crypto

sure ${PZIP7} x ../test/7za433_7zip_ppmd.7z
sure diff -r 7za433_ref 7za433_7zip_ppmd

sure ${PZIP7} x ../test/7za433_7zip_bzip2.7z
sure diff -r 7za433_ref 7za433_7zip_bzip2

echo ""
echo "# Archiving ..."
echo "###############"

sure ${PZIP7} a 7za433_7zip_lzma.7z 7za433_7zip_lzma/bin/7za.exe 7za433_7zip_lzma/readme.txt 7za433_7zip_lzma/doc/copying.txt

echo ""
echo "# EXTRACTING (PASS 2) ..."
echo "#########################"

sure rm -fr 7za433_7zip_bzip2 7za433_7zip_lzma 7za433_7zip_lzma_crypto 7za433_7zip_ppmd 7za433_tar

sure ${PZIP7} x 7za433_7zip_lzma.7z
sure diff -r 7za433_ref 7za433_7zip_lzma

cd ..

# ./clean_all.sh
chmod -R 777 ${REP} 2> /dev/null
rm -fr   ${REP}

echo ""
echo "========"
echo "ALL DONE"
echo "========"
echo ""