Move CS builder scripts into the recipe module.

I believe these scripts are only used by the codesearch module, and I'm
hopeful that this will get the codesearch recipes working on LUCI
without needing to fiddle with .gitattributes.

As part of this I also removed a dependency on common.chromium_utils.

Bug: 790616,790617,829200,838155
Change-Id: I7c4e97ad92dfc1e24d8f32a53dd905ff3ce4718f
Recipe-Nontrivial-Roll: build_limited_scripts_slave
Reviewed-on: https://chromium-review.googlesource.com/1137810
Reviewed-by: Sergey Berezin <sergeyberezin@chromium.org>
Commit-Queue: Joey Scarr <jsca@chromium.org>
diff --git a/scripts/slave/README.recipes.md b/scripts/slave/README.recipes.md
index 7997d05..26ed1b0 100644
--- a/scripts/slave/README.recipes.md
+++ b/scripts/slave/README.recipes.md
@@ -1493,7 +1493,7 @@
 
 #### **class [CodesearchApi](/scripts/slave/recipe_modules/codesearch/api.py#12)([RecipeApi][recipe_engine/wkt/RecipeApi]):**
 
-&mdash; **def [checkout\_generated\_files\_repo\_and\_sync](/scripts/slave/recipe_modules/codesearch/api.py#182)(self):**
+&mdash; **def [checkout\_generated\_files\_repo\_and\_sync](/scripts/slave/recipe_modules/codesearch/api.py#181)(self):**
 
 Check out the generated files repo and sync the generated files
 into this checkout.
diff --git a/scripts/slave/recipe_modules/codesearch/api.py b/scripts/slave/recipe_modules/codesearch/api.py
index a5dfecb..5eedcaa 100644
--- a/scripts/slave/recipe_modules/codesearch/api.py
+++ b/scripts/slave/recipe_modules/codesearch/api.py
@@ -158,8 +158,7 @@
     if self.c.GEN_REPO_OUT_DIR:
       args.extend(['--out_dir', 'src/out/%s' % self.c.GEN_REPO_OUT_DIR])
     self.m.build.python('create kythe index pack',
-                        self.package_repo_resource('scripts', 'slave', 'chromium',
-                                                   'package_index.py'),
+                        self.resource('package_index.py'),
                         args)
 
   def _upload_kythe_index_pack(self, bucket_name, index_pack_kythe_name,
@@ -214,6 +213,5 @@
     if self.m.runtime.is_experimental:
       args.append('--dry-run')
     self.m.build.python('sync generated files',
-                        self.package_repo_resource('scripts','slave',
-                                                   'sync_generated_files_codesearch.py'),
+                        self.resource('sync_generated_files.py'),
                         args)
diff --git a/scripts/slave/recipe_modules/codesearch/examples/full.expected/codesearch_gen_chromium_linux_test_basic.json b/scripts/slave/recipe_modules/codesearch/examples/full.expected/codesearch_gen_chromium_linux_test_basic.json
index b1e0198..e588125 100644
--- a/scripts/slave/recipe_modules/codesearch/examples/full.expected/codesearch_gen_chromium_linux_test_basic.json
+++ b/scripts/slave/recipe_modules/codesearch/examples/full.expected/codesearch_gen_chromium_linux_test_basic.json
@@ -626,7 +626,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/chromium/package_index.py",
+      "RECIPE_MODULE[build::codesearch]/resources/package_index.py",
       "--path-to-compdb",
       "[START_DIR]/src/out/Debug/compile_commands.json",
       "--path-to-archive-output",
@@ -750,7 +750,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/sync_generated_files_codesearch.py",
+      "RECIPE_MODULE[build::codesearch]/resources/sync_generated_files.py",
       "--message",
       "Generated files from \"codesearch-gen-chromium-linux\" build 571, revision f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9",
       "--dest-branch",
diff --git a/scripts/slave/recipe_modules/codesearch/examples/full.expected/codesearch_gen_chromium_linux_test_experimental.json b/scripts/slave/recipe_modules/codesearch/examples/full.expected/codesearch_gen_chromium_linux_test_experimental.json
index c89663c..9e6e297 100644
--- a/scripts/slave/recipe_modules/codesearch/examples/full.expected/codesearch_gen_chromium_linux_test_experimental.json
+++ b/scripts/slave/recipe_modules/codesearch/examples/full.expected/codesearch_gen_chromium_linux_test_experimental.json
@@ -627,7 +627,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/chromium/package_index.py",
+      "RECIPE_MODULE[build::codesearch]/resources/package_index.py",
       "--path-to-compdb",
       "[START_DIR]/src/out/Debug/compile_commands.json",
       "--path-to-archive-output",
@@ -751,7 +751,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/sync_generated_files_codesearch.py",
+      "RECIPE_MODULE[build::codesearch]/resources/sync_generated_files.py",
       "--message",
       "Generated files from \"codesearch-gen-chromium-linux\" build 571, revision f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9",
       "--dest-branch",
diff --git a/scripts/slave/recipe_modules/codesearch/examples/full.expected/codesearch_gen_chromium_win_delete_generated_files_fail.json b/scripts/slave/recipe_modules/codesearch/examples/full.expected/codesearch_gen_chromium_win_delete_generated_files_fail.json
index a4211ea..ec7a5ea 100644
--- a/scripts/slave/recipe_modules/codesearch/examples/full.expected/codesearch_gen_chromium_win_delete_generated_files_fail.json
+++ b/scripts/slave/recipe_modules/codesearch/examples/full.expected/codesearch_gen_chromium_win_delete_generated_files_fail.json
@@ -634,7 +634,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/chromium/package_index.py",
+      "RECIPE_MODULE[build::codesearch]/resources/package_index.py",
       "--path-to-compdb",
       "[START_DIR]/src/out/win-Debug/compile_commands.json",
       "--path-to-archive-output",
@@ -760,7 +760,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/sync_generated_files_codesearch.py",
+      "RECIPE_MODULE[build::codesearch]/resources/sync_generated_files.py",
       "--debug-dir",
       "win-Debug",
       "--message",
diff --git a/scripts/slave/recipe_modules/codesearch/examples/full.expected/codesearch_gen_chromium_win_test_basic.json b/scripts/slave/recipe_modules/codesearch/examples/full.expected/codesearch_gen_chromium_win_test_basic.json
index b62d1ea..9fe04d0 100644
--- a/scripts/slave/recipe_modules/codesearch/examples/full.expected/codesearch_gen_chromium_win_test_basic.json
+++ b/scripts/slave/recipe_modules/codesearch/examples/full.expected/codesearch_gen_chromium_win_test_basic.json
@@ -629,7 +629,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/chromium/package_index.py",
+      "RECIPE_MODULE[build::codesearch]/resources/package_index.py",
       "--path-to-compdb",
       "[START_DIR]/src/out/win-Debug/compile_commands.json",
       "--path-to-archive-output",
@@ -755,7 +755,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/sync_generated_files_codesearch.py",
+      "RECIPE_MODULE[build::codesearch]/resources/sync_generated_files.py",
       "--debug-dir",
       "win-Debug",
       "--message",
diff --git a/scripts/slave/recipe_modules/codesearch/examples/full.expected/codesearch_gen_chromium_win_test_experimental.json b/scripts/slave/recipe_modules/codesearch/examples/full.expected/codesearch_gen_chromium_win_test_experimental.json
index 27b295d..561e2ef 100644
--- a/scripts/slave/recipe_modules/codesearch/examples/full.expected/codesearch_gen_chromium_win_test_experimental.json
+++ b/scripts/slave/recipe_modules/codesearch/examples/full.expected/codesearch_gen_chromium_win_test_experimental.json
@@ -630,7 +630,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/chromium/package_index.py",
+      "RECIPE_MODULE[build::codesearch]/resources/package_index.py",
       "--path-to-compdb",
       "[START_DIR]/src/out/win-Debug/compile_commands.json",
       "--path-to-archive-output",
@@ -756,7 +756,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/sync_generated_files_codesearch.py",
+      "RECIPE_MODULE[build::codesearch]/resources/sync_generated_files.py",
       "--debug-dir",
       "win-Debug",
       "--message",
diff --git a/scripts/slave/chromium/package_index.py b/scripts/slave/recipe_modules/codesearch/resources/package_index.py
similarity index 96%
rename from scripts/slave/chromium/package_index.py
rename to scripts/slave/recipe_modules/codesearch/resources/package_index.py
index 412cebe..e9ac14b 100755
--- a/scripts/slave/chromium/package_index.py
+++ b/scripts/slave/recipe_modules/codesearch/resources/package_index.py
@@ -7,6 +7,8 @@
 
 
 import argparse
+import errno
+import fnmatch
 import hashlib
 import itertools
 import json
@@ -17,7 +19,6 @@
 import time
 import zipfile
 
-from common import chromium_utils
 from contextlib import closing
 
 
@@ -323,6 +324,18 @@
           rel_path = os.path.relpath(abs_path, index_parent)
           archive.write(abs_path, rel_path)
 
+
+def _RemoveFilepathsFiles(root):
+  """Removes all .filepaths files within specified root dir."""
+  for path, _, files in os.walk(os.path.abspath(root)):
+    for filename in fnmatch.filter(files, '*.filepaths'):
+      try:
+        os.remove(os.path.join(path, filename))
+      except OSError, e:
+        if e.errno != errno.ENOENT:
+          raise
+
+
 def main():
   parser = argparse.ArgumentParser()
   parser.add_argument('--path-to-archive-output',
@@ -352,8 +365,7 @@
 
     if not options.keep_filepaths_files:
       # Clean up the *.filepaths files.
-      chromium_utils.RemoveFilesWildcards(
-          '*.filepaths', os.path.join(os.getcwd(), 'src'))
+      _RemoveFilepathsFiles(os.path.join(os.getcwd(), 'src'))
 
     # Create the archive containing the generated files.
     index_pack.CreateArchive(options.path_to_archive_output)
diff --git a/scripts/slave/unittests/package_index_test.py b/scripts/slave/recipe_modules/codesearch/resources/package_index_test.py
similarity index 98%
rename from scripts/slave/unittests/package_index_test.py
rename to scripts/slave/recipe_modules/codesearch/resources/package_index_test.py
index 245db22..72009b6 100755
--- a/scripts/slave/unittests/package_index_test.py
+++ b/scripts/slave/recipe_modules/codesearch/resources/package_index_test.py
@@ -14,9 +14,7 @@
 import unittest
 import zipfile
 
-import test_env  # pylint: disable=relative-import
-
-from slave.chromium import package_index
+import package_index
 
 TEST_CC_FILE_CONTENT = '#include "test.h"\nint main() {\nreturn 0;\n}\n'
 TEST_H_FILE_CONTENT = ('#ifndef TEST_H\n#define TEST_H\n#include "test2.h"\n'
diff --git a/scripts/slave/sync_generated_files_codesearch.py b/scripts/slave/recipe_modules/codesearch/resources/sync_generated_files.py
old mode 100644
new mode 100755
similarity index 100%
rename from scripts/slave/sync_generated_files_codesearch.py
rename to scripts/slave/recipe_modules/codesearch/resources/sync_generated_files.py
diff --git a/scripts/slave/unittests/sync_generated_files_codesearch_test.py b/scripts/slave/recipe_modules/codesearch/resources/sync_generated_files_test.py
similarity index 97%
rename from scripts/slave/unittests/sync_generated_files_codesearch_test.py
rename to scripts/slave/recipe_modules/codesearch/resources/sync_generated_files_test.py
index c49f1f6..bae0d93 100755
--- a/scripts/slave/unittests/sync_generated_files_codesearch_test.py
+++ b/scripts/slave/recipe_modules/codesearch/resources/sync_generated_files_test.py
@@ -11,9 +11,7 @@
 import tempfile
 import unittest
 
-import test_env  # pylint: disable=relative-import
-
-from slave import sync_generated_files_codesearch as sync
+import sync_generated_files as sync
 
 class SyncGeneratedFilesCodesearchTest(unittest.TestCase):
   def setUp(self):
diff --git a/scripts/slave/recipe_modules/codesearch/tests/checkout_generated_files_repo_and_sync.expected/basic.json b/scripts/slave/recipe_modules/codesearch/tests/checkout_generated_files_repo_and_sync.expected/basic.json
index 69fef08..b045d86 100644
--- a/scripts/slave/recipe_modules/codesearch/tests/checkout_generated_files_repo_and_sync.expected/basic.json
+++ b/scripts/slave/recipe_modules/codesearch/tests/checkout_generated_files_repo_and_sync.expected/basic.json
@@ -244,7 +244,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/sync_generated_files_codesearch.py",
+      "RECIPE_MODULE[build::codesearch]/resources/sync_generated_files.py",
       "--message",
       "Generated files from \"test_buildername\" build 123, revision f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9",
       "--dest-branch",
diff --git a/scripts/slave/recipe_modules/codesearch/tests/checkout_generated_files_repo_and_sync.expected/specified_branch_and_out_dir.json b/scripts/slave/recipe_modules/codesearch/tests/checkout_generated_files_repo_and_sync.expected/specified_branch_and_out_dir.json
index 4939cc7..50914ac 100644
--- a/scripts/slave/recipe_modules/codesearch/tests/checkout_generated_files_repo_and_sync.expected/specified_branch_and_out_dir.json
+++ b/scripts/slave/recipe_modules/codesearch/tests/checkout_generated_files_repo_and_sync.expected/specified_branch_and_out_dir.json
@@ -244,7 +244,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/sync_generated_files_codesearch.py",
+      "RECIPE_MODULE[build::codesearch]/resources/sync_generated_files.py",
       "--debug-dir",
       "chromium-android",
       "--message",
diff --git a/scripts/slave/recipe_modules/codesearch/tests/create_and_upload_kythe_index_pack.expected/basic.json b/scripts/slave/recipe_modules/codesearch/tests/create_and_upload_kythe_index_pack.expected/basic.json
index ef33b3a..fdd2736 100644
--- a/scripts/slave/recipe_modules/codesearch/tests/create_and_upload_kythe_index_pack.expected/basic.json
+++ b/scripts/slave/recipe_modules/codesearch/tests/create_and_upload_kythe_index_pack.expected/basic.json
@@ -157,7 +157,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/chromium/package_index.py",
+      "RECIPE_MODULE[build::codesearch]/resources/package_index.py",
       "--path-to-compdb",
       "[START_DIR]/src/out/Debug/compile_commands.json",
       "--path-to-archive-output",
diff --git a/scripts/slave/recipe_modules/codesearch/tests/create_and_upload_kythe_index_pack.expected/basic_without_got_revision_cp.json b/scripts/slave/recipe_modules/codesearch/tests/create_and_upload_kythe_index_pack.expected/basic_without_got_revision_cp.json
index abdc338..c19a18a 100644
--- a/scripts/slave/recipe_modules/codesearch/tests/create_and_upload_kythe_index_pack.expected/basic_without_got_revision_cp.json
+++ b/scripts/slave/recipe_modules/codesearch/tests/create_and_upload_kythe_index_pack.expected/basic_without_got_revision_cp.json
@@ -157,7 +157,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/chromium/package_index.py",
+      "RECIPE_MODULE[build::codesearch]/resources/package_index.py",
       "--path-to-compdb",
       "[START_DIR]/src/out/Debug/compile_commands.json",
       "--path-to-archive-output",
diff --git a/scripts/slave/recipe_modules/codesearch/tests/create_and_upload_kythe_index_pack.expected/basic_without_kythe_root.json b/scripts/slave/recipe_modules/codesearch/tests/create_and_upload_kythe_index_pack.expected/basic_without_kythe_root.json
index e723424..ca3d3a4 100644
--- a/scripts/slave/recipe_modules/codesearch/tests/create_and_upload_kythe_index_pack.expected/basic_without_kythe_root.json
+++ b/scripts/slave/recipe_modules/codesearch/tests/create_and_upload_kythe_index_pack.expected/basic_without_kythe_root.json
@@ -157,7 +157,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/chromium/package_index.py",
+      "RECIPE_MODULE[build::codesearch]/resources/package_index.py",
       "--path-to-compdb",
       "[START_DIR]/src/out/Debug/compile_commands.json",
       "--path-to-archive-output",
diff --git a/scripts/slave/recipe_modules/codesearch/tests/create_and_upload_kythe_index_pack.expected/bucket_name_not_set_failed.json b/scripts/slave/recipe_modules/codesearch/tests/create_and_upload_kythe_index_pack.expected/bucket_name_not_set_failed.json
index 630552c..26218fc 100644
--- a/scripts/slave/recipe_modules/codesearch/tests/create_and_upload_kythe_index_pack.expected/bucket_name_not_set_failed.json
+++ b/scripts/slave/recipe_modules/codesearch/tests/create_and_upload_kythe_index_pack.expected/bucket_name_not_set_failed.json
@@ -157,7 +157,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/chromium/package_index.py",
+      "RECIPE_MODULE[build::codesearch]/resources/package_index.py",
       "--path-to-compdb",
       "[START_DIR]/src/out/Debug/compile_commands.json",
       "--path-to-archive-output",
diff --git a/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_android.json b/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_android.json
index 59b342f..1f9af8b 100644
--- a/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_android.json
+++ b/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_android.json
@@ -625,7 +625,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/chromium/package_index.py",
+      "RECIPE_MODULE[build::codesearch]/resources/package_index.py",
       "--path-to-compdb",
       "[START_DIR]/src/out/android-Debug/compile_commands.json",
       "--path-to-archive-output",
@@ -753,7 +753,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/sync_generated_files_codesearch.py",
+      "RECIPE_MODULE[build::codesearch]/resources/sync_generated_files.py",
       "--debug-dir",
       "android-Debug",
       "--message",
diff --git a/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_android_with_revision.json b/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_android_with_revision.json
index b53f2c8..35f8208 100644
--- a/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_android_with_revision.json
+++ b/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_android_with_revision.json
@@ -625,7 +625,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/chromium/package_index.py",
+      "RECIPE_MODULE[build::codesearch]/resources/package_index.py",
       "--path-to-compdb",
       "[START_DIR]/src/out/android-Debug/compile_commands.json",
       "--path-to-archive-output",
@@ -753,7 +753,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/sync_generated_files_codesearch.py",
+      "RECIPE_MODULE[build::codesearch]/resources/sync_generated_files.py",
       "--debug-dir",
       "android-Debug",
       "--message",
diff --git a/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_chromiumos.json b/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_chromiumos.json
index 0d3622a..5cc9b2a 100644
--- a/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_chromiumos.json
+++ b/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_chromiumos.json
@@ -715,7 +715,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/chromium/package_index.py",
+      "RECIPE_MODULE[build::codesearch]/resources/package_index.py",
       "--path-to-compdb",
       "[START_DIR]/src/out/chromeos-Debug/compile_commands.json",
       "--path-to-archive-output",
@@ -843,7 +843,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/sync_generated_files_codesearch.py",
+      "RECIPE_MODULE[build::codesearch]/resources/sync_generated_files.py",
       "--debug-dir",
       "chromeos-Debug",
       "--message",
diff --git a/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_chromiumos_translation_unit_fail.json b/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_chromiumos_translation_unit_fail.json
index 3758d3f..344ad48 100644
--- a/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_chromiumos_translation_unit_fail.json
+++ b/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_chromiumos_translation_unit_fail.json
@@ -720,7 +720,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/chromium/package_index.py",
+      "RECIPE_MODULE[build::codesearch]/resources/package_index.py",
       "--path-to-compdb",
       "[START_DIR]/src/out/chromeos-Debug/compile_commands.json",
       "--path-to-archive-output",
@@ -848,7 +848,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/sync_generated_files_codesearch.py",
+      "RECIPE_MODULE[build::codesearch]/resources/sync_generated_files.py",
       "--debug-dir",
       "chromeos-Debug",
       "--message",
diff --git a/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_chromiumos_with_revision.json b/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_chromiumos_with_revision.json
index a434dbc..1d1c0a8 100644
--- a/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_chromiumos_with_revision.json
+++ b/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_chromiumos_with_revision.json
@@ -715,7 +715,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/chromium/package_index.py",
+      "RECIPE_MODULE[build::codesearch]/resources/package_index.py",
       "--path-to-compdb",
       "[START_DIR]/src/out/chromeos-Debug/compile_commands.json",
       "--path-to-archive-output",
@@ -843,7 +843,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/sync_generated_files_codesearch.py",
+      "RECIPE_MODULE[build::codesearch]/resources/sync_generated_files.py",
       "--debug-dir",
       "chromeos-Debug",
       "--message",
diff --git a/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_linux.json b/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_linux.json
index 445dde4..a18a00d 100644
--- a/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_linux.json
+++ b/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_linux.json
@@ -625,7 +625,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/chromium/package_index.py",
+      "RECIPE_MODULE[build::codesearch]/resources/package_index.py",
       "--path-to-compdb",
       "[START_DIR]/src/out/Debug/compile_commands.json",
       "--path-to-archive-output",
@@ -749,7 +749,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/sync_generated_files_codesearch.py",
+      "RECIPE_MODULE[build::codesearch]/resources/sync_generated_files.py",
       "--message",
       "Generated files from \"codesearch-gen-chromium-linux\" build 571, revision f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9",
       "--dest-branch",
diff --git a/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_linux_with_revision.json b/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_linux_with_revision.json
index 5904c95..42d2f1c 100644
--- a/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_linux_with_revision.json
+++ b/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_linux_with_revision.json
@@ -625,7 +625,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/chromium/package_index.py",
+      "RECIPE_MODULE[build::codesearch]/resources/package_index.py",
       "--path-to-compdb",
       "[START_DIR]/src/out/Debug/compile_commands.json",
       "--path-to-archive-output",
@@ -749,7 +749,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/sync_generated_files_codesearch.py",
+      "RECIPE_MODULE[build::codesearch]/resources/sync_generated_files.py",
       "--message",
       "Generated files from \"codesearch-gen-chromium-linux\" build 571, revision f27fede2220bcd326aee3e86ddfd4ebd0fe58cb9",
       "--dest-branch",
diff --git a/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_win.json b/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_win.json
index 9576d2f..b7d88c2 100644
--- a/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_win.json
+++ b/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_win.json
@@ -628,7 +628,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/chromium/package_index.py",
+      "RECIPE_MODULE[build::codesearch]/resources/package_index.py",
       "--path-to-compdb",
       "[START_DIR]/src/out/win-Debug/compile_commands.json",
       "--path-to-archive-output",
@@ -756,7 +756,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/sync_generated_files_codesearch.py",
+      "RECIPE_MODULE[build::codesearch]/resources/sync_generated_files.py",
       "--debug-dir",
       "win-Debug",
       "--message",
diff --git a/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_win_delete_generated_files_fail.json b/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_win_delete_generated_files_fail.json
index 5192118..4c12bd3 100644
--- a/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_win_delete_generated_files_fail.json
+++ b/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_win_delete_generated_files_fail.json
@@ -633,7 +633,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/chromium/package_index.py",
+      "RECIPE_MODULE[build::codesearch]/resources/package_index.py",
       "--path-to-compdb",
       "[START_DIR]/src/out/win-Debug/compile_commands.json",
       "--path-to-archive-output",
@@ -761,7 +761,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/sync_generated_files_codesearch.py",
+      "RECIPE_MODULE[build::codesearch]/resources/sync_generated_files.py",
       "--debug-dir",
       "win-Debug",
       "--message",
diff --git a/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_win_with_revision.json b/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_win_with_revision.json
index 5485027..d78f61e 100644
--- a/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_win_with_revision.json
+++ b/scripts/slave/recipes/chromium_codesearch.expected/full_codesearch_gen_chromium_win_with_revision.json
@@ -628,7 +628,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/chromium/package_index.py",
+      "RECIPE_MODULE[build::codesearch]/resources/package_index.py",
       "--path-to-compdb",
       "[START_DIR]/src/out/win-Debug/compile_commands.json",
       "--path-to-archive-output",
@@ -756,7 +756,7 @@
       "--with-third-party-lib",
       "--",
       "python",
-      "RECIPE_PACKAGE_REPO[build]/scripts/slave/sync_generated_files_codesearch.py",
+      "RECIPE_MODULE[build::codesearch]/resources/sync_generated_files.py",
       "--debug-dir",
       "win-Debug",
       "--message",