From: Thomas Walker Lynch Date: Tue, 23 Jun 2026 12:48:32 +0000 (+0000) Subject: simplifying external tool install X-Git-Url: https://git.reasoningtechnology.com/RT-Style_locator.js?a=commitdiff_plain;h=5aaa57acbd5535e03ea4a1429041bd62283cc8b5;p=Harmony simplifying external tool install --- diff --git a/administrator/document/RT-Style_locator.js b/administrator/document/RT-Style_locator.js index f338031..39b2706 100644 --- a/administrator/document/RT-Style_locator.js +++ b/administrator/document/RT-Style_locator.js @@ -1,10 +1,10 @@ /* We have four scenarios - immediate - used in the RT-Style distribution itself (authored, consummer, staged) + immediate - used in the RT-Style distribution itself (authored, consumer, staged) direct - used in the RT-Style project itself, but not in the distribution indirect - the version all Harmony projects use - URL_only - always pulls style through a URL, a webserver must be present + URL-only - always pulls style through a URL, a webserver must be present */ @@ -15,7 +15,7 @@ window.RT = window.RT || {}; window.RT.project_name = "Harmony"; // Fallback URL when served over a network where the project root is not in the URI. -window.RT.server_url = "http://localhost:8000/shared/linked-project/RT-Style/made/Manuscript"; +window.RT.server_url = "http://localhost:8000/shared/linked-project/RT-Style/Manuscript"; (function() { let style_path = window.RT.server_url; @@ -30,8 +30,8 @@ window.RT.server_url = "http://localhost:8000/shared/linked-project/RT-Style/mad const absolute_project_root = path.substring(0, project_root_index + window.RT.project_name.length + 1); // The symlink 'RT-Style' already drops us inside the 'consumer/' directory, - // so we proceed directly to 'made/Manuscript'. - style_path = absolute_project_root + "/shared/linked-project/RT-Style/made/Manuscript"; + // so we proceed directly to 'Manuscript'. + style_path = absolute_project_root + "/shared/linked-project/RT-Style/Manuscript"; } else { console.warn("RT-Style: Cannot locate project root '/" + window.RT.project_name + "/' in URI. Falling back to server_url."); } diff --git a/administrator/tool/deploy_RT-Style_indirect_locators b/administrator/tool/deploy_RT-Style_indirect_locators new file mode 100755 index 0000000..0f98eae --- /dev/null +++ b/administrator/tool/deploy_RT-Style_indirect_locators @@ -0,0 +1,43 @@ +#!/usr/bin/env python3 +import sys +import os +import stat +import shutil +from pathlib import Path + +def deploy_RT_Style_indirect_locators(locator_dir_path): + locator_dir = Path(locator_dir_path) + if not locator_dir.is_dir(): + print(f"Error: Locator directory not found at {locator_dir_path}") + sys.exit(1) + + indirect_js = locator_dir / "indirect.js" + if not indirect_js.exists(): + print("Error: indirect.js missing in the specified directory.") + sys.exit(1) + + repo_home = Path(os.environ.get("REPO_HOME", ".")) + IGNORED_DIRS = {".git"} + + for root, dirs, files in os.walk(repo_home): + # Prune ignored directories in place + dirs[:] = [d for d in dirs if d not in IGNORED_DIRS] + + current_path = Path(root) + if current_path.name.lower() == "document": + target_file = current_path / "RT-Style_locator.js" + + # Eliminate permission denial on read-only artifacts + if target_file.exists(): + target_file.chmod(target_file.stat().st_mode | stat.S_IWUSR) + + shutil.copyfile(indirect_js, target_file) + print(f"Copied indirect.js -> {target_file}") + +if __name__ == "__main__": + if len(sys.argv) != 2: + print("Usage: python3 deploy_RT_Style_indirect_locators.py ") + sys.exit(1) + + deploy_RT_Style_indirect_locators(sys.argv[1]) + diff --git a/administrator/tool/deploy_RT-Style_indirect_locators.py b/administrator/tool/deploy_RT-Style_indirect_locators.py deleted file mode 100644 index 0f98eae..0000000 --- a/administrator/tool/deploy_RT-Style_indirect_locators.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env python3 -import sys -import os -import stat -import shutil -from pathlib import Path - -def deploy_RT_Style_indirect_locators(locator_dir_path): - locator_dir = Path(locator_dir_path) - if not locator_dir.is_dir(): - print(f"Error: Locator directory not found at {locator_dir_path}") - sys.exit(1) - - indirect_js = locator_dir / "indirect.js" - if not indirect_js.exists(): - print("Error: indirect.js missing in the specified directory.") - sys.exit(1) - - repo_home = Path(os.environ.get("REPO_HOME", ".")) - IGNORED_DIRS = {".git"} - - for root, dirs, files in os.walk(repo_home): - # Prune ignored directories in place - dirs[:] = [d for d in dirs if d not in IGNORED_DIRS] - - current_path = Path(root) - if current_path.name.lower() == "document": - target_file = current_path / "RT-Style_locator.js" - - # Eliminate permission denial on read-only artifacts - if target_file.exists(): - target_file.chmod(target_file.stat().st_mode | stat.S_IWUSR) - - shutil.copyfile(indirect_js, target_file) - print(f"Copied indirect.js -> {target_file}") - -if __name__ == "__main__": - if len(sys.argv) != 2: - print("Usage: python3 deploy_RT_Style_indirect_locators.py ") - sys.exit(1) - - deploy_RT_Style_indirect_locators(sys.argv[1]) - diff --git a/developer/document/RT-Style_locator.js b/developer/document/RT-Style_locator.js index f338031..39b2706 100644 --- a/developer/document/RT-Style_locator.js +++ b/developer/document/RT-Style_locator.js @@ -1,10 +1,10 @@ /* We have four scenarios - immediate - used in the RT-Style distribution itself (authored, consummer, staged) + immediate - used in the RT-Style distribution itself (authored, consumer, staged) direct - used in the RT-Style project itself, but not in the distribution indirect - the version all Harmony projects use - URL_only - always pulls style through a URL, a webserver must be present + URL-only - always pulls style through a URL, a webserver must be present */ @@ -15,7 +15,7 @@ window.RT = window.RT || {}; window.RT.project_name = "Harmony"; // Fallback URL when served over a network where the project root is not in the URI. -window.RT.server_url = "http://localhost:8000/shared/linked-project/RT-Style/made/Manuscript"; +window.RT.server_url = "http://localhost:8000/shared/linked-project/RT-Style/Manuscript"; (function() { let style_path = window.RT.server_url; @@ -30,8 +30,8 @@ window.RT.server_url = "http://localhost:8000/shared/linked-project/RT-Style/mad const absolute_project_root = path.substring(0, project_root_index + window.RT.project_name.length + 1); // The symlink 'RT-Style' already drops us inside the 'consumer/' directory, - // so we proceed directly to 'made/Manuscript'. - style_path = absolute_project_root + "/shared/linked-project/RT-Style/made/Manuscript"; + // so we proceed directly to 'Manuscript'. + style_path = absolute_project_root + "/shared/linked-project/RT-Style/Manuscript"; } else { console.warn("RT-Style: Cannot locate project root '/" + window.RT.project_name + "/' in URI. Falling back to server_url."); } diff --git a/document/RT-Style_locator.js b/document/RT-Style_locator.js index f338031..39b2706 100644 --- a/document/RT-Style_locator.js +++ b/document/RT-Style_locator.js @@ -1,10 +1,10 @@ /* We have four scenarios - immediate - used in the RT-Style distribution itself (authored, consummer, staged) + immediate - used in the RT-Style distribution itself (authored, consumer, staged) direct - used in the RT-Style project itself, but not in the distribution indirect - the version all Harmony projects use - URL_only - always pulls style through a URL, a webserver must be present + URL-only - always pulls style through a URL, a webserver must be present */ @@ -15,7 +15,7 @@ window.RT = window.RT || {}; window.RT.project_name = "Harmony"; // Fallback URL when served over a network where the project root is not in the URI. -window.RT.server_url = "http://localhost:8000/shared/linked-project/RT-Style/made/Manuscript"; +window.RT.server_url = "http://localhost:8000/shared/linked-project/RT-Style/Manuscript"; (function() { let style_path = window.RT.server_url; @@ -30,8 +30,8 @@ window.RT.server_url = "http://localhost:8000/shared/linked-project/RT-Style/mad const absolute_project_root = path.substring(0, project_root_index + window.RT.project_name.length + 1); // The symlink 'RT-Style' already drops us inside the 'consumer/' directory, - // so we proceed directly to 'made/Manuscript'. - style_path = absolute_project_root + "/shared/linked-project/RT-Style/made/Manuscript"; + // so we proceed directly to 'Manuscript'. + style_path = absolute_project_root + "/shared/linked-project/RT-Style/Manuscript"; } else { console.warn("RT-Style: Cannot locate project root '/" + window.RT.project_name + "/' in URI. Falling back to server_url."); } diff --git a/next-generation-name.py b/next-generation-name.py deleted file mode 100755 index 4962355..0000000 --- a/next-generation-name.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env -S python3 -B -# -*- mode: python; coding: utf-8; python-indent-offset: 2; indent-tabs-mode: nil -*- - -import os ,sys - -def CLI(argv=None) -> int: - # Ordered list of renames: files first, then directories to preserve paths - substitutions = [ - # Administrator - ("administrator/document/how-to_release.html" ,"administrator/document/how-to_release.html") - - # Developer - ,("developer/document/naming_file-and-directory.html" ,"developer/document/naming_file-and-directory.html") - ,("developer/document/format_RT-code.html" ,"developer/document/format_RT-code.html") - ,("developer/document/single-file_C-module-and-namespace.html" ,"developer/document/single-file_C-module-and-namespace.html") - ,("developer/tool/do-all" ,"developer/tool/do-all") - - # Top-level documents - ,("document/introduction_Harmony.html" ,"document/introduction_Harmony.html") - ,("document/role-and-workflow_product-development.html" ,"document/role-and-workflow_product-development.html") - ,("document/role-and-workflow_product-maintenance.html" ,"document/role-and-workflow_product-maintenance.html") - - # Shared tools and documents - ,("shared/document/installation_Python.org" ,"shared/document/installation_Python.org") - ,("shared/document/installation_generic.org" ,"shared/document/installation_generic.org") - ,("shared/dictionary_style-directory.js" ,"shared/dictionary_style-directory.js") - ,("shared/tool/RTfmt" ,"shared/tool/RT-formatter") - ,("shared/tool/RT-formatter.el" ,"shared/tool/RT-formatter.el") - ,("shared/tool/makefile/target_kernel-module.mk" ,"shared/tool/makefile/target_kernel-module.mk") - - # Tester files (referenced by the old directory name before it is renamed) - ,("tester/RT-formatter/RT-formatter.el" ,"tester/RT-formatter/RT-formatter.el") - ,("tester/RT-formatter/RT-formatter.el" ,"tester/RT-formatter/RT-formatter_alt.el") - ,("tester/RT-formatter/RTfmt" ,"tester/RT-formatter/RT-formatter") - ,("tester/RT-formatter/RT-formatter.el" ,"tester/RT-formatter/RT-formatter_script.el") - ,("tester/RT-formatter/RTfmt_with_compare" ,"tester/RT-formatter/RT-formatter_with-compare") - ,("tester/RT-formatter/RTfmt_with_compare.el" ,"tester/RT-formatter/RT-formatter_with-compare.el") - ,("tester/RT-formatter/data_test-0.c" ,"tester/RT-formatter/data_test-0.c") - ,("tester/RT-formatter/data_test-1.py" ,"tester/RT-formatter/data_test-1.py") - - # Directories - ,("shared/linked-project" ,"shared/linked-project") - ,("tester/RT-formatter" ,"tester/RT-formatter") - ] - - for src ,dst in substitutions: - if not os.path.exists(src): - print(f"Skipping (not found): {src}") - continue - - if os.path.exists(dst): - print(f"Warning: Destination {dst} already exists. Skipping rename for {src}.") - continue - - try: - os.rename(src ,dst) - print(f"Renamed: {src} -> {dst}") - except Exception as e: - print(f"Error renaming {src} to {dst}: {e}") - - return 0 - -if __name__ == "__main__": - sys.exit(CLI()) - diff --git a/shared/document/RT-Style_locator.js b/shared/document/RT-Style_locator.js index f338031..39b2706 100644 --- a/shared/document/RT-Style_locator.js +++ b/shared/document/RT-Style_locator.js @@ -1,10 +1,10 @@ /* We have four scenarios - immediate - used in the RT-Style distribution itself (authored, consummer, staged) + immediate - used in the RT-Style distribution itself (authored, consumer, staged) direct - used in the RT-Style project itself, but not in the distribution indirect - the version all Harmony projects use - URL_only - always pulls style through a URL, a webserver must be present + URL-only - always pulls style through a URL, a webserver must be present */ @@ -15,7 +15,7 @@ window.RT = window.RT || {}; window.RT.project_name = "Harmony"; // Fallback URL when served over a network where the project root is not in the URI. -window.RT.server_url = "http://localhost:8000/shared/linked-project/RT-Style/made/Manuscript"; +window.RT.server_url = "http://localhost:8000/shared/linked-project/RT-Style/Manuscript"; (function() { let style_path = window.RT.server_url; @@ -30,8 +30,8 @@ window.RT.server_url = "http://localhost:8000/shared/linked-project/RT-Style/mad const absolute_project_root = path.substring(0, project_root_index + window.RT.project_name.length + 1); // The symlink 'RT-Style' already drops us inside the 'consumer/' directory, - // so we proceed directly to 'made/Manuscript'. - style_path = absolute_project_root + "/shared/linked-project/RT-Style/made/Manuscript"; + // so we proceed directly to 'Manuscript'. + style_path = absolute_project_root + "/shared/linked-project/RT-Style/Manuscript"; } else { console.warn("RT-Style: Cannot locate project root '/" + window.RT.project_name + "/' in URI. Falling back to server_url."); } diff --git a/shared/linked-project/.gitignore b/shared/linked-project/.gitignore deleted file mode 100644 index 2762afa..0000000 --- a/shared/linked-project/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -# Ignore all files -* - -# But don't ignore the .gitignore file itself -!/.gitignore - diff --git a/shared/linked-project/Python-3.12.3 b/shared/linked-project/Python-3.12.3 new file mode 120000 index 0000000..c2895cf --- /dev/null +++ b/shared/linked-project/Python-3.12.3 @@ -0,0 +1 @@ +project/Python-3.12.3 \ No newline at end of file diff --git a/shared/linked-project/RT-Style b/shared/linked-project/RT-Style new file mode 120000 index 0000000..654d0cc --- /dev/null +++ b/shared/linked-project/RT-Style @@ -0,0 +1 @@ +project/RT-Style/consumer \ No newline at end of file diff --git a/shared/linked-project/project b/shared/linked-project/project new file mode 120000 index 0000000..1b20c9f --- /dev/null +++ b/shared/linked-project/project @@ -0,0 +1 @@ +../../../ \ No newline at end of file diff --git a/shared/upstream/.gitignore b/shared/upstream/.gitignore deleted file mode 100644 index aa0e8eb..0000000 --- a/shared/upstream/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!/.gitignore \ No newline at end of file