2 ###############################################################################
4 # deb2targz - converts Debian binary packages into tarballs
6 # Copyright (C) 2006-2020 Cygport authors
7 # Provided by the Cygwin project <https://cygwin.com/>
9 # cygport is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
14 # cygport is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with cygport. If not, see <https://www.gnu.org/licenses/>.
22 ################################################################################
28 echo "$0: No packages specified" > /dev
/stderr
32 if ! hash ar &> /dev
/null
34 echo "$0: ar not found, install binutils" > /dev
/stderr
40 deb
=$
(readlink
-f $deb)
46 echo "ERROR: file not found"
50 case "$(file -b $deb)" in
52 *) echo "ERROR: not a Debian package"
58 # .debs are 'ar' archives containing three files: debian-binary (text
59 # file containing package format version), control.tar.gz (small amount
60 # of data, including debian/control used by package manager), and
61 # data.tar.gz, the actual file contents. We need only the latter.
65 mv data.
tar.gz
${deb%.deb}.
tar.gz