Commit 06b17e68 authored by Joerg Jaspert's avatar Joerg Jaspert 🇩🇪

Fix all the whitespace / tab breakage, so its now all the same

parent 30662a0d
2008-05-02 Joerg Jaspert <joerg@debian.org>
* config/debian/extensions.py: used reindent.py from the python
2.x source examples to get all dak code use the same indentation
style, no longer a mix of 4 spaces / 1 tab.
* dak/check_archive.py: likewise
* dak/check_overrides.py: likewise
* dak/check_proposed_updates.py: likewise
* dak/clean_proposed_updates.py: likewise
* dak/clean_queues.py: likewise
* dak/clean_suites.py: likewise
* dak/compare_suites.py: likewise
* dak/control_overrides.py: likewise
* dak/control_suite.py: likewise
* dak/cruft_report.py: likewise
* dak/dak.py: likewise
* dak/decode_dot_dak.py: likewise
* dak/examine_package.py: likewise
* dak/find_null_maintainers.py: likewise
* dak/generate_index_diffs.py: likewise
* dak/generate_releases.py: likewise
* dak/import_archive.py: likewise
* dak/import_keyring.py: likewise
* dak/import_ldap_fingerprints.py: likewise
* dak/import_users_from_passwd.py: likewise
* dak/init_db.py: likewise
* dak/init_dirs.py: likewise
* dak/ls.py: likewise
* dak/make_maintainers.py: likewise
* dak/make_overrides.py: likewise
* dak/make_suite_file_list.py: likewise
* dak/mirror_split.py: likewise
* dak/new_security_install.py: likewise
* dak/override.py: likewise
* dak/poolize.py: likewise
* dak/process_accepted.py: likewise
* dak/process_new.py: likewise
* dak/process_unchecked.py: likewise
* dak/queue_report.py: likewise
* dak/reject_proposed_updates.py: likewise
* dak/rm.py: likewise
* dak/security_install.py: likewise
* dak/show_new.py: likewise
* dak/split_done.py: likewise
* dak/stats.py: likewise
* dak/symlink_dists.py: likewise
* dak/test/001/test.py: likewise
* dak/test/002/test.py: likewise
* dak/transitions.py: likewise
* daklib/extensions.py: likewise
* daklib/logging.py: likewise
* daklib/queue.py: likewise
* daklib/utils.py: likewise
* scripts/debian/insert_missing_changedby.py: likewise
* dak/process_new.py (recheck): Make the path check more robust,
so we no longer have to keep process_new seperate trees between
security and normal archive.
......
......@@ -20,12 +20,12 @@ def check_transition():
if "source" not in changes["architecture"] or "unstable" not in changes["distribution"]:
return
# Also only check if there is a file defined (and existant) with
# Also only check if there is a file defined (and existant) with
# checks.
transpath = Cnf.get("Dinstall::Reject::ReleaseTransitions", "")
if transpath == "" or not os.path.exists(transpath):
return
# Parse the yaml file
sourcefile = file(transpath, 'r')
sourcecontent = sourcefile.read()
......@@ -90,10 +90,10 @@ def check_signed_by_key(oldfn):
if fpr == "5906F687BD03ACAD0D8E602EFCF37657" or uid == "iwj":
reject("Upload blocked due to hijack attempt 2008/03/19")
# NB: 1.15.0, 1.15.2 signed by this key targetted at unstable
# have been made available in the wild, and should remain
# blocked until Debian's dpkg has revved past those version
# numbers
# NB: 1.15.0, 1.15.2 signed by this key targetted at unstable
# have been made available in the wild, and should remain
# blocked until Debian's dpkg has revved past those version
# numbers
oldfn()
......
......@@ -94,14 +94,14 @@ def check_files():
print "Missing files:"
db_files.clear()
for i in ql:
filename = os.path.abspath(i[0] + i[1])
filename = os.path.abspath(i[0] + i[1])
db_files[filename] = ""
if os.access(filename, os.R_OK) == 0:
if i[2]:
if i[2]:
print "(last used: %s) %s" % (i[2], filename)
else:
else:
print "%s" % (filename)
filename = Cnf["Dir::Override"]+'override.unreferenced'
if os.path.exists(filename):
......@@ -201,7 +201,7 @@ def check_md5sums():
print "Checking file md5sums & sizes..."
for i in ql:
filename = os.path.abspath(i[0] + i[1])
filename = os.path.abspath(i[0] + i[1])
db_md5sum = i[2]
db_size = int(i[3])
try:
......@@ -238,7 +238,7 @@ def check_timestamps():
db_files.clear()
count = 0
for i in ql:
filename = os.path.abspath(i[0] + i[1])
filename = os.path.abspath(i[0] + i[1])
if os.access(filename, os.R_OK):
file = daklib.utils.open_file(filename)
current_file = filename
......@@ -375,7 +375,7 @@ def check_files_not_symlinks():
# q = projectB.query("BEGIN WORK")
for i in q_files:
filename = os.path.normpath(i[0] + i[1])
filename = os.path.normpath(i[0] + i[1])
# file_id = i[2]
if os.access(filename, os.R_OK) == 0:
daklib.utils.warn("%s: doesn't exist." % (filename))
......@@ -431,14 +431,14 @@ def main ():
Cnf = daklib.utils.get_conf()
Arguments = [('h',"help","Check-Archive::Options::Help")]
for i in [ "help" ]:
if not Cnf.has_key("Check-Archive::Options::%s" % (i)):
Cnf["Check-Archive::Options::%s" % (i)] = ""
if not Cnf.has_key("Check-Archive::Options::%s" % (i)):
Cnf["Check-Archive::Options::%s" % (i)] = ""
args = apt_pkg.ParseCommandLine(Cnf, Arguments, sys.argv)
Options = Cnf.SubTree("Check-Archive::Options")
if Options["Help"]:
usage()
usage()
if len(args) < 1:
daklib.utils.warn("dak check-archive requires at least one argument")
......
......@@ -156,7 +156,7 @@ SELECT s.source FROM source s, src_associations sa, files f, location l,
if not src_packages.has_key(package) or src_packages[package]:
continue
src_packages[package] = 1
Logger.log(["add missing override", osuite, component,
type, package, "source", sections[i[2]], i[3]])
if not Options["No-Action"]:
......@@ -327,7 +327,7 @@ def main ():
suiteids = []
for i in q.getresult():
suiteids.append(i[0])
if len(suiteids) != len(suites) or len(suiteids) < 1:
daklib.utils.fubar("Couldn't find id's of all suites: %s" % suites)
......@@ -351,4 +351,3 @@ def main ():
if __name__ == '__main__':
main()
......@@ -20,10 +20,10 @@
################################################################################
# | > amd64 is more mature than even some released architectures
# |
# |
# | This might be true of the architecture, unfortunately it seems to be the
# | exact opposite for most of the people involved with it.
#
#
# <1089213290.24029.6.camel@descent.netsplit.com>
################################################################################
......@@ -274,8 +274,8 @@ def main ():
('v',"verbose","Check-Proposed-Updates::Options::Verbose"),
('h',"help","Check-Proposed-Updates::Options::Help")]
for i in [ "debug", "quiet", "verbose", "help" ]:
if not Cnf.has_key("Check-Proposed-Updates::Options::%s" % (i)):
Cnf["Check-Proposed-Updates::Options::%s" % (i)] = ""
if not Cnf.has_key("Check-Proposed-Updates::Options::%s" % (i)):
Cnf["Check-Proposed-Updates::Options::%s" % (i)] = ""
arguments = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv)
Options = Cnf.SubTree("Check-Proposed-Updates::Options")
......
......@@ -167,8 +167,8 @@ def main ():
('s', "suite", "Clean-Proposed-Updates::Options::Suite", "HasArg"),
('n', "no-action", "Clean-Proposed-Updates::Options::No-Action"),]
for i in [ "debug", "verbose", "help", "no-action" ]:
if not Cnf.has_key("Clean-Proposed-Updates::Options::%s" % (i)):
Cnf["Clean-Proposed-Updates::Options::%s" % (i)] = ""
if not Cnf.has_key("Clean-Proposed-Updates::Options::%s" % (i)):
Cnf["Clean-Proposed-Updates::Options::%s" % (i)] = ""
# suite defaults to proposed-updates
if not Cnf.has_key("Clean-Proposed-Updates::Options::Suite"):
......@@ -199,4 +199,3 @@ def main ():
if __name__ == '__main__':
main()
......@@ -173,10 +173,10 @@ def main ():
Cnf = daklib.utils.get_conf()
for i in ["Help", "Incoming", "No-Action", "Verbose" ]:
if not Cnf.has_key("Clean-Queues::Options::%s" % (i)):
Cnf["Clean-Queues::Options::%s" % (i)] = ""
if not Cnf.has_key("Clean-Queues::Options::%s" % (i)):
Cnf["Clean-Queues::Options::%s" % (i)] = ""
if not Cnf.has_key("Clean-Queues::Options::Days"):
Cnf["Clean-Queues::Options::Days"] = "14"
Cnf["Clean-Queues::Options::Days"] = "14"
Arguments = [('h',"help","Clean-Queues::Options::Help"),
('d',"days","Clean-Queues::Options::Days", "IntLevel"),
......@@ -188,7 +188,7 @@ def main ():
Options = Cnf.SubTree("Clean-Queues::Options")
if Options["Help"]:
usage()
usage()
init()
......
......@@ -325,8 +325,8 @@ def main():
Cnf = daklib.utils.get_conf()
for i in ["Help", "No-Action" ]:
if not Cnf.has_key("Clean-Suites::Options::%s" % (i)):
Cnf["Clean-Suites::Options::%s" % (i)] = ""
if not Cnf.has_key("Clean-Suites::Options::%s" % (i)):
Cnf["Clean-Suites::Options::%s" % (i)] = ""
Arguments = [('h',"help","Clean-Suites::Options::Help"),
('n',"no-action","Clean-Suites::Options::No-Action")]
......@@ -355,4 +355,3 @@ def main():
if __name__ == '__main__':
main()
......@@ -47,14 +47,14 @@ def main ():
Cnf = daklib.utils.get_conf()
Arguments = [('h',"help","Compare-Suites::Options::Help")]
for i in [ "help" ]:
if not Cnf.has_key("Compare-Suites::Options::%s" % (i)):
Cnf["Compare-Suites::Options::%s" % (i)] = ""
if not Cnf.has_key("Compare-Suites::Options::%s" % (i)):
Cnf["Compare-Suites::Options::%s" % (i)] = ""
apt_pkg.ParseCommandLine(Cnf, Arguments, sys.argv)
Options = Cnf.SubTree("Compare-Suites::Options")
if Options["Help"]:
usage()
usage()
projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"]))
daklib.database.init(Cnf, projectB)
......@@ -99,4 +99,3 @@ ORDER BY b_src.package;"""
if __name__ == '__main__':
main()
......@@ -20,27 +20,27 @@
################################################################################
# On 30 Nov 1998, James Troup wrote:
#
#
# > James Troup<2> <troup2@debian.org>
# >
# >
# > James is a clone of James; he's going to take over the world.
# > After he gets some sleep.
#
#
# Could you clone other things too? Sheep? Llamas? Giant mutant turnips?
#
#
# Your clone will need some help to take over the world, maybe clone up an
# army of penguins and threaten to unleash them on the world, forcing
# governments to sway to the new James' will!
#
#
# Yes, I can envision a day when James' duplicate decides to take a horrific
# vengance on the James that spawned him and unleashes his fury in the form
# of thousands upon thousands of chickens that look just like Captin Blue
# Eye! Oh the horror.
#
#
# Now you'll have to were name tags to people can tell you apart, unless of
# course the new clone is truely evil in which case he should be easy to
# identify!
#
#
# Jason
# Chicken. Black. Helicopters.
# Be afraid.
......@@ -164,7 +164,7 @@ def process_file (file, suite, component, type, action):
if action == "add" or old_priority_id == priority_id and \
old_section_id == section_id and \
((old_maintainer_override == maintainer_override) or \
(old_maintainer_override == "" and maintainer_override == None)):
(old_maintainer_override == "" and maintainer_override == None)):
# If it's unchanged or we're in 'add only' mode, ignore it
c_skipped += 1
continue
......@@ -251,14 +251,14 @@ def main ():
# Default arguments
for i in [ "add", "help", "list", "quiet", "set" ]:
if not Cnf.has_key("Control-Overrides::Options::%s" % (i)):
Cnf["Control-Overrides::Options::%s" % (i)] = ""
if not Cnf.has_key("Control-Overrides::Options::%s" % (i)):
Cnf["Control-Overrides::Options::%s" % (i)] = ""
if not Cnf.has_key("Control-Overrides::Options::Component"):
Cnf["Control-Overrides::Options::Component"] = "main"
Cnf["Control-Overrides::Options::Component"] = "main"
if not Cnf.has_key("Control-Overrides::Options::Suite"):
Cnf["Control-Overrides::Options::Suite"] = "unstable"
Cnf["Control-Overrides::Options::Suite"] = "unstable"
if not Cnf.has_key("Control-Overrides::Options::Type"):
Cnf["Control-Overrides::Options::Type"] = "deb"
Cnf["Control-Overrides::Options::Type"] = "deb"
file_list = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv)
......@@ -283,7 +283,7 @@ def main ():
list(suite, component, type)
else:
if Cnf.has_key("Suite::%s::Untouchable" % suite) and Cnf["Suite::%s::Untouchable" % suite] != 0:
daklib.utils.fubar("%s: suite is untouchable" % suite)
daklib.utils.fubar("%s: suite is untouchable" % suite)
Logger = daklib.logging.Logger(Cnf, "control-overrides")
if file_list:
......@@ -297,4 +297,3 @@ def main ():
if __name__ == '__main__':
main()
......@@ -242,14 +242,14 @@ def main ():
('s',"set", "Control-Suite::Options::Set", "HasArg")]
for i in ["add", "help", "list", "remove", "set", "version" ]:
if not Cnf.has_key("Control-Suite::Options::%s" % (i)):
Cnf["Control-Suite::Options::%s" % (i)] = ""
if not Cnf.has_key("Control-Suite::Options::%s" % (i)):
Cnf["Control-Suite::Options::%s" % (i)] = ""
file_list = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv)
Options = Cnf.SubTree("Control-Suite::Options")
if Options["Help"]:
usage()
usage()
projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"],int(Cnf["DB::Port"]))
......@@ -290,4 +290,3 @@ def main ():
if __name__ == '__main__':
main()
......@@ -133,7 +133,7 @@ SELECT s.source, s.version AS experimental, s2.version AS unstable
nviu_to_remove = []
print "Newer version in unstable"
print "-------------------------"
print
print
for i in ql:
(source, experimental_version, unstable_version) = i
print " o %s (%s, %s)" % (source, experimental_version, unstable_version)
......@@ -180,7 +180,7 @@ def do_nbs(real_nbs):
def do_dubious_nbs(dubious_nbs):
print "Dubious NBS"
print "-----------"
print
print
dubious_nbs_keys = dubious_nbs.keys()
dubious_nbs_keys.sort()
......@@ -196,7 +196,7 @@ def do_dubious_nbs(dubious_nbs):
packages.sort()
print " o %s: %s" % (version, ", ".join(packages))
print
print
################################################################################
......@@ -253,8 +253,8 @@ def main ():
('m',"mode","Cruft-Report::Options::Mode", "HasArg"),
('s',"suite","Cruft-Report::Options::Suite","HasArg")]
for i in [ "help" ]:
if not Cnf.has_key("Cruft-Report::Options::%s" % (i)):
Cnf["Cruft-Report::Options::%s" % (i)] = ""
if not Cnf.has_key("Cruft-Report::Options::%s" % (i)):
Cnf["Cruft-Report::Options::%s" % (i)] = ""
Cnf["Cruft-Report::Options::Suite"] = Cnf["Dinstall::DefaultSuite"]
if not Cnf.has_key("Cruft-Report::Options::Mode"):
......@@ -264,7 +264,7 @@ def main ():
Options = Cnf.SubTree("Cruft-Report::Options")
if Options["Help"]:
usage()
usage()
# Set up checks based on mode
if Options["Mode"] == "daily":
......@@ -400,7 +400,7 @@ def main ():
duplicate_bins[key].append(package)
packages.close()
os.unlink(temp_filename)
if "obsolete source" in checks:
do_obsolete_source(duplicate_bins, bin2source)
......@@ -440,24 +440,24 @@ def main ():
binaries = bin_not_built[source].keys()
binaries.sort()
print " o %s: %s" % (source, ", ".join(binaries))
print
print
if "bms" in checks:
print "Built from multiple source packages"
print "-----------------------------------"
print
print
keys = duplicate_bins.keys()
keys.sort()
for key in keys:
(source_a, source_b) = key.split("_")
print " o %s & %s => %s" % (source_a, source_b, ", ".join(duplicate_bins[key]))
print
print
if "anais" in checks:
print "Architecture Not Allowed In Source"
print "----------------------------------"
print anais_output
print
print
if "dubious nbs" in checks:
do_dubious_nbs(dubious_nbs)
......
......@@ -36,12 +36,12 @@ import daklib.utils, daklib.extensions
class UserExtension:
def __init__(self, user_extension = None):
if user_extension:
m = imp.load_source("dak_userext", user_extension)
d = m.__dict__
m = imp.load_source("dak_userext", user_extension)
d = m.__dict__
else:
m, d = None, {}
self.__dict__["_module"] = m
self.__dict__["_d"] = d
self.__dict__["_module"] = m
self.__dict__["_d"] = d
def __getattr__(self, a):
if a in self.__dict__: return self.__dict__[a]
......@@ -49,19 +49,19 @@ class UserExtension:
return self._d.get(a, None)
def __setattr__(self, a, v):
self._d[a] = v
self._d[a] = v
################################################################################
class UserExtension:
def __init__(self, user_extension = None):
if user_extension:
m = imp.load_source("dak_userext", user_extension)
d = m.__dict__
m = imp.load_source("dak_userext", user_extension)
d = m.__dict__
else:
m, d = None, {}
self.__dict__["_module"] = m
self.__dict__["_d"] = d
self.__dict__["_module"] = m
self.__dict__["_d"] = d
def __getattr__(self, a):
if a in self.__dict__: return self.__dict__[a]
......@@ -69,7 +69,7 @@ class UserExtension:
return self._d.get(a, None)
def __setattr__(self, a, v):
self._d[a] = v
self._d[a] = v
################################################################################
......@@ -88,17 +88,17 @@ def init():
"Produce a report on NEW and BYHAND packages"),
("show-new",
"Output html for packages in NEW"),
("rm",
"Remove packages from suites"),
("process-new",
"Process NEW and BYHAND packages"),
("process-unchecked",
"Process packages in queue/unchecked"),
("process-accepted",
"Install packages into the pool"),
("make-suite-file-list",
"Generate lists of packages per suite for apt-ftparchive"),
("generate-releases",
......@@ -166,7 +166,7 @@ def init():
"Generate compatability symlinks from dists/ into pool/"),
]
return functionality
################################################################################
def usage(functionality, exit_code=0):
......@@ -194,7 +194,7 @@ def main():
functionality = init()
modules = [ command for (command, _) in functionality ]
if len(sys.argv) == 0:
daklib.utils.fubar("err, argc == 0? how is that possible?")
elif (len(sys.argv) == 1
......
......@@ -28,7 +28,7 @@
import sys
import apt_pkg
import daklib.queue
import daklib.queue
import daklib.utils
################################################################################
......@@ -46,21 +46,21 @@ def main():
Cnf = daklib.utils.get_conf()
Arguments = [('h',"help","Decode-Dot-Dak::Options::Help")]
for i in [ "help" ]:
if not Cnf.has_key("Decode-Dot-Dak::Options::%s" % (i)):
Cnf["Decode-Dot-Dak::Options::%s" % (i)] = ""
if not Cnf.has_key("Decode-Dot-Dak::Options::%s" % (i)):
Cnf["Decode-Dot-Dak::Options::%s" % (i)] = ""
apt_pkg.ParseCommandLine(Cnf, Arguments, sys.argv)
Options = Cnf.SubTree("Decode-Dot-Dak::Options")
if Options["Help"]:
usage()
usage()
k = daklib.queue.Upload(Cnf)
for arg in sys.argv[1:]:
arg = daklib.utils.validate_changes_file_arg(arg,require_changes=-1)
k.pkg.changes_file = arg
print "%s:" % (arg)
k.init_vars()
k.init_vars()
k.update_vars()
changes = k.pkg.changes
......@@ -131,4 +131,3 @@ def main():
if __name__ == '__main__':
main()
This diff is collapsed.
......@@ -53,14 +53,14 @@ def main():
Cnf = daklib.utils.get_conf()
Arguments = [('h',"help","Find-Null-Maintainers::Options::Help")]
for i in [ "help" ]:
if not Cnf.has_key("Find-Null-Maintainers::Options::%s" % (i)):
Cnf["Find-Null-Maintainers::Options::%s" % (i)] = ""
if not Cnf.has_key("Find-Null-Maintainers::Options::%s" % (i)):
Cnf["Find-Null-Maintainers::Options::%s" % (i)] = ""
apt_pkg.ParseCommandLine(Cnf, Arguments, sys.argv)
Options = Cnf.SubTree("Find-Null-Maintainers::Options")
if Options["Help"]:
usage()
usage()
projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"]))
......
......@@ -107,51 +107,51 @@ class Updates:
self.filesizesha1 = None
if readpath:
try:
f = open(readpath + "/Index")
x = f.readline()
try:
f = open(readpath + "/Index")
x = f.readline()
def read_hashs(ind, f, self, x=x):
while 1:
x = f.readline()
if not x or x[0] != " ": break
def read_hashs(ind, f, self, x=x):
while 1:
x = f.readline()
if not x or x[0] != " ": break
l = x.split()
if not self.history.has_key(l[2]):
self.history[l[2]] = [None,None]
self.history_order.append(l[2])
self.history[l[2]][ind] = (l[0], int(l[1]))
return x
while x:
l = x.split()
if not self.history.has_key(l[2]):
self.history[l[2]] = [None,None]
self.history_order.append(l[2])
self.history[l[2]][ind] = (l[0], int(l[1]))
return x
while x:
l = x.split()
if len(l) == 0:
x = f.readline()
continue
if len(l) == 0:
x = f.readline()
continue
if l[0] == "SHA1-History:":
x = read_hashs(0,f,self)
continue
if l[0] == "SHA1-History:":
x = read_hashs(0,f,self)
continue
if l[0] == "SHA1-Patches:":
x = read_hashs(1,f,self)
continue
if l[0] == "SHA1-Patches:":
x = read_hashs(1,f,self)
continue
if l[0] == "Canonical-Name:" or l[0]=="Canonical-Path:":
self.can_path = l[1]
if l[0] == "Canonical-Name:" or l[0]=="Canonical-Path:":
self.can_path = l[1]
if l[0] == "SHA1-Current:" and len(l) == 3:
self.filesizesha1 = (l[1], int(l[2]))
if l[0] == "SHA1-Current:" and len(l) == 3:
self.filesizesha1 = (l[1], int(l[2]))
x = f.readline()
x = f.readline()
except IOError:
0
except IOError:
0
def dump(self, out=sys.stdout):
if self.can_path:
out.write("Canonical-Path: %s\n" % (self.can_path))
if self.filesizesha1:
out.write("SHA1-Current: %s %7d\n" % (self.filesizesha1))
......@@ -164,7 +164,7 @@ class Updates:
tryunlink("%s/%s.gz" % (self.readpath, h))
del hs[h]
l = l[cnt-self.max:]
self.history_order = l[:]
self.history_order = l[:]
out.write("SHA1-History:\n")
for h in l:
......@@ -192,7 +192,7 @@ def sizesha1(f):
return (sha1sum, size)
def genchanges(Options, outdir, oldfile, origfile, maxdiffs = 14):
if Options.has_key("NoAct"):
if Options.has_key("NoAct"):
return
patchname = Options["PatchName"]
......@@ -258,7 +258,7 @@ def genchanges(Options, outdir, oldfile, origfile, maxdiffs = 14):
print "%s: unchanged" % (origfile)
else:
if not os.path.isdir(outdir): os.mkdir(outdir)
w = os.popen("diff --ed - %s | gzip -c -9 > %s.gz" %