Commit 587010df authored by Jelmer Vernooij's avatar Jelmer Vernooij

Move lintian_brush to package.

parent d7e3438f
......@@ -85,32 +85,3 @@ def run_lintian_fixers(local_tree, fixers, update_changelog=True):
ret.append((fixer.tag, description))
return ret
if __name__ == '__main__':
import argparse
import sys
from breezy.workingtree import WorkingTree
import locale
locale.setlocale(locale.LC_ALL, '')
# Use better default than ascii with posix filesystems that deal in bytes
# natively even when the C locale or no locale at all is given. Note that
# we need an immortal string for the hack, hence the lack of a hyphen.
sys._brz_default_fs_enc = "utf8"
import breezy
breezy.initialize()
import breezy.git
import breezy.bzr
import breezy.plugins.launchpad
import breezy.plugins.debian # for apt: urls
parser = argparse.ArgumentParser()
parser.add_argument('--no-update-changelog', action="store_true", help="Whether to update the changelog.")
parser.add_argument('fixers', metavar='TAGS', nargs='*', help='Lintian tag for which to apply fixer.')
args = parser.parse_args()
wt = WorkingTree.open('.')
fixers = available_lintian_fixers()
if args.fixers:
fixers = [f for f in fixers if f.tag in args.fixers]
with wt.lock_write():
run_lintian_fixers(wt, fixers, update_changelog=(not args.no_update_changelog))
import os
import argparse
import subprocess
import sys
from breezy.workingtree import WorkingTree
import locale
locale.setlocale(locale.LC_ALL, '')
# Use better default than ascii with posix filesystems that deal in bytes
# natively even when the C locale or no locale at all is given. Note that
# we need an immortal string for the hack, hence the lack of a hyphen.
sys._brz_default_fs_enc = "utf8"
import breezy
breezy.initialize()
import breezy.git
import breezy.bzr
import breezy.plugins.launchpad
import breezy.plugins.debian # for apt: urls
from breezy.trace import note
from . import (
available_lintian_fixers,
run_lintian_fixers,
)
parser = argparse.ArgumentParser()
parser.add_argument('--no-update-changelog', action="store_true", help="Whether to update the changelog.")
parser.add_argument('fixers', metavar='TAGS', nargs='*', help='Lintian tag for which to apply fixer.')
args = parser.parse_args()
wt = WorkingTree.open('.')
fixers = available_lintian_fixers()
if args.fixers:
fixers = [f for f in fixers if f.tag in args.fixers]
with wt.lock_write():
run_lintian_fixers(wt, fixers, update_changelog=(not args.no_update_changelog))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment