2 # dsc2git - wrapper around archives2git
4 # Copyright © 2017 Géraud Meyer <graud@gmx.com>
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License version 2 as
7 # published by the Free Software Foundation.
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # You should have received a copy of the GNU General Public License along
15 # with this program. If not, see <http://www.gnu.org/licenses/>.
20 dsc2git - wrapper around archives2git to process debian source packages
22 dsc2git [<dsc2git_opts>] [--] <archives2git_args>
24 dsc2git passes the --unpack option to archives2git so that it unpacks
25 Debian source packages.
27 --dpkg-source-args <args>
28 Line-separated list of arguments passed to dpkg-source(1).
32 $ git init dash-deb.git; cd dash-deb.git
34 $ dsc2git --dpkg-source-args $'--no-check\n--skip-patches' \
35 $(ls -1 ../source-dash/*.dsc |grep -v \~bpo |sort -V)
37 archives2git(1), dpkg-source(1)
46 --dpkg-source-args) shift; DPKG_ARGS=$1 ;;
47 --help|--helpm) help_message; exit ;;
50 # an unknown option may be an option to archives2git
56 # add single quotes around the string, escaping the single quotes inside it
57 if ( echo ${var//a/b} ) 2>/dev/null >&2
59 escape_stringeval () {
61 printf "%s" \'"${@//"'"/${_q}\\${_q}${_q}}"\'
63 elif printf "%q" \' 2>/dev/null >&2
65 escape_stringeval () {
69 escape_stringeval () {
71 LC_ALL=C sed "s/'/'\\\\''/g; 1s/^/'/; \$s/\$/'/; s/^''//g; s/\\([^\\]\\)''/\\1/g"
79 do dpkg_args=$dpkg_args\ $(escape_stringeval "$arg")
85 [ x"${arch#./}" = x"$arch" ] && [ x"${arch#../}" = x"$arch" ] && archcd=
87 dpkg-source -x '"$dpkg_args"' "$archcd$arch"