Check for dependencies that the package doesn't Depend on. Recommend

dput, lintian, patch, quilt. (LP: #846385)
This commit is contained in:
Stefano Rivera 2012-02-15 16:10:43 +02:00
parent 948032d8a3
commit 30da459114
4 changed files with 34 additions and 1 deletions

2
debian/changelog vendored
View File

@ -7,6 +7,8 @@ ubuntu-dev-tools (0.139) UNRELEASED; urgency=low
- Determine the task from the UDD branch.
- Support syncs of new packages.
- Support syncs from a non-default series (LP: #931644)
- Check for dependencies that the package doesn't Depend on. Recommend
dput, lintian, patch, quilt. (LP: #846385)
* Re-add dgetlp. Still needed for downloading source packages from +queue.
(LP: #919805)
* pbuilder-dist: Export DISTRIBUTION and ARCHITECTURE as well as DIST and

4
debian/control vendored
View File

@ -53,13 +53,17 @@ Recommends: bzr,
debian-archive-keyring,
debian-keyring,
debootstrap,
dput,
genisoimage,
lintian,
libwww-perl,
pbuilder | cowdancer | sbuild,
patch,
perl-modules,
python-dns,
python-gnupginterface,
python-soappy,
quilt,
reportbug (>= 3.39ubuntu1)
Suggests: ipython, python-simplejson | python (>= 2.7), qemu-user-static
Description: useful tools for Ubuntu developers

View File

@ -24,7 +24,8 @@ from devscripts.logger import Logger
from ubuntutools.config import UDTConfig
from ubuntutools.builder import get_builder
from ubuntutools.sponsor_patch.sponsor_patch import sponsor_patch
from ubuntutools.sponsor_patch.sponsor_patch import (sponsor_patch,
check_dependencies)
def parse(script_name):
"""Parse the command line parameters."""
@ -65,6 +66,7 @@ def parse(script_name):
(options, args) = parser.parse_args()
Logger.set_verbosity(options.verbose)
check_dependencies()
if len(args) == 0:
Logger.error("No bug number specified.")

View File

@ -35,6 +35,31 @@ from ubuntutools.sponsor_patch.patch import Patch
from ubuntutools.sponsor_patch.question import ask_for_manual_fixing
from ubuntutools.sponsor_patch.source_package import SourcePackage
def is_command_available(command):
"Is command in $PATH?"
path = os.environ.get('PATH', '/usr/bin:/bin')
return any(os.access(os.path.join(directory, command), os.X_OK)
for directory in path.split(':'))
def check_dependencies():
"Do we have all the commands we need for full functionality?"
missing = []
for cmd in ('patch', 'bzr', 'quilt', 'dput', 'lintian'):
if not is_command_available(cmd):
missing.append(cmd)
if not is_command_available('bzr-buildpackage'):
missing.append('bzr-builddeb')
if not any(is_command_available(cmd)
for cmd in ('pbuilder', 'sbuild', 'cowbuilder')):
missing.append('pbuilder/cowbuilder/sbuild')
if missing:
Logger.warn("sponsor-patch requires %s to be installed for full "
"functionality", ', '.join(missing))
def get_source_package_name(bug_task):
package = None
if bug_task.bug_target_name != "ubuntu":