From 475d61b3d40fc506e47a492fb9ef391f246cc2f3 Mon Sep 17 00:00:00 2001 From: Humdinger Date: Sun, 19 Jul 2015 09:51:15 +0200 Subject: Creating patchset from original patch. diff --git a/install_cnf.py b/install_cnf.py index 3e976a3..4104419 100644 --- a/install_cnf.py +++ b/install_cnf.py @@ -1,32 +1,29 @@ #!/bin/env python import os -hacks = """# command-not-found tomfoolery -if [ -e /boot/common/bin/python ]; then - command_not_found_handle(){ - /boot/common/bin/python /boot/common/bin/command_not_found.py "$1" - } -else - command_not_found_handle(){ - echo "$1 not found: try installoptionalpkg $1; and check installoptionalpkg -l" - } -fi +hacks = """ +#!/bin/env python +command_not_found_handle(){ + /bin/env python /bin/command_not_found "$1" +} \n """ - default_options="""{ "autocorrect": false, "spellcheck": false, "haikuports": false }\n""" -home = os.environ['HOME'] -if not os.path.exists("%s/config/settings/command-not-found/options.json" % home): - profile = open("/etc/profile", "a") + +if not os.path.exists("/boot/common/etc/profile.d/command-not-found.sh") + os.mkdir("/boot/common/etc/profile.d") + profile = open("/boot/common/etc/profile.d/command-not-found.sh", "a") profile.write(hacks) profile.close() + +home = os.environ['HOME'] +if not os.path.exists("%s/config/settings/command-not-found/options.json" % home): os.mkdir("%s/config/settings/command-not-found/" % home) options = open("%s/config/settings/command-not-found/options.json" % home, "w") options.write(default_options) options.close() -os.system("install -m 755 haiku_cnf.py /boot/common/bin/command_not_found.py") \ No newline at end of file -- 2.2.2