This allows installing multiple tester instances under the same user
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
patchew-cli | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/patchew-cli b/patchew-cli
index b2d0bbb..d79c76f 100755
--- a/patchew-cli
+++ b/patchew-cli
@@ -609,8 +609,8 @@ class TesterCommand(SubCommand):
shutil.rmtree(wd)
return True
- def _check_singleton(self):
- lockfile = os.path.expanduser("~/.patchew-tester.lock")
+ def _check_singleton(self, name):
+ lockfile = os.path.expanduser("~/.%s.lock" % name)
self._lockfile = open(lockfile, "w+")
try:
fcntl.flock(self._lockfile, fcntl.LOCK_EX | fcntl.LOCK_NB)
@@ -632,7 +632,7 @@ class TesterCommand(SubCommand):
print(i)
return 0
if args.singleton:
- self._check_singleton()
+ self._check_singleton(args.name or "patchew-tester")
subprocess.check_output(["git", "version"])
count = 0
cap_refresh = 10
--
2.20.1
_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://www.redhat.com/mailman/listinfo/patchew-devel
On 2/8/19 7:08 PM, Paolo Bonzini wrote:
> This allows installing multiple tester instances under the same user
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> patchew-cli | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/patchew-cli b/patchew-cli
> index b2d0bbb..d79c76f 100755
> --- a/patchew-cli
> +++ b/patchew-cli
> @@ -609,8 +609,8 @@ class TesterCommand(SubCommand):
> shutil.rmtree(wd)
> return True
>
> - def _check_singleton(self):
> - lockfile = os.path.expanduser("~/.patchew-tester.lock")
> + def _check_singleton(self, name):
> + lockfile = os.path.expanduser("~/.%s.lock" % name)
> self._lockfile = open(lockfile, "w+")
> try:
> fcntl.flock(self._lockfile, fcntl.LOCK_EX | fcntl.LOCK_NB)
> @@ -632,7 +632,7 @@ class TesterCommand(SubCommand):
> print(i)
> return 0
> if args.singleton:
> - self._check_singleton()
> + self._check_singleton(args.name or "patchew-tester")
> subprocess.check_output(["git", "version"])
> count = 0
> cap_refresh = 10
>
_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://www.redhat.com/mailman/listinfo/patchew-devel
© 2016 - 2025 Red Hat, Inc.