Statistics
| Revision:

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

History | View | Annotate | Download (410 Bytes)

1 728 mdecorde
#!/bin/bash
2 728 mdecorde
3 728 mdecorde
if [ $# -ne 2 ]
4 728 mdecorde
then
5 728 mdecorde
  echo "Usage: ./extractDeb.sh *.deb dir"
6 728 mdecorde
  exit 1
7 728 mdecorde
fi
8 728 mdecorde
9 728 mdecorde
if [ -d "$2" ]; then
10 728 mdecorde
	echo "** extractDeb: outdir already exits: $2."
11 728 mdecorde
	exit 1;
12 728 mdecorde
fi
13 728 mdecorde
14 728 mdecorde
if [ ! -f "$1" ]; then
15 728 mdecorde
	echo "** extractDeb: deb file does not exits: $1."
16 728 mdecorde
	exit 1;
17 728 mdecorde
fi
18 728 mdecorde
19 728 mdecorde
mkdir $2 &&
20 728 mdecorde
dpkg-deb -x "$1" "$2" &&
21 728 mdecorde
dpkg-deb -e "$1" "$2/DEBIAN"
22 728 mdecorde
23 728 mdecorde
if [ $? != 0 ]; then
24 728 mdecorde
	echo "** extractDeb: failed to extract deb file"
25 728 mdecorde
	exit 1;
26 728 mdecorde
fi