[Piuparts-commits] [piuparts] 01/02: report other processes running if started in terminal
Holger Levsen
holger at layer-acht.org
Wed Nov 29 14:00:06 UTC 2017
This is an automated email from the git hooks/post-receive script.
holger pushed a commit to branch develop
in repository piuparts.
commit 7a904bbf0273630a1f4c79116e8b5dd5c8df4a03
Author: Andreas Beckmann <anbe at debian.org>
Date: Mon Nov 27 20:53:50 2017 +0100
report other processes running if started in terminal
Signed-off-by: Andreas Beckmann <anbe at debian.org>
Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
master-bin/detect_well_known_errors.py | 6 +++++-
piuparts-analyze.py | 5 ++++-
piuparts-report.py | 5 ++++-
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/master-bin/detect_well_known_errors.py b/master-bin/detect_well_known_errors.py
index 4c948e0..0e924a8 100644
--- a/master-bin/detect_well_known_errors.py
+++ b/master-bin/detect_well_known_errors.py
@@ -144,7 +144,11 @@ caching the problems found, by package, into ".kpr" files.
try:
fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
except IOError:
- sys.exit()
+ if sys.stdout.isatty():
+ sys.exit("another detect_well_known_errors process is already running")
+ else:
+ sys.exit(0)
+
sections = args.sections
if not sections:
sections = conf['sections'].split()
diff --git a/piuparts-analyze.py b/piuparts-analyze.py
index 7d3bb02..3e83db9 100644
--- a/piuparts-analyze.py
+++ b/piuparts-analyze.py
@@ -322,7 +322,10 @@ def main():
try:
fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
except IOError:
- sys.exit()
+ if sys.stdout.isatty():
+ sys.exit("another piuparts-analyze process is already running")
+ else:
+ sys.exit(0)
for section_name in sections:
print(time.strftime("%a %b %2d %H:%M:%S %Z %Y", time.localtime()))
diff --git a/piuparts-report.py b/piuparts-report.py
index 21d14a3..1604de9 100644
--- a/piuparts-report.py
+++ b/piuparts-report.py
@@ -1783,7 +1783,10 @@ def main():
try:
fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
except IOError:
- sys.exit()
+ if sys.stdout.isatty():
+ sys.exit("another piuparts-report process is already running")
+ else:
+ sys.exit(0)
packagedb_cache = {}
create_file(os.path.join(output_directory, "sections.yaml"),
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/piuparts/piuparts.git
More information about the Piuparts-commits
mailing list