X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Ftransitions.py;h=68c65b6a070bf9dbe84d3f8a664c95ccd89572d0;hb=03a86547e5d9b209016cc0b23f825d3baea92f8c;hp=a5eb6b6cd1e5338861b27cfb61e15a7644ca9d2d;hpb=f7e8ab5cc1ef088763a6e0f2b0cdba9ec2b63c87;p=dak.git diff --git a/dak/transitions.py b/dak/transitions.py index a5eb6b6c..68c65b6a 100755 --- a/dak/transitions.py +++ b/dak/transitions.py @@ -76,9 +76,9 @@ def init(): if not Cnf.has_key("Edit-Transitions::Options::%s" % (i)): Cnf["Edit-Transitions::Options::%s" % (i)] = "" - apt_pkg.ParseCommandLine(Cnf, Arguments, sys.argv) + apt_pkg.parse_commandline(Cnf, Arguments, sys.argv) - Options = Cnf.SubTree("Edit-Transitions::Options") + Options = Cnf.subtree("Edit-Transitions::Options") if Options["help"]: usage() @@ -134,7 +134,7 @@ def load_transitions(trans_file): sourcecontent = sourcefile.read() failure = False try: - trans = yaml.load(sourcecontent) + trans = yaml.safe_load(sourcecontent) except yaml.YAMLError as exc: # Someone fucked it up print "ERROR: %s" % (exc) @@ -262,7 +262,7 @@ def write_transitions(from_trans): temp_lock = lock_file(trans_temp) destfile = file(trans_temp, 'w') - yaml.dump(from_trans, destfile, default_flow_style=False) + yaml.safe_dump(from_trans, destfile, default_flow_style=False) destfile.close() os.rename(trans_temp, trans_file) @@ -321,7 +321,7 @@ def temp_transitions_file(transitions): (fd, path) = tempfile.mkstemp("", "transitions", Cnf["Dir::TempPath"]) os.chmod(path, 0o644) f = open(path, "w") - yaml.dump(transitions, f, default_flow_style=False) + yaml.safe_dump(transitions, f, default_flow_style=False) return path ################################################################################ @@ -415,7 +415,7 @@ def check_transitions(transitions): print "Transition source %s not in testing, transition still ongoing." % (source) else: current = sourceobj.version - compare = apt_pkg.VersionCompare(current, expected) + compare = apt_pkg.version_compare(current, expected) if compare < 0: # This is still valid, the current version in database is older than # the new version we wait for @@ -540,7 +540,7 @@ def transition_info(transitions): # No package in testing print "Transition source %s not in testing, transition still ongoing." % (source) else: - compare = apt_pkg.VersionCompare(sourceobj.version, expected) + compare = apt_pkg.version_compare(sourceobj.version, expected) print "Apt compare says: %s" % (compare) if compare < 0: # This is still valid, the current version in database is older than