Statistics
| Revision:

root / tmp / org.txm.setups / extractDeb.sh @ 791

History | View | Annotate | Download (410 Bytes)

1
#!/bin/bash
2

    
3
if [ $# -ne 2 ]
4
then
5
  echo "Usage: ./extractDeb.sh *.deb dir"
6
  exit 1
7
fi
8

    
9
if [ -d "$2" ]; then
10
	echo "** extractDeb: outdir already exits: $2."
11
	exit 1;
12
fi
13

    
14
if [ ! -f "$1" ]; then
15
	echo "** extractDeb: deb file does not exits: $1."
16
	exit 1;
17
fi
18

    
19
mkdir $2 &&
20
dpkg-deb -x "$1" "$2" &&
21
dpkg-deb -e "$1" "$2/DEBIAN"
22

    
23
if [ $? != 0 ]; then
24
	echo "** extractDeb: failed to extract deb file"
25
	exit 1;
26
fi