From: German Service Network Date: Sat, 13 Mar 2021 19:28:53 +0000 (+0100) Subject: Merge github c0905e4 (Add a --nolock option) X-Git-Url: https://git.gsnw.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07dd39ca61f06c49b50280256746e79ab9af3442;p=raspbmirror.git Merge github c0905e4 (Add a --nolock option) --- diff --git a/raspbmirror.py b/raspbmirror.py index 1575a66..5073920 100644 --- a/raspbmirror.py +++ b/raspbmirror.py @@ -41,10 +41,13 @@ parser.add_argument("--debugskippool",help="skip downloading pool data, only dow parser.add_argument("--distswhitelist", help="specify comman seperated list of distributions") +parser.add_argument("--nolock", help="don't try to lock the target directory", action="store_true") + args = parser.parse_args() -lockfd = os.open('.',os.O_RDONLY) -fcntl.flock(lockfd,fcntl.LOCK_EX | fcntl.LOCK_NB) +if not args.nolock: + lockfd = os.open('.',os.O_RDONLY) + fcntl.flock(lockfd,fcntl.LOCK_EX | fcntl.LOCK_NB) dtNow = datetime.now() logpath = os.path.dirname(os.path.realpath(__file__))