Gbp-Dch: Ignore
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
This commit is contained in:
Mattia Rizzolo 2020-06-26 20:47:05 +02:00
parent 622f550cc9
commit 097eea7d5f
No known key found for this signature in database
GPG Key ID: 0816B9E18C762BAD

View File

@ -22,6 +22,7 @@ from ubuntutools.update_maintainer import (update_maintainer,
restore_maintainer, restore_maintainer,
MaintainerUpdateException) MaintainerUpdateException)
def find_debian_dir(depth=6): def find_debian_dir(depth=6):
"""Scans up the directory hierarchy looking for a ./debian dir """Scans up the directory hierarchy looking for a ./debian dir
@ -29,13 +30,14 @@ def find_debian_dir(depth=6):
:rtype: str :rtype: str
:returns: a path to an existing debian/ directory, or None :returns: a path to an existing debian/ directory, or None
""" """
for path in ['../'*n or './' for n in list(range(0,depth+1))]: for path in ['../'*n or './' for n in list(range(0, depth+1))]:
debian_path = '{}debian'.format(path) debian_path = '{}debian'.format(path)
if os.path.exists(os.path.join(debian_path, 'control')) \ if os.path.exists(os.path.join(debian_path, 'control')) \
and os.path.exists(os.path.join(debian_path, 'changelog')): and os.path.exists(os.path.join(debian_path, 'changelog')):
return debian_path return debian_path
return None return None
def main(): def main():
script_name = os.path.basename(sys.argv[0]) script_name = os.path.basename(sys.argv[0])
usage = "%s [options]" % (script_name) usage = "%s [options]" % (script_name)