Merge branch 'master' into devel
[tools/build.git] / debtransformzip
1 #! /bin/bash
2
3 ################################################################
4 #
5 # Copyright (c) 1995-2014 SUSE Linux Products GmbH
6 #
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License version 2 or 3 as
9 # published by the Free Software Foundation.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program (see the file COPYING); if not, write to the
18 # Free Software Foundation, Inc.,
19 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
20 #
21 ################################################################
22
23 if test $# -ne 2; then
24     exit 1
25 fi
26
27 zip="$1"
28 tar="$2"
29
30 tmp=$(mktemp -d)
31 unzip -q -d "$tmp" -- "$zip" || exit 1
32 ( cd "$tmp" && tar czO * ) >"$tar" || exit 1
33 rm -r "$tmp"
34 exit 0