summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2010-12-26 22:07:28 +0100
committerGuido Günther <agx@sigxcpu.org>2010-12-28 00:15:13 +0100
commit91b0aa890c5282746557ada7faa4b9a4353b23b4 (patch)
tree00d681367336fda4272e58b468b306d6de6bfe12
parentb23f05bd62734439c845be1c0c322eabb4d5bcb6 (diff)
pychecker warning cleanups
(mostly unused variables and imports)
-rwxr-xr-xgbp-pull1
-rw-r--r--gbp/config.py2
-rwxr-xr-xgit-buildpackage6
-rwxr-xr-xgit-dch10
-rwxr-xr-xgit-import-dsc12
-rwxr-xr-xgit-import-dscs2
-rwxr-xr-xgit-import-orig2
7 files changed, 14 insertions, 21 deletions
diff --git a/gbp-pull b/gbp-pull
index f8aa9c8..e7d9815 100755
--- a/gbp-pull
+++ b/gbp-pull
@@ -65,7 +65,6 @@ def fast_forward_branch(branch, repo, options):
return update
def main(argv):
- changelog = 'debian/changelog'
retval = 0
parser = GbpOptionParser(command=os.path.basename(argv[0]), prefix='',
diff --git a/gbp/config.py b/gbp/config.py
index 134d64f..c989afe 100644
--- a/gbp/config.py
+++ b/gbp/config.py
@@ -167,7 +167,7 @@ class GbpOptionParser(OptionParser):
self.__parse_config_files()
OptionParser.__init__(self, option_class=GbpOption, usage=usage, version='%s %s' % (self.command, gbp_version))
- def _is_boolean(self, option_name, *args, **kwargs):
+ def _is_boolean(self, dummy, *unused, **kwargs):
"""is option_name a boolean option"""
ret = False
try:
diff --git a/git-buildpackage b/git-buildpackage
index 12bb029..42049d3 100755
--- a/git-buildpackage
+++ b/git-buildpackage
@@ -27,7 +27,7 @@ import time
import gbp.deb as du
from gbp.git import (GitRepositoryError, GitRepository, build_tag)
from gbp.command_wrappers import (GitTag, Command, RunAtCommand, CommandExecFailed,
- PristineTar, RemoveTree, GitAdd, PristineTar)
+ PristineTar, RemoveTree, GitAdd)
from gbp.config import (GbpOptionParser, GbpOptionGroup)
from gbp.errors import GbpError
from glob import glob
@@ -150,7 +150,7 @@ def write_wc(repo):
os.unsetenv("GIT_INDEX_FILE")
return tree
-def drop_index(repo):
+def drop_index():
"""drop our custom index"""
if os.path.exists(wc_index):
os.unlink(wc_index)
@@ -437,7 +437,7 @@ def main(argv):
gbp.log.err(err)
retval = 1
finally:
- drop_index(repo)
+ drop_index()
if not options.tag_only:
if options.export_dir and options.purge and not retval:
diff --git a/git-dch b/git-dch
index cb15742..69c2792 100755
--- a/git-dch
+++ b/git-dch
@@ -31,7 +31,6 @@ from gbp.git import (GitRepositoryError, GitRepository, build_tag, tag_to_versio
from gbp.config import GbpOptionParser, GbpOptionGroup
from gbp.errors import GbpError
from gbp.deb import parse_changelog, NoChangelogError, is_native, compare_versions
-from gbp.command_wrappers import (Command, CommandExecFailed)
user_customizations = {}
snapshot_re = re.compile("\s*\*\* SNAPSHOT build @(?P<commit>[a-z0-9]+)\s+\*\*")
@@ -39,8 +38,8 @@ snapshot_re = re.compile("\s*\*\* SNAPSHOT build @(?P<commit>[a-z0-9]+)\s+\*\*")
def system(cmd):
try:
- Command(cmd, shell=True)()
- except CommandExecFailed:
+ gbpc.Command(cmd, shell=True)()
+ except gbpc.CommandExecFailed:
raise GbpError
@@ -292,7 +291,7 @@ def process_options(options, parser):
return dch_options
-def process_editor_option(options, parser):
+def process_editor_option(options):
# Determine Editor and check if we need it
states = ['always']
@@ -312,7 +311,6 @@ def main(argv):
changelog = 'debian/changelog'
until = 'HEAD'
found_snapshot_header = False
- first_commit = None
version_change = {}
try:
@@ -382,7 +380,7 @@ def main(argv):
(options, args) = parser.parse_args(argv[1:])
gbp.log.setup(options.color, options.verbose)
dch_options = process_options(options, parser)
- editor_cmd = process_editor_option(options, parser)
+ editor_cmd = process_editor_option(options)
try:
try:
diff --git a/git-import-dsc b/git-import-dsc
index db15e4c..9c96f02 100755
--- a/git-import-dsc
+++ b/git-import-dsc
@@ -59,9 +59,8 @@ def download_source(pkg, dirs):
return dsc
-def apply_patch(diff, unpack_dir):
+def apply_patch(diff):
"Apply patch to a source tree"
- d = os.path.abspath(unpack_dir)
pipe = pipes.Template()
pipe.prepend('gunzip -c %s' % diff, '.-')
pipe.append('patch -p1 --quiet', '-.')
@@ -76,9 +75,9 @@ def apply_patch(diff, unpack_dir):
return True
-def apply_deb_tgz(deb_tgz, unpack_dir):
+def apply_deb_tgz(deb_tgz):
"""Apply .debian.tar.gz (V3 source format)"""
- unpackArchive = gbpc.UnpackTarArchive(deb_tgz, ".")()
+ gbpc.UnpackTarArchive(deb_tgz, ".")()
return True
@@ -89,10 +88,10 @@ def apply_debian_patch(repo, unpack_dir, src, options, parents):
try:
os.chdir(unpack_dir)
- if src.diff and not apply_patch(src.diff, unpack_dir):
+ if src.diff and not apply_patch(src.diff):
raise GbpError
- if src.deb_tgz and not apply_deb_tgz(src.deb_tgz, unpack_dir):
+ if src.deb_tgz and not apply_deb_tgz(src.deb_tgz):
raise GbpError
if os.path.exists('debian/rules'):
@@ -104,7 +103,6 @@ def apply_debian_patch(repo, unpack_dir, src, options, parents):
author, email = parseaddr(dch['Maintainer'])
if not (author and email):
gbp.log.warn("Failed to parse maintainer")
-
commit = repo.commit_dir(unpack_dir,
"Imported Debian patch %s" % version,
branch = options.debian_branch,
diff --git a/git-import-dscs b/git-import-dscs
index d934760..418e136 100755
--- a/git-import-dscs
+++ b/git-import-dscs
@@ -19,8 +19,6 @@
import glob
import os
-import pipes
-import re
import sys
import tempfile
import gbp.command_wrappers as gbpc
diff --git a/git-import-orig b/git-import-orig
index f7ce667..10d85b1 100755
--- a/git-import-orig
+++ b/git-import-orig
@@ -414,7 +414,7 @@ on howto create it otherwise use --upstream-branch to specify it.
epoch = '%s:' % cp['Epoch']
info = { 'version': "%s%s-1" % (epoch, version) }
env = { 'GBP_BRANCH': options.debian_branch }
- cmd = gbpc.Command(options.postimport % info, extra_env=env, shell=True)()
+ gbpc.Command(options.postimport % info, extra_env=env, shell=True)()
except gbpc.CommandExecFailed:
raise GbpError, "Import of %s failed" % archive
except GbpNothingImported, err: