mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-13 08:01:09 +00:00
update to allow for missing rules file
This commit is contained in:
parent
9ebaa17ad8
commit
6265047606
@ -243,3 +243,11 @@ class UpdateMaintainerTestCase(mox.MoxTestBase, unittest.TestCase):
|
|||||||
self._files["rules"] = StringIO.StringIO(_COMPLEX_RULES)
|
self._files["rules"] = StringIO.StringIO(_COMPLEX_RULES)
|
||||||
update_maintainer(self._directory)
|
update_maintainer(self._directory)
|
||||||
self.assertEqual(self._files["control"].getvalue(), _ABP_CONTROL)
|
self.assertEqual(self._files["control"].getvalue(), _ABP_CONTROL)
|
||||||
|
|
||||||
|
def test_update_maintainer_missing_rules(self):
|
||||||
|
"""Test: Skip XSBC-Original test when debian/rules is missing."""
|
||||||
|
self._files["changelog"] = StringIO.StringIO(_LUCID_CHANGELOG)
|
||||||
|
self._files["control"] = StringIO.StringIO(_ABP_CONTROL)
|
||||||
|
self._files["rules"] = None
|
||||||
|
update_maintainer(self._directory)
|
||||||
|
self.assertEqual(self._files["control"].getvalue(), _ABP_UPDATED)
|
||||||
|
@ -62,7 +62,9 @@ def update_maintainer(debian_directory, verbose=False):
|
|||||||
|
|
||||||
# If the rules file accounts for XSBC-Original-Maintainer, we should not
|
# If the rules file accounts for XSBC-Original-Maintainer, we should not
|
||||||
# touch it in this package (e.g. the python package).
|
# touch it in this package (e.g. the python package).
|
||||||
if 'XSBC-Original-' in open(os.path.join(debian_directory, "rules")).read():
|
rules_file = os.path.join(debian_directory, "rules")
|
||||||
|
if os.path.isfile(rules_file) and \
|
||||||
|
'XSBC-Original-' in open(rules_file).read():
|
||||||
if verbose:
|
if verbose:
|
||||||
print "XSBC-Original is managed by 'rules' file. Doing nothing."
|
print "XSBC-Original is managed by 'rules' file. Doing nothing."
|
||||||
return(0)
|
return(0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user