--- commandline.py.orig 2012-02-29 19:24:04.000000000 +0000 +++ commandline.py 2014-01-13 11:10:34.761049148 +0000 @@ -388,6 +388,9 @@ parser.add_option("--include-regexp", metavar=_("regular_expression"), dest="", type="string", action="callback", callback=add_selection) + # Lockfile + parser.add_option("--lockfile", metavar=_("lockfile")) + parser.add_option("--log-fd", type="int", metavar=_("file_descriptor"), dest="", action="callback", callback=lambda o, s, v, p: set_log_fd(v)) --- globals.py.orig 2012-02-29 19:24:05.000000000 +0000 +++ globals.py 2014-01-13 13:53:01.317053535 +0000 @@ -234,3 +234,6 @@ # Renames (--rename) rename = {} + +# Lockfile +lockfile = None --- duplicity.orig 2013-11-21 22:38:51.000000000 +0000 +++ duplicity 2014-01-13 14:06:06.805048671 +0000 @@ -1257,6 +1257,17 @@ # determine what action we're performing and process command line action = commandline.ProcessCommandLine(sys.argv[1:]) + if globals.lockfile: + from lockfile import FileLock + + lock = FileLock(globals.lockfile) + + with lock: + main2(action) + else: + main2(action) + +def main2(action): # The following is for starting remote debugging in Eclipse with Pydev. # Adjust the path to your location and version of Eclipse and Pydev. if globals.pydevd: