aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Reyna <David.Reyna@windriver.com>2019-01-17 18:43:03 -0800
committerDavid Reyna <David.Reyna@windriver.com>2019-01-17 18:43:03 -0800
commitead7ba326b3e9cf512929c76ce4eb68d7ef43438 (patch)
tree83a304ecfb9fd1d1a8df011d39ebc394c7ad6891
parentec4e3d12a6ff4b8e0ed9db3e9c94bbba15d0ea20 (diff)
downloadsrtool-ead7ba326b3e9cf512929c76ce4eb68d7ef43438.tar.gz
srtool-ead7ba326b3e9cf512929c76ce4eb68d7ef43438.tar.bz2
srtool-ead7ba326b3e9cf512929c76ce4eb68d7ef43438.zip
srtool: clean up patcher script
Fix the description and usage examples in the header. Remove unused command. Signed-off-by: David Reyna <David.Reyna@windriver.com>
-rwxr-xr-xbin/common/srtool_patcher.py33
1 files changed, 27 insertions, 6 deletions
diff --git a/bin/common/srtool_patcher.py b/bin/common/srtool_patcher.py
index 6bf65755..ccf93060 100755
--- a/bin/common/srtool_patcher.py
+++ b/bin/common/srtool_patcher.py
@@ -23,11 +23,33 @@
#
# Theory of operation
#
-# * This script runs quick sanity tests
-# * The '--init-test' option will:
-# * Report the host package versions
-# * Report errors if any required tables are empty
-# * Report the running instance of the SRTool
+# This script supports extending common/template code with customized
+# sections, with support for merging and upstreaming changes in the
+# common/shared sections of the parent upstream files.
+#
+# The initial use case is a shared Jira integration file that partners can
+# extend to their particular installation. A working example is provided in
+# the ACME directory:
+# upstream: "bin/common/srtool_jira_template.py"
+# custom : "bin/acme/srtool_jira_acme.py"
+#
+# The custom sections are blocked off with comment tags (e.g. ACME):
+# ### ACME_EXTENSION_BEGIN ###
+# ...
+# ### ACME_EXTENSION_END ###
+#
+# The script supports JSON files to predefine that mappings. See:
+# bin/acme/patcher.json
+#
+# Examples:
+# Merge shared upstream code into a custom Jira script:
+# $ ./bin/common/srtool_patcher.py -j bin/acme/patcher.json --merge-original
+# Merge edits in script's common code areas back to upstream:
+# $ ./bin/common/srtool_patcher.py -j bin/acme/patcher.json --merge-custom
+# See if the shared common code sections have diverged from upstream:
+# $ ./bin/common/srtool_patcher.py -j bin/acme/patcher.json --diff-original
+# Extract the custom code sections, for examining and preserving custom changes:
+# $ ./bin/common/srtool_patcher.py -j bin/acme/patcher.json --extract-custom-patch
#
import os
@@ -184,7 +206,6 @@ def main(argv):
parser.add_argument('--json', '-j', help='Use JSON file for file list')
parser.add_argument('--extract-custom-patch', '-e', action='store_const', const='extract_custom_patch', dest='command', help='Extract a patch of the custom content')
- parser.add_argument('--apply-custom-patch', '-a', action='store_const', const='extract_custom_patch', dest='command', help='Apply the custom patch to the (reset) custom file')
parser.add_argument('--patch', '-p', help='Patch file')
parser.add_argument('--diff-original', '-d', action='store_const', const='diff_original', dest='command', help='Show how the file compares to original, ignoring custom patches')