]> git.gsnw.org Git - raspbmirror.git/commitdiff
Merge github c0905e4 (Add a --nolock option)
authorGerman Service Network <support@gsnw.de>
Sat, 13 Mar 2021 19:28:53 +0000 (20:28 +0100)
committerGerman Service Network <support@gsnw.de>
Sat, 13 Mar 2021 19:28:53 +0000 (20:28 +0100)
raspbmirror.py

index 1575a666fe1a9a1c609acb1cdb36336aa79cf8ed..5073920f69d771bfe69b0b116f84c1cd6df93ec8 100644 (file)
@@ -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__))