diff --git a/docs/build.rst b/docs/build.rst index c53fdbd44..378cfbdfd 100644 --- a/docs/build.rst +++ b/docs/build.rst @@ -115,5 +115,5 @@ brew or MacPorts as well. .. note:: |kitty| has its own update check mechanism, if you would like to turn - it off for your package, change the default value of - :opt:`update_check_interval` to zero. + it off for your package, use + ``python3 setup.py linux-package --update-check-interval=0`` diff --git a/docs/changelog.rst b/docs/changelog.rst index 70eae29fb..20e672661 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -22,6 +22,9 @@ To update |kitty|, :doc:`follow the instructions `. - panel kitten: Fix the contents of the panel kitten not being positioned correctly on the vertical axis +- Add an option to control the default :opt:`update_check_interval` when + building kitty packages + 0.14.1 [2019-05-29] --------------------- diff --git a/setup.py b/setup.py index e29c93353..3ae279386 100755 --- a/setup.py +++ b/setup.py @@ -657,6 +657,12 @@ def package(args, for_bundle=False, sh_launcher=False): shutil.copytree('kitty', os.path.join(libdir, 'kitty'), ignore=src_ignore) shutil.copytree('kittens', os.path.join(libdir, 'kittens'), ignore=src_ignore) + with open(os.path.join(libdir, 'kitty/config_data.py'), 'r+', encoding='utf-8') as f: + raw = f.read() + nraw = raw.replace("update_check_interval', 24", "update_check_interval', {}".format(args.update_check_interval), 1) + if nraw == raw: + raise SystemExit('Failed to change the value of update_check_interval') + f.seek(0), f.truncate(), f.write(nraw) compile_python(libdir) for root, dirs, files in os.walk(libdir): for f in files: @@ -854,7 +860,14 @@ def option_parser(): # {{{ default=[], choices=('event-loop',), help='Turn on extra logging for debugging in this build. Can be specified multiple times, to turn' - 'on different types of logging.' + ' on different types of logging.' + ) + p.add_argument( + '--update-check-interval', + type=float, + default=24, + help='When building a package, the default value for the update_check_interval setting will' + ' be set to this number. Use zero to disable update checking.' ) return p # }}}