From cfa97b1ea7c03c4999a6baf7d6c7f914818c3bd6 Mon Sep 17 00:00:00 2001 From: boltgolt Date: Thu, 28 Jun 2018 14:43:50 +0200 Subject: [PATCH] Fixes for unneeded abort if answer contained whitespace (#33) --- debian/postinst | 2 +- debian/preinst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/postinst b/debian/postinst index e551f71..665b2f3 100755 --- a/debian/postinst +++ b/debian/postinst @@ -187,7 +187,7 @@ if "HOWDY_NO_PROMPT" not in os.environ: ans = input("Apply this change? [y/N]: ") # Abort the whole thing if it's not - if (ans.lower() != "y"): + if ans.lower().strip() != "y" or ans.lower().strip() == "yes": print("Interpreting as a \"NO\", aborting") sys.exit(1) diff --git a/debian/preinst b/debian/preinst index 33572be..a918b1b 100755 --- a/debian/preinst +++ b/debian/preinst @@ -89,7 +89,7 @@ for dev in devices: os.killpg(os.getpgid(sub.pid), signal.SIGTERM) # Set this camera as picked if the answer was yes, go to the next one if no - if ans.lower() == "y" or ans.lower() == "yes": + if ans.lower().strip() == "y" or ans.lower().strip() == "yes": picked = dev[5:] break else: