* Merge Siegfried-Angel Gevatter Pujals' branch.

This commit is contained in:
Luke Yelavich 2008-01-19 20:14:24 +11:00
commit 2ae02070a3
21 changed files with 254 additions and 96 deletions

View File

@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# Copyright 2006-2007 (C) Pete Savage <petesavage@ubuntu.com>
# Copyright 2007 (C) Siegfried-A. Gevatter <siggi.gevatter@gmail.com>
# Copyright 2007 (C) Siegfried-A. Gevatter <rainct@ubuntu.com>
# License: GPLv2 or later
#
# This script is used to check if a package and all its build

View File

@ -1,3 +1,4 @@
Albert Damen <albrt@gmx.net>
Albin Tonnerre <lut1n.tne@gmail.com>
Daniel Holbach <daniel.holbach@ubuntu.com>
Jamin W. Collins <jcollins@asgardsrealm.net>
@ -7,7 +8,7 @@ Martin Pitt <martin.pitt@ubuntu.com>
Michael Bienia <geser@ubuntu.com>
Pete Savage <petesavage@ubuntu.com>
Kees Cook <kees@ubuntu.com>
Siegfried-A. Gevatter <siggi.gevatter@gmail.com>
Siegfried-A. Gevatter <rainct@ubuntu.com>
Soren Hansen <soren@ubuntu.com>
Steve Kowalik <stevenk@ubuntu.com>
Terence Simpson <stdin@stdin.me.uk>

68
README
View File

@ -7,32 +7,44 @@
are in the "main" component or not.
check-symbols <package> [<directory>]
... will compare and give you a diff of the exported symbols of all .so
files in all binary packages of <package>.
<directory> is not mandatory and set to /var/cache/pbuilder/result by default.
... will compare and give you a diff of the exported symbols of all
.so files in all binary packages of <package>. <directory> is not
mandatory and set to /var/cache/pbuilder/result by default.
dch-repeat [--help]
... will repeat a change log into an older release.
dgetlp <URL>
... will simulate «dget»'s behaviour for files hosted at
launchpadlibrarian.net.
get-branches <directory> <team> [checkout|branch]
... will branch / checkout all the Bazaar branches in a Launchpad team.
... will branch / checkout all the Bazaar branches in a Launchpad
team.
get-build-deps [<packages list or file containing a list of packages>]
... will install the build dependencies for a package, if you are inside
its source file. Alternatively, you can pass it the name of a file
containing a list of packages, one on each line, or just pass them all
as parameters, and it will get their build dependencies.
... will install the build dependencies for a package, if you are
inside its source file. Alternatively, you can pass it the name of
a file containing a list of packages, one on each line, or just
pass them all as parameters, and it will get their build
dependencies.
hugdaylist [-n <number>] <bug list url>
... will create a list of <number> bug list for a hug day listing
massfile
... will perform a massive bug reporting operation on Launchpad
according to the information in the "information" and "list" files
that are in the working directory.
mk-sbuild-lv
... will create LVM snapshot chroots via schroot and sbuild. It assumes that
sbuild has not be installed and configured before.
... will create LVM snapshot chroots via schroot and sbuild. It
assumes that sbuild has not be installed and configured before.
pbuilder-dist [withlog] [create|update|build|clean|login|execute]
... is a wrapper to use pbuilder with many different distributions / versions.
It has to be renamed to something like pbuilder-feisty, pbuilder-gutsy, etc.
... is a wrapper to use pbuilder with many different Ubuntu and/or
Debian releases. It's recommended to symlink as pbuilder-feisty,
pbuilder-gutsy, etc.
ppaput [-n] <dput location> [<debuild options>]
... will build a source package using <debuild options>, upload it
@ -41,22 +53,32 @@ ppaput [-n] <dput location> [<debuild options>]
'-n' is used.
pull-debian-debdiff <package> <version>
... will attempt to find and download a specific version of a Debian package
and its immediate parent to generate a debdiff.
... will attempt to find and download a specific version of a
Debian package and its immediate parent to generate a debdiff.
requestsync [-n|-s] <source package> <target release> [base version]
... will file a sync request for a package from Debian by sending a bug report to
Launchpad.
... will file a sync request for a package from Debian by sending
a bug report to Launchpad.
reverse-build-depends [-c|-s] <package name>
... will print <package name>'s build dependencies.
submittodebian
... will submit patches to Debian's BTS. Run it from inside the
source directory of a Debian package (note that there has to be
a .dsc for it in the parent directory).
suspicious-source
... will output a list of files which are not common source files. This should be
run in the root of a source tree to find files which might not be the "prefered
form of modification" that the GPL and other licenses require.
... will output a list of files which are not common source files.
This should be run in the root of a source tree to find files which
might not be the "prefered form of modification" that the GPL and
other licenses require.
update-maintainer
... will update the maintainer field of an Ubuntu package to match the
DebianMaintainerField specification.
... will update the Maintainer field of an Ubuntu package to match
the DebianMaintainerField specification, and add a line about this
to the changelog.
what-patch
... will check what patching system is used by a package.
You need to be in its source directory in order that it works.
... will check what patching system is used by a package. You need
to be in its source directory in order for it to work.

View File

@ -1,6 +1,6 @@
#!/bin/bash
# Copyright 2006-2007 (C) Daniel Holbach <daniel.holbach@ubuntu.com>
# Modified by Siegfried-A. Gevatter <siggi.gevatter@gmail.com>
# Modified by Siegfried-A. Gevatter <rainct@ubuntu.com>
# License: GPLv2
#
# This script is used to get a diff of the exported symbols of all .so files in

25
debian/changelog vendored
View File

@ -1,9 +1,30 @@
ubuntu-dev-tools (0.25) UNRELEASED; urgency=low
[ Michael Bienia ]
* Add work-around for a bug in Debian's madison.php not returning only the
'source' line (LP: #183346).
'source' line (LP: #183346).
-- Michael Bienia <geser@ubuntu.com> Thu, 17 Jan 2008 13:42:35 +0100
[ Siegfried-Angel Gevatter Pujals (RainCT) ]
* what-patch:
- Print a list of files that have been modified outside debian/.
- Add -h and -q options.
- Add proper exit values.
* debian/control:
- Bump standards version to 3.7.3.
- Move python-central to Build-Depends-Indep.
- Rename XS-Vcs-{Bzr,Browser} fields to Vcs-{Bzr,Browser}.
- Bump minimum cdbs version to 0.4.49.
* Add Albert Damen to the Authors and Copyright Holders.
* Change my email address (to @ubuntu.com) everywhere.
* Add reverse-build-depends script and a manpage for it.
* Add requestsync and reverse-build-depends and massfile to
debian/copyright.
* Update README (add information for many missing scripts).
* Add the text "ubuntu-dev-tools" to the footer of all manpages.
* Remove duplicated ubuntu-dev-tools recommends (it's already a
dependency).
-- Siegfried-Angel Gevatter Pujals (RainCT) <rainct@ubuntu.com> Thu, 17 Jan 2008 19:17:43 +0100
ubuntu-dev-tools (0.24) hardy; urgency=low

12
debian/control vendored
View File

@ -2,19 +2,19 @@ Source: ubuntu-dev-tools
Section: devel
Priority: optional
Maintainer: Ubuntu MOTU Developers <ubuntu-motu@lists.ubuntu.com>
XS-Vcs-Bzr: https://launchpad.net/ubuntu-dev-tools/
XS-Vcs-Browser: http://codebrowse.launchpad.net/~ubuntu-dev/ubuntu-dev-tools/trunk/changes
Build-Depends: cdbs (>= 0.4.43), debhelper (>= 5), python-central (>= 0.5), python-all-dev (>= 2.4)
Build-Depends-Indep: docbook2x
Vcs-Bzr: https://launchpad.net/ubuntu-dev-tools/
Vcs-Browser: http://codebrowse.launchpad.net/~ubuntu-dev/ubuntu-dev-tools/trunk/changes
Build-Depends: cdbs (>= 0.4.49), debhelper (>= 5), python-all-dev (>= 2.4)
Build-Depends-Indep: docbook2x, python-central (>= 0.5)
XS-Python-Version: all
Homepage: https://launchpad.net/ubuntu-dev-tools/
Standards-Version: 3.7.2
Standards-Version: 3.7.3
Package: ubuntu-dev-tools
Architecture: all
Section: devel
Depends: ${python:Depends}, ${misc:Depends}, binutils, devscripts, sudo, python-launchpad-bugs (>= 0.2.25), reportbug (>= 3.39ubuntu1), python-debian
Recommends: bzr, pbuilder, python-launchpad-bugs (>= 0.2.5)
Recommends: bzr, pbuilder
Conflicts: devscripts (<< 2.10.7ubuntu5)
Replaces: devscripts (<< 2.10.7ubuntu5)
XB-Python-Version: ${python:Versions}

23
debian/copyright vendored
View File

@ -2,6 +2,7 @@ This package was re-debianized by Daniel Holbach <daniel.holbach@ubuntu.com> on
Fri, 01 Jun 2007 11:30:08 +0200.
Upstream Author:
Albert Damen <albrt@gmx.net>
Albin Tonnerre <lut1n.tne@gmail.com>
Daniel Holbach <daniel.holbach@ubuntu.com>
Jamin W. Collins <jcollins@asgardsrealm.net>
@ -11,7 +12,7 @@ Upstream Author:
Michael Bienia <geser@ubuntu.com>
Pete Savage <petesavage@ubuntu.com>
Kees Cook <kees@ubuntu.com>
Siegfried-A. Gevatter <siggi.gevatter@gmail.com>
Siegfried-A. Gevatter <rainct@ubuntu.com>
Soren Hansen <soren@ubuntu.com>
Steve Kowalik <stevenk@ubuntu.com>
Terence Simpson <stdin@stdin.me.uk>
@ -19,6 +20,7 @@ Upstream Author:
Copyright:
Copyright 2006-2007 (C) Canonical Ltd.
Albert Damen <albrt@gmx.net> 2007
Albin Tonnerre <lut1n.tne@gmail.com> 2006-2007
Daniel Holbach <daniel.holbach@ubuntu.com> 2006-2007
Luke Yelavich <themuso@ubuntu.com> 2006-2007
@ -26,15 +28,14 @@ Copyright:
Michael Bienia <geser@ubuntu.com> 2006-2007
Kees Cook <kees@ubuntu.com> 2006-2007
Pete Savage <petesavage@ubuntu.com> 2006-2007
Siegfried-A. Gevatter <siggi.gevatter@gmail.com> 2007
Siegfried-A. Gevatter <rainct@ubuntu.com> 2007
Terence Simpson <stdin@stdin.me.uk> 2007
Albert Damen <albrt@gmx.net> 2007
Licenses:
404main, check-symbols, dch-repeat, dgetlp, mk-sbuild-lv, pbuilder-dist,
pull-debian-debdiff, submittodebian, update-maintainer, and what-patch
are licensed under GPLv2:
pull-debian-debdiff, requestsync, reverse-build-depends, submittodebian,
update-maintainer and what-patch are licensed under GPLv2:
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -44,15 +45,12 @@ are licensed under GPLv2:
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this package; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
On Debian systems, the complete text of the GNU General Public License v2
can be found in `/usr/share/common-licenses/GPL-2'.
get-branches, suspicious-source and get-build-deps are licensed under GPLv3:
get-branches, get-build-deps, massfile andsuspicious-source are licensed
under GPLv3:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -63,12 +61,9 @@ get-branches, suspicious-source and get-build-deps are licensed under GPLv3:
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
On Debian systems, the complete text of the GNU General Public License v3
can be found in `/usr/share/common-licenses/GPL-3'.
The following of the scripts can be used, at your option, regarding any
later version of the previously specified license: 404main, pbuilder-dist,
dgetlp, suspicious-source and get-build-deps.
dgetlp, reverse-build-depends, suspicious-source and get-build-deps.

1
debian/pycompat vendored Normal file
View File

@ -0,0 +1 @@
2

2
dgetlp
View File

@ -1,6 +1,6 @@
#!/bin/bash
# Copyright 2007 (C) Terence Simpson <stdin@stdin.me.uk>
# Modified by Siegfried-A. Gevatter <siggi.gevatter@gmail.com>
# Modified by Siegfried-A. Gevatter <rainct@ubuntu.com>
# License: GPLv2 or later
#
# This script simulates «dget»'s behaviour for files hosted at

View File

@ -18,7 +18,7 @@ check\-symbols \- verify symbols exported by a new library version
To verify the symbols exported by a new library version, run
\fBcheck-symbols\fP with the name of the source package as argument.
\fBcheck-symbols\fP will first determine the symbols exported by the existing
and installed libary version, then install the new libarary and compare the
and installed libary version, then install the new library and compare the
symbols exported by the new library version with the symbols exported
by the old version. For each of the symbols found, \fBcheck-symbols\fP
will list if the symbol is new, unchanged or has been removed in the

View File

@ -1,15 +1,15 @@
.\" Title: get-build-deps
.\" Author: Siegfried-Angel Gevatter Pujals
.\" Contact details: siggi.gevatter@gmail.com
.\"
.TH GET\-BUILD\-DEPS 1 "October 27, 2007"
.\"
.\" Contact details: rainct@ubuntu.com
.TH GET\-BUILD\-DEPS 1 "October 27, 2007" "ubuntu-dev-tools"
.SH NAME
get\-build\-deps \- install build dependencies for one or more packages
.\"
.SH SYNOPSIS
\fBget\-build\-deps\fP [\fIPACKAGE\fR...]
.\"
\fBget\-build\-deps\fP [\fIpackage name\fR]
.SH DESCRIPTION
\fBget\-build\-deps\fP is a script to install the build dependencies for either a
local source package or one or more packages from the repositories.
@ -22,7 +22,7 @@ Alternatively, you can call it with a list of space-separated package names, or
name of a single file which contains the package names each on a line.
Then it will install the missing dependencies for those packages using
"apt-get build-dep".
.\"
.SH EXAMPLES
.TP
get\-build\-deps
@ -46,17 +46,17 @@ Reads the file
(relative to the current working directory),
where each line contains the name of a package, and installs the dependencies
for the versions of all those that are in the repositories.
.\"
.SH KNOWN BUGS AND LIMITATIONS
When it's being used to install the missing dependencies for a local source package
(i.e., no arguments are passed to it) it doesn't check for the dependencies to match
the indicated versions, but just installs the newest one available in the repositories.
.\"
.SH SEE ALSO
.BR dpkg-checkbuilddeps (1),
.BR apt-get (8)
.SH AUTHORS
.\"
\fBget\-build\-deps\fP and this manual page have been written by Siegfried-Angel
Gevatter Pujals <siggi.gevatter@gmail.com>.
Gevatter Pujals <rainct@ubuntu.com>.
They are released under the GNU General Public License, version 3 or later.

View File

@ -1,16 +1,16 @@
.\" Title: pbuilder-dist
.\" Author: Siegfried-Angel Gevatter Pujals
.\" Contact details: siggi.gevatter@gmail.com
.\"
.TH PBUILDER\-DIST 1 "August 16, 2007"
.\"
.\" Contact details: rainct@ubuntu.com
.TH PBUILDER\-DIST 1 "August 16, 2007" "ubuntu-dev-tools"
.SH NAME
pbuilder\-dist \- multi-distribution pbuilder wrapper
.\"
.SH SYNOPSIS
\fBpbuilder\-dist\fP \fIdistribution\fR [\fBi386\fP|\fBamd64\fP] [\fBmainonly\fP|\fBallcomp\fP]
[\fBwithlog\fP|\fBnolog\fP] \fIoperation\fR [\fI...\fR]
.\"
.SH DESCRIPTION
\fBpbuilder\-dist\fP is a wrapper that makes it easy to use pbuilder with many different
versions of Ubuntu and/or Debian.
@ -18,7 +18,7 @@ versions of Ubuntu and/or Debian.
It is common to symlink this script in order to give it many names in the form of
\fBpbuilder\-\fIdistribution\fP\fR (\fBpbuilder\-\fIdistribution\fR\-\fIarchitecture\fP\fR on amd64
systems), like for example \fBpbuilder\-feisty\fP, \fBpbuilder\-sid\fP, \fBpbuilder\-gutsy\-i386\fP, etc.
.\"
.SH USAGE
There are many arguments listed on the synopsis; each of them, if used, has to be used exactly in
the same order as it appears there.
@ -64,7 +64,7 @@ The default value of all optional parameters (except the architecture) can be ch
editing the first lines of the script. You can also change the base directory using the
global variable $PBUILDFOLDER.
.PP
.\"
.SH EXAMPLES
.TP
pbuilder\-dist gutsy create
@ -81,33 +81,33 @@ Same as above, but stores \fBpbuilder\fP's output on a file.
.TP
pbuilder\-etch i386 update
Updates an existing i386-architecture Debian Etch environment on an amd64 system.
.\"
.SH FILES
By default, \fBpbuilder\-dist\fP will store all the files it generates in \fB~/pbuilder/\fP.
This can be changed by modifying the BASE_DIR value on the top of the script
to any other directory you want, or by using the $PBUILDFOLDER global variable.
If it doesn't exist, it will be created on the run.
.\"
.SH BUGS
There are no known bugs at the moment.
If you experience any problem with this script contact me on
siggi.gevatter@gmail.com.
rainct@ubuntu.com.
Please ensure first that the problem is really this script and not an issue
with \fBpbuilder\fP.
.\"
.SH AUTHORS
\fBpbuilder\-dist\fP was originally written by Jamin W. Collins <jcollins@asgardsrealm.net> and
Jordan Mantha <mantha@ubuntu.com>.
.PP
On August 2007 it was mostly rewritten, and extended, by Siegfried-Angel Gevatter Pujals
<siggi.gevatter@gmail.com>.
.\"
<rainct@ubuntu.com>.
.SH SEE ALSO
\fBpbuilder\fR, \fBpbuilderrc\fR
.\"
.SH COPYRIGHT
This manual page was written by Siegfried-Angel Gevatter Pujals (RainCT)
<siggi.gevatter@gmail.com> for YOU.
<rainct@ubuntu.com> for YOU.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU General Public License,
Version 2 or any later version published by the Free Software Foundation.

View File

@ -1,4 +1,4 @@
.TH REQUESTSYNC "1" "22 November 2007" "devscripts"
.TH REQUESTSYNC "1" "22 November 2007" "ubuntu-dev-tools"
.SH NAME
requestsync \- helper to file sync requests for Ubuntu
.SH SYNOPSIS

View File

@ -0,0 +1,39 @@
.\" Title: reverse-build-depends
.\" Author: Siegfried-Angel Gevatter Pujals
.\" Contact details: rainct@ubuntu.com
.TH REVERSE\-BUILD\-DEPENDS 1 "January 17, 2008" "ubuntu-dev-tools"
.SH NAME
reverse\-build\-depends \- find a package's reverse build dependencies
.SH SYNOPSIS
\fBreverse\-build\-depends\fP [\fB\-c\fP|\fB\-s\fP] <\fIpackage name\fR>
.SH DESCRIPTION
\fBreverse\-build\-depends\fP is a little script that prints a list of
all those Debian package that have a build dependency upon the package
you indicate, that is, they search for its reverse build dependencies.
.SH OPTIONS
.TP
\fB\-c\fP
This option will disable normal output and print only the number of
reverse dependencies instead.
.TP
\fB\-s\fP
If you prefer to see all build dependencies in a single line, use this
option. Otherwise, each one will be printed on its own line.
.SH KNOWN BUGS AND LIMITATIONS
Note that to use \fBreverse\-build\-depends\fP it is required for the source repositories
(deb-src lines) to be enabled in your sources.list.
.SH SEE ALSO
\fBgrep\-dctrl\fR, \fBapt\-cache\fR
.SH COPYRIGHT
\fBreverse\-build\-depends\fP and this manual page were written by
Siegfried-Angel Gevatter Pujals <rainct@ubuntu.com> for YOU. Both are
released under the terms of the GNU General Public License (version 2
or later).

View File

@ -1,4 +1,4 @@
.TH SUBMITTODEBIAN 1 "Dec 2007"
.TH SUBMITTODEBIAN 1 "Dec 2007" "ubuntu-dev-tools"
.SH NAME
submittodebian \- submit changes in Debian source tree to Debian
.SH SYNOPSIS

View File

@ -1,8 +1,8 @@
.\" Title: suspicious-source
.\" Author: Siegfried-Angel Gevatter Pujals
.\" Contact details: siggi.gevatter@gmail.com
.\" Contact details: rainct@ubuntu.com
.\"
.TH SUSPICIOUS\-SOURCE 1 "September 14, 2007"
.TH SUSPICIOUS\-SOURCE 1 "September 14, 2007" "ubuntu-dev-tools"
.\"
.SH NAME
suspicious\-source \- search for files that are not the GPL's "preferred form of modification"
@ -19,7 +19,7 @@ Neither the files inside version control system directories (like ".bzr/" or "CV
considered.
.\"
.SH AUTHORS
\fBsuspicious\-source\fP has been written by Siegfried-Angel Gevatter Pujals <siggi.gevatter@gmail.com>, based upon
\fBsuspicious\-source\fP has been written by Siegfried-Angel Gevatter Pujals <rainct@ubuntu.com>, based upon
a script with the same name, by Martin Pitt <martin.pitt@ubuntu.com>.
.\"
.SH SEE ALSO

View File

@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2007 (C) Siegfried-A. Gevatter <siggi.gevatter@gmail.com>
# Copyright 2007 (C) Siegfried-A. Gevatter <rainct@ubuntu.com>
# License: GPLv3 or later
#
# If you don't pass it any argument, this script will check if

View File

@ -1,7 +1,8 @@
#!/bin/sh
# Copyright (C) Jamin W. Collins <jcollins@asgardsrealm.net>
# and Jordan Mantha <mantha@ubuntu.com>
# Copyright 2007 (C) Siegfried-A. Gevatter <siggi.gevatter@gmail.com>
# Copyright by:
# Jamin W. Collins <jcollins@asgardsrealm.net>
# Jordan Mantha <mantha@ubuntu.com>
# Siegfried-A. Gevatter <rainct@ubuntu.com>
# License: GPLv2 or later
#
# This script is a wrapper to use pbuilder with many different

54
reverse-build-depends Executable file
View File

@ -0,0 +1,54 @@
#!/bin/bash
# Copyright (C) 2007 Siegfried-A. Gevatter <rainct@ubuntu.com>
# Based upon a short script by an unknown author
# License: GPLv2+
#
# This script is used to find the reverse build dependencies
# that a package has.
usage() {
echo "Usage: $0 [-c|-s] <package name>"
echo "Options:"
echo " -c: Print only the number of reverse dependencies."
echo " -s: Print all reverse dependencies in a single line."
}
if [ "$1" = '-c' ]
then
count=1
shift
fi
if [ "$1" = '-s' ]
then
single_line=1
shift
fi
if [ $# -ne 1 ];
then
usage
exit 1
fi
if [ "$1" = '-h' ] || [ "$1" = '--help' ]
then
usage
exit 0
fi
result=$(
grep-dctrl -sPackage -F Build-Depends,Build-Depends-Indep $1 \
/var/lib/apt/lists/*Sources | cut -d ' ' -f 2)
if [ -z $count ] && [ -z $single_line ]
then
echo "$result"
else
if [ -z $count ]
then
echo $result
else
echo "$result" | wc -l
fi
fi

View File

@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2007 (C) Siegfried-A. Gevatter <siggi.gevatter@gmail.com>
# Copyright 2007 (C) Siegfried-A. Gevatter <rainct@ubuntu.com>
# Based upon a script by Martin Pitt <martin.pitt@ubuntu.com>
# License: GPLv3 or later
#

View File

@ -1,9 +1,19 @@
#!/bin/bash
# Copyright 2006-2007 (C) Kees Cook <kees@ubuntu.com>
# Modified by Siegfried-A. Gevatter <siggi.gevatter@gmail.com>
# Modified by Siegfried-A. Gevatter <rainct@ubuntu.com>
# Modified by Daniel Hahler <ubuntu@thequod.de>
# License: GPLv2
if [ "$1" ] && ( [ $1 = '-h' ] || [ $1 = '--help' ] )
then
echo "Usage: $0 [-q]"
echo
echo "Run this inside the source directory of a Debian package and it will detect the patch system that it uses."
echo
echo "Additionally, it will try to print a list of all those files outside the debian/ directory that have been modified (if any); if you don't want this, use the -q option."
exit 0
fi
if [[ -d debian ]]; then
cd . # pass
elif [[ -d ../debian ]]; then
@ -11,16 +21,30 @@ elif [[ -d ../debian ]]; then
elif [[ -d ../patches ]]; then
cd ../..
else
echo "Can't find debian/rules."; exit
echo "Can't find debian/rules."
exit 1
fi
if [ "$1" != "-q" ]
then
files=`lsdiff -z ../$(dpkg-parsechangelog | grep ^Source: | sed -e "s/^Source: //")_$(dpkg-parsechangelog | grep ^Version: | sed -e "s/^Version: //").diff.gz 2>/dev/null | grep -v 'debian/'`
if [ -n "$files" ]
then
echo "Following files were modified outside of the debian/ directory:"
echo "$files"
echo "--------------------"
echo
echo -n "Patch System: "
fi
fi
for filename in $(echo "debian/rules"; grep ^include debian/rules | fgrep -v '$(' | awk '{print $2}')
do
fgrep patchsys.mk "$filename" | grep -q -v "^#" && { echo "cdbs"; exit; }
fgrep quilt "$filename" | grep -q -v "^#" && { echo "quilt"; exit; }
fgrep dbs-build.mk "$filename" | grep -q -v "^#" && { echo "dbs"; exit; }
fgrep dpatch "$filename" | grep -q -v "^#" && { echo "dpatch"; exit; }
fgrep '*.diff' "$filename" | grep -q -v "^#" && { echo "diff splash"; exit; }
fgrep patchsys.mk "$filename" | grep -q -v "^#" && { echo "cdbs"; exit 0; }
fgrep quilt "$filename" | grep -q -v "^#" && { echo "quilt"; exit 0; }
fgrep dbs-build.mk "$filename" | grep -q -v "^#" && { echo "dbs"; exit 0; }
fgrep dpatch "$filename" | grep -q -v "^#" && { echo "dpatch"; exit 0; }
fgrep '*.diff' "$filename" | grep -q -v "^#" && { echo "diff splash"; exit 0; }
done
[ -d debian/patches ] || { echo "patchless?"; exit; }
[ -d debian/patches ] || { echo "patchless?"; exit 0; }
echo "unknown patch system"