debian/bin: PEP8 and other style fixes.
svn path=/dists/trunk/linux-2.6/; revision=18489
This commit is contained in:
parent
9863acaddd
commit
a4a27ffb31
|
@ -3,7 +3,12 @@
|
||||||
import sys
|
import sys
|
||||||
sys.path.append(sys.path[0] + "/../lib/python")
|
sys.path.append(sys.path[0] + "/../lib/python")
|
||||||
|
|
||||||
import optparse, os, shutil, tempfile, urllib2
|
import optparse
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
import tempfile
|
||||||
|
import urllib2
|
||||||
|
|
||||||
from debian_linux.abi import Symbols
|
from debian_linux.abi import Symbols
|
||||||
from debian_linux.config import *
|
from debian_linux.config import *
|
||||||
from debian_linux.debian import *
|
from debian_linux.debian import *
|
||||||
|
@ -11,6 +16,7 @@ from debian_linux.debian import *
|
||||||
default_url_base = "http://ftp.de.debian.org/debian/"
|
default_url_base = "http://ftp.de.debian.org/debian/"
|
||||||
default_url_base_incoming = "http://incoming.debian.org/"
|
default_url_base_incoming = "http://incoming.debian.org/"
|
||||||
|
|
||||||
|
|
||||||
class url_debian_flat(object):
|
class url_debian_flat(object):
|
||||||
def __init__(self, base):
|
def __init__(self, base):
|
||||||
self.base = base
|
self.base = base
|
||||||
|
@ -18,6 +24,7 @@ class url_debian_flat(object):
|
||||||
def __call__(self, source, filename):
|
def __call__(self, source, filename):
|
||||||
return self.base + filename
|
return self.base + filename
|
||||||
|
|
||||||
|
|
||||||
class url_debian_pool(object):
|
class url_debian_pool(object):
|
||||||
def __init__(self, base):
|
def __init__(self, base):
|
||||||
self.base = base
|
self.base = base
|
||||||
|
@ -25,7 +32,8 @@ class url_debian_pool(object):
|
||||||
def __call__(self, source, filename):
|
def __call__(self, source, filename):
|
||||||
return self.base + "pool/main/" + source[0] + "/" + source + "/" + filename
|
return self.base + "pool/main/" + source[0] + "/" + source + "/" + filename
|
||||||
|
|
||||||
class main(object):
|
|
||||||
|
class Main(object):
|
||||||
dir = None
|
dir = None
|
||||||
|
|
||||||
def __init__(self, url, url_config=None, arch=None, featureset=None, flavour=None):
|
def __init__(self, url, url_config=None, arch=None, featureset=None, flavour=None):
|
||||||
|
|
|
@ -1,13 +1,18 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import os, os.path, subprocess, sys
|
import sys
|
||||||
sys.path.append("debian/lib/python")
|
sys.path.append("debian/lib/python")
|
||||||
|
|
||||||
|
import os
|
||||||
|
import os.path
|
||||||
|
import subprocess
|
||||||
|
|
||||||
from debian_linux.config import ConfigCoreHierarchy
|
from debian_linux.config import ConfigCoreHierarchy
|
||||||
from debian_linux.debian import *
|
from debian_linux.debian import *
|
||||||
from debian_linux.gencontrol import Gencontrol as Base
|
from debian_linux.gencontrol import Gencontrol as Base
|
||||||
from debian_linux.utils import Templates, read_control
|
from debian_linux.utils import Templates, read_control
|
||||||
|
|
||||||
|
|
||||||
class Gencontrol(Base):
|
class Gencontrol(Base):
|
||||||
def __init__(self, config_dirs=["debian/config"], template_dirs=["debian/templates"]):
|
def __init__(self, config_dirs=["debian/config"], template_dirs=["debian/templates"]):
|
||||||
super(Gencontrol, self).__init__(ConfigCoreHierarchy(config_dirs), Templates(template_dirs), VersionLinux)
|
super(Gencontrol, self).__init__(ConfigCoreHierarchy(config_dirs), Templates(template_dirs), VersionLinux)
|
||||||
|
|
|
@ -12,6 +12,7 @@ import subprocess
|
||||||
from debian_linux.debian import Changelog, VersionLinux
|
from debian_linux.debian import Changelog, VersionLinux
|
||||||
from debian_linux.patches import PatchSeries
|
from debian_linux.patches import PatchSeries
|
||||||
|
|
||||||
|
|
||||||
class Main(object):
|
class Main(object):
|
||||||
def __init__(self, input_files, override_version):
|
def __init__(self, input_files, override_version):
|
||||||
self.log = sys.stdout.write
|
self.log = sys.stdout.write
|
||||||
|
@ -109,11 +110,13 @@ class Main(object):
|
||||||
out = os.path.join("../orig", self.orig_tar)
|
out = os.path.join("../orig", self.orig_tar)
|
||||||
try:
|
try:
|
||||||
os.mkdir("../orig")
|
os.mkdir("../orig")
|
||||||
except OSError: pass
|
except OSError:
|
||||||
|
pass
|
||||||
try:
|
try:
|
||||||
os.stat(out)
|
os.stat(out)
|
||||||
raise RuntimeError("Destination already exists")
|
raise RuntimeError("Destination already exists")
|
||||||
except OSError: pass
|
except OSError:
|
||||||
|
pass
|
||||||
self.log("Generate tarball %s\n" % out)
|
self.log("Generate tarball %s\n" % out)
|
||||||
cmdline = ['tar -czf', out, '-C', self.dir, self.orig]
|
cmdline = ['tar -czf', out, '-C', self.dir, self.orig]
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -7,6 +7,7 @@ import sys
|
||||||
|
|
||||||
from debian_linux.kconfig import *
|
from debian_linux.kconfig import *
|
||||||
|
|
||||||
|
|
||||||
def merge(output, configs, overrides):
|
def merge(output, configs, overrides):
|
||||||
kconfig = KconfigFile()
|
kconfig = KconfigFile()
|
||||||
for c in configs:
|
for c in configs:
|
||||||
|
@ -15,6 +16,7 @@ def merge(output, configs, overrides):
|
||||||
kconfig.set(key, value)
|
kconfig.set(key, value)
|
||||||
file(output, "w").write(str(kconfig))
|
file(output, "w").write(str(kconfig))
|
||||||
|
|
||||||
|
|
||||||
def opt_callback_dict(option, opt, value, parser):
|
def opt_callback_dict(option, opt, value, parser):
|
||||||
match = re.match('^\s*(\S+)=(\S+)\s*$', value)
|
match = re.match('^\s*(\S+)=(\S+)\s*$', value)
|
||||||
if not match:
|
if not match:
|
||||||
|
@ -23,6 +25,7 @@ def opt_callback_dict(option, opt, value, parser):
|
||||||
data = getattr(parser.values, dest)
|
data = getattr(parser.values, dest)
|
||||||
data[match.group(1)] = match.group(2)
|
data[match.group(1)] = match.group(2)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = optparse.OptionParser(usage="%prog [OPTION]... FILE...")
|
parser = optparse.OptionParser(usage="%prog [OPTION]... FILE...")
|
||||||
parser.add_option('-o', '--override',
|
parser.add_option('-o', '--override',
|
||||||
|
|
Loading…
Reference in New Issue