This file is indexed.

/usr/bin/deb3 is in quilt 0.63-8.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
#!/bin/sh
set -e
# COPYRIGHT
#
#     (c) Osamu Aoki, 2010, GPL2+
#
# dpatch2quilt.sh is used as the base of this program.
# parts from http://blog.orebokech.com/2007/08/converting-debian-packages-from-dpatch.html
#     (c) gregor herrmann, 2007-2008, GPL2+
#     (c) Damyan Ivanov, 2007-2008, GPL2+
#     (c) Martin Quinson, 2008, GPL2+

# NAME
#
#     deb3 - convert debian source package to new 3.0 (quilt) format
#
# SYNOPSIS
#
#     deb3 [quilt|dpatch|0|1|2|]
#
# DESCRIPTION
#
# deb3 converts debian source packages which use series of patches from 
# 1.0 format to new 3.0 (quilt) format while adjusting contents in 
# debian/patches.  This is run from the package top level directory.
# If run without argument, deb3 guesses source structure.  Following 
# formats are auto detected.
#
#   * dh_quilt_patch/dh_quilt_unpatch
#   * dpatch
#   * cdbs (simple-patchsys.mk)
#   * dbs  (dbs-build.mk)
#
# ARGUMENT
#
# You can force particular conversion using argument.
#
#     quilt   conversion for dh_quilt_patch/dh_quilt_unpatch
#     dpatch  conversion for dpatch
#     0       conversion for dbs and cdbs made with -p 0 patches (default)
#     1       conversion for dbs and cdbs made with -p 1 patches
#     2       conversion for dbs and cdbs made with -p 2 patches

# Default patch level for cdbs and dbs 
# This may be overriden via environment variable or argument
: ${PATCH_LEVEL=0}

export QUILT_PATCHES=debian/patches
export QUILT_PATCH_OPTS="--reject-format=unified"
export QUILT_DIFF_ARGS="-p ab --no-timestamps --no-index --color=auto"
export QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index"
export QUILT_COLORS="diff_hdr=1;32:diff_add=1;34:diff_rem=1;31:diff_hunk=1;33:diff_ctx=35:diff_cctx=33"

dummy_git()
{
	# Do nothing if it is not under Git
	:
}

convert_quilt()
{
	COUNT_OLD=$(ls -1 debian/patches/* | wc -l)
	COUNT_NEW=$(ls -1 debian/patches/* | wc -l)
}

convert_dpatch()
{
	for p in $(dpatch list-all); do
	        quilt import -P $p.patch debian/patches/$p.dpatch
	        AUTHOR=$(dpatch cat --author-only $p.dpatch)
	        DESC=$(dpatch cat --desc-only $p.dpatch)
	        echo "Author: $AUTHOR" | quilt header -r $p.patch
	        echo "Description: $DESC" | quilt header -a $p.patch
	        quilt push
	        quilt refresh
	        $GITCOM add debian/patches/$p.patch
	done
	quilt pop -a
	COUNT_OLD=$(ls -1 debian/patches/*.dpatch | wc -l)
	COUNT_NEW=$(ls -1 debian/patches/*.patch | wc -l)
	$GITCOM add debian/patches/series
	$GITCOM rm debian/patches/00list debian/patches/*.dpatch
	rm -rf debian/patches/*.dpatch
	rm -rf debian/patches/00list
}

convert_simple()
{
	mv debian/patches debian/patches-old
	for p in debian/patches-old/* ; do
		# normalize patch filename extension to *.patch
		q=${p##*/}
		q=${q%.*}.patch
		# normally $PATCH_LEVEL is 0
	        quilt import -p $PATCH_LEVEL -P $q $p
		# no good data to use.  Just provide template entries.
	        quilt push
	        quilt refresh
	        $GITCOM add $p
	done
	quilt pop -a	
	COUNT_OLD=$(ls -1 debian/patches-old/* | wc -l)
	COUNT_NEW=$(ls -1 debian/patches/* | wc -l)
	rm -rf debian/patches-old
	$GITCOM add debian/patches/series
}

#
# BEGIN
#

dh_testdir
if [ -d ".git" ]; then
	GITCOM=git
else
	GITCOM=dummy_git
fi

# set package source format
mkdir -p debian/source
$GITCOM add debian/source
echo "3.0 (quilt)" >debian/source/format
$GITCOM add debian/source/format

# make debian/rules template
mv debian/rules debian/rules-old
cat >debian/rules <<EOF
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
#export DH_OPTIONS=-v

%:
	dh  \$@

# Use override_dh_* targets to customize this.
# ---------------------------------------------------
# Followings are the old debian/rules
#
EOF

sed -e 's/^/# /' <debian/rules-old >>debian/rules
rm debian/rules-old
chmod 755 debian/rules
$GITCOM add debian/rules

# change patch queue format
if [ "$1" = quilt ]; then
	convert_quilt
elif [ "$1" = dpatch ]; then
	convert_dpatch
elif [ "$1" = "0" ] || [ "$1" = "1" ] || [ "$1" = "2" ]; then
	PATCH_LEVEL=$1
	convert_simple
elif [ -f debian/patches/series ]; then
	convert_quilt
elif [ -f debian/patches/00list ]; then
	convert_dpatch
elif grep "include.*\/cdbs\/.*\/simple-patchsys\.mk" debian/rules ; then
	convert_simple
elif grep "include.*\/dbs\/dbs-build\.mk" debian/rules ; then
	convert_simple
else
	echo "deb3 [quilt|dpatch|0|1|2|]" >&2
	exit 1
fi

echo "INFO: The numbers of files in old debian/patches: $COUNT_OLD" >&2
echo "INFO: The numbers of files in new debian/patches: $COUNT_NEW" >&2

echo "... Auto conversion completed!" >&2

cat <<EOF

-----------------------------------------------------------------------
You need to make further modification to your package following 
debhelper(7) manpage.  This deb3 script only provides starting point to
you.  Typical modifications are:

 * "Build-Depends:" should remove "cdbs", "dpatch", and "quilt".
 * "Build-Depends:" should list "debhelper (>= 7.0.50~)"
 * Add "override_dh_*:" targets to debian/rules to address special 
   cases.
 * Remove "--with quilt" in debian/rules, if it uses "dh \$@" syntax.

You can find tutorial for packaging using this new "dh \$@" style and 
new 3.0 (quilt) source format in the maint-guide package.  It is also 
available at:

   http://www.debian.org/doc/manuals/maint-guide/index.en.html


Check the deb3(1) manual to see this help message again.
-----------------------------------------------------------------------
EOF

exit 0