mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-16 09:31:08 +00:00
Add configurable debian directory location
This commit is contained in:
parent
fe2867ba1c
commit
9d312fbeec
3
debian/changelog
vendored
3
debian/changelog
vendored
@ -8,6 +8,7 @@ ubuntu-dev-tools (0.107) UNRELEASED; urgency=low
|
|||||||
- Sort debian/install as well as debian/*.install
|
- Sort debian/install as well as debian/*.install
|
||||||
- Add one-space-indentation option: --short-indent
|
- Add one-space-indentation option: --short-indent
|
||||||
- Remove null-entry from trailing comma in sorted lists
|
- Remove null-entry from trailing comma in sorted lists
|
||||||
|
- Add configurable debian directory location
|
||||||
* dgetlp, grab-merge, pull-lp-source, syncpackage: Export DEB_VENDOR=Ubuntu
|
* dgetlp, grab-merge, pull-lp-source, syncpackage: Export DEB_VENDOR=Ubuntu
|
||||||
when unpacking source packages. 3.0 (quilt) has optional per-vendor patch
|
when unpacking source packages. 3.0 (quilt) has optional per-vendor patch
|
||||||
series.
|
series.
|
||||||
@ -15,7 +16,7 @@ ubuntu-dev-tools (0.107) UNRELEASED; urgency=low
|
|||||||
[ Benjamin Drung ]
|
[ Benjamin Drung ]
|
||||||
* wrap-and-sort: Remove duplicate items from sorted lists.
|
* wrap-and-sort: Remove duplicate items from sorted lists.
|
||||||
|
|
||||||
-- Benjamin Drung <bdrung@ubuntu.com> Wed, 24 Nov 2010 21:00:40 +0100
|
-- Stefano Rivera <stefanor@ubuntu.com> Wed, 24 Nov 2010 22:12:57 +0200
|
||||||
|
|
||||||
ubuntu-dev-tools (0.106) experimental; urgency=low
|
ubuntu-dev-tools (0.106) experimental; urgency=low
|
||||||
|
|
||||||
|
@ -47,6 +47,9 @@ field name)
|
|||||||
\fB\-n\fR, \fB\-\-no\-cleanup\fR
|
\fB\-n\fR, \fB\-\-no\-cleanup\fR
|
||||||
do not remove trailing whitespaces
|
do not remove trailing whitespaces
|
||||||
.TP
|
.TP
|
||||||
|
\fB\-d\fIPATH\fR, \fB\-\-debian\-directory\fR=\fIPATH\fR
|
||||||
|
location of the \fIdebian\fR directory. Default: \fB./debian\fR
|
||||||
|
.TP
|
||||||
\fB\-v\fR, \fB\-\-verbose\fR
|
\fB\-v\fR, \fB\-\-verbose\fR
|
||||||
print all files that are touched
|
print all files that are touched
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ import debian.deb822
|
|||||||
import glob
|
import glob
|
||||||
import optparse
|
import optparse
|
||||||
import os
|
import os
|
||||||
|
import os.path
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
CONTROL_LIST_FIELDS = (
|
CONTROL_LIST_FIELDS = (
|
||||||
@ -123,33 +124,30 @@ def sort_list(l):
|
|||||||
param = filter(lambda x: x.startswith("${"), l)
|
param = filter(lambda x: x.startswith("${"), l)
|
||||||
return sorted(normal) + sorted(param)
|
return sorted(normal) + sorted(param)
|
||||||
|
|
||||||
def main(script_name, cleanup, wrap_always, short_indent, verbose=False):
|
def main(options):
|
||||||
if not os.path.isdir("debian"):
|
debdir = lambda x: os.path.join(options.debian_directory, x)
|
||||||
print >> sys.stderr, "%s: Error: No debian directory found." % \
|
|
||||||
(script_name)
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
control_files = filter(os.path.isfile,
|
control_files = filter(os.path.isfile,
|
||||||
["debian/control", "debian/control.in"])
|
[debdir("control"), debdir("control.in")])
|
||||||
for control_file in control_files:
|
for control_file in control_files:
|
||||||
if verbose:
|
if options.verbose:
|
||||||
print control_file
|
print control_file
|
||||||
control = Control(control_file, cleanup)
|
control = Control(control_file, options.cleanup)
|
||||||
control.wrap_and_sort(wrap_always, short_indent)
|
control.wrap_and_sort(options.wrap_always, options.short_indent)
|
||||||
control.save()
|
control.save()
|
||||||
|
|
||||||
copyright_files = filter(os.path.isfile,
|
copyright_files = filter(os.path.isfile,
|
||||||
["debian/copyright", "debian/copyright.in"])
|
[debdir("copyright"), debdir("copyright.in")])
|
||||||
for copyright_file in copyright_files:
|
for copyright_file in copyright_files:
|
||||||
if verbose:
|
if options.verbose:
|
||||||
print copyright_file
|
print copyright_file
|
||||||
remove_trailing_whitespaces(copyright_file)
|
remove_trailing_whitespaces(copyright_file)
|
||||||
|
|
||||||
install_files = sorted(glob.glob("debian/*.install"))
|
install_files = sorted(glob.glob(debdir("*.install")))
|
||||||
if os.path.isfile("debian/install"):
|
if os.path.isfile(debdir("install")):
|
||||||
install_files.insert(0, "debian/install")
|
install_files.insert(0, debdir("install"))
|
||||||
for install_file in install_files:
|
for install_file in install_files:
|
||||||
if verbose:
|
if options.verbose:
|
||||||
print install_file
|
print install_file
|
||||||
install = Install(install_file)
|
install = Install(install_file)
|
||||||
install.sort()
|
install.sort()
|
||||||
@ -166,10 +164,14 @@ if __name__ == "__main__":
|
|||||||
"long line", action="store_true", default=False)
|
"long line", action="store_true", default=False)
|
||||||
parser.add_option("-s", "--short-indent", dest="short_indent",
|
parser.add_option("-s", "--short-indent", dest="short_indent",
|
||||||
help="only indent wrapped lines by one space (default is "
|
help="only indent wrapped lines by one space (default is "
|
||||||
"in-line with the field name)", action="store_true",
|
"in-line with the field name)",
|
||||||
default=False)
|
action="store_true", default=False)
|
||||||
parser.add_option("-n", "--no-cleanup", help="don't cleanup whitespaces",
|
parser.add_option("-n", "--no-cleanup", help="don't cleanup whitespaces",
|
||||||
dest="cleanup", action="store_false", default=True)
|
dest="cleanup", action="store_false", default=True)
|
||||||
|
parser.add_option("-d", "--debian-directory",
|
||||||
|
help="location of the 'debian' directory. "
|
||||||
|
"Default: ./debian", dest="debian_directory",
|
||||||
|
metavar="PATH", default="debian")
|
||||||
parser.add_option("-v", "--verbose", help="print more information",
|
parser.add_option("-v", "--verbose", help="print more information",
|
||||||
dest="verbose", action="store_true", default=False)
|
dest="verbose", action="store_true", default=False)
|
||||||
|
|
||||||
@ -180,5 +182,10 @@ if __name__ == "__main__":
|
|||||||
"specified: %s") % (script_name, ", ".join(args))
|
"specified: %s") % (script_name, ", ".join(args))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
main(script_name, options.cleanup, options.wrap_always,
|
if not os.path.isdir(options.debian_directory):
|
||||||
options.short_indent, options.verbose)
|
print >> sys.stderr, (
|
||||||
|
'%s: Error: Debian directory not found, expecting "%s"'
|
||||||
|
% (script_name, options.debian_directory))
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
main(options)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user