4949 BUILTIN_SOURCE ,
5050 BUILTIN_SCHEME ,
5151 METADATA_FILENAME ,
52- LEGACY_METADATA_FILENAME ,
5352 TRACKING_METHOD_VERSION ,
5453 TRACKING_METHOD_BRANCH ,
5554 TRACKING_METHOD_COMMIT ,
@@ -190,20 +189,19 @@ class Manager:
190189 scratch_dir (str): a directory where the package manager performs
191190 miscellaneous/temporary file operations
192191
193- script_dir (str): the directory where the package manager will
194- copy each installed package's `script_dir` (as given by its
195- :file:`zkg.meta` or :file:`bro-pkg.meta`). Each package gets a
196- subdirectory within `script_dir` associated with its name.
192+ script_dir (str): the directory where the package manager will copy each
193+ installed package's `script_dir` (as given by its :file:`zkg.meta`).
194+ Each package gets a subdirectory within `script_dir` associated with
195+ its name.
197196
198- plugin_dir (str): the directory where the package manager will
199- copy each installed package's `plugin_dir` (as given by its
200- :file:`zkg.meta` or :file:`bro-pkg.meta`). Each package gets a
201- subdirectory within `plugin_dir` associated with its name.
197+ plugin_dir (str): the directory where the package manager will copy each
198+ installed package's `plugin_dir` (as given by its :file:`zkg.meta`).
199+ Each package gets a subdirectory within `plugin_dir` associated with
200+ its name.
202201
203202 bin_dir (str): the directory where the package manager will link
204203 executables into that are provided by an installed package through
205- `executables` (as given by its :file:`zkg.meta` or
206- :file:`bro-pkg.meta`)
204+ `executables` (as given by its :file:`zkg.meta`)
207205
208206 source_clonedir (str): the directory where the package manager
209207 will clone package sources. Each source gets a subdirectory
@@ -230,6 +228,7 @@ class Manager:
230228 in a directory named :file:`packages`, so as long as
231229 :envvar:`ZEEKPATH` is configured correctly, ``@load packages`` will
232230 load all installed packages that have been marked as loaded.
231+
233232 """
234233
235234 def __init__ (
@@ -1134,7 +1133,7 @@ def _refresh_source(self, name, aggregate=False, push=False):
11341133 aggregation_issues .append ((url , msg ))
11351134 continue
11361135
1137- metadata_file = _pick_metadata_file (clone .working_dir )
1136+ metadata_file = os . path . join (clone .working_dir , METADATA_FILENAME )
11381137 metadata_parser = configparser .ConfigParser (interpolation = None )
11391138 invalid_reason = _parse_package_metadata (
11401139 metadata_parser , metadata_file
@@ -2716,7 +2715,7 @@ def _stage(self, package, version, clone, stage, env=None):
27162715
27172716 """
27182717 LOG .debug ('staging "%s": version %s' , package , version )
2719- metadata_file = _pick_metadata_file (clone .working_dir )
2718+ metadata_file = os . path . join (clone .working_dir , METADATA_FILENAME )
27202719 metadata_parser = configparser .ConfigParser (interpolation = None )
27212720 invalid_reason = _parse_package_metadata (metadata_parser , metadata_file )
27222721 if invalid_reason :
@@ -3007,7 +3006,7 @@ def _install(self, package, version, use_existing_clone=False):
30073006 status .current_hash = clone .head .object .hexsha
30083007 status .is_outdated = _is_clone_outdated (clone , version , status .tracking_method )
30093008
3010- metadata_file = _pick_metadata_file (clone .working_dir )
3009+ metadata_file = os . path . join (clone .working_dir , METADATA_FILENAME )
30113010 metadata_parser = configparser .ConfigParser (interpolation = None )
30123011 invalid_reason = _parse_package_metadata (metadata_parser , metadata_file )
30133012
@@ -3183,7 +3182,7 @@ def ignore(_, files):
31833182 rval = []
31843183
31853184 for f in files :
3186- if f in {".git" , "bro-pkg.meta" , " zkg.meta" }:
3185+ if f in {".git" , "zkg.meta" }:
31873186 rval .append (f )
31883187
31893188 return rval
@@ -3233,22 +3232,11 @@ def _get_package_metadata(parser):
32333232 return metadata
32343233
32353234
3236- def _pick_metadata_file (directory ):
3237- rval = os .path .join (directory , METADATA_FILENAME )
3238-
3239- if os .path .exists (rval ):
3240- return rval
3241-
3242- return os .path .join (directory , LEGACY_METADATA_FILENAME )
3243-
3244-
32453235def _parse_package_metadata (parser , metadata_file ):
32463236 """Return string explaining why metadata is invalid, or '' if valid."""
32473237 if not parser .read (metadata_file ):
32483238 LOG .warning ("%s: missing metadata file" , metadata_file )
3249- return "missing {} (or {}) metadata file" .format (
3250- METADATA_FILENAME , LEGACY_METADATA_FILENAME
3251- )
3239+ return f"missing { METADATA_FILENAME } metadata file"
32523240
32533241 if not parser .has_section ("package" ):
32543242 LOG .warning ("%s: metadata missing [package]" , metadata_file )
@@ -3257,9 +3245,6 @@ def _parse_package_metadata(parser, metadata_file):
32573245 return ""
32583246
32593247
3260- _legacy_metadata_warnings = set ()
3261-
3262-
32633248def _info_from_clone (clone , package , status , version ):
32643249 """Retrieves information about a package.
32653250
@@ -3276,7 +3261,7 @@ def _info_from_clone(clone, package, status, version):
32763261 else :
32773262 version_type = TRACKING_METHOD_BRANCH
32783263
3279- metadata_file = _pick_metadata_file (clone .working_dir )
3264+ metadata_file = os . path . join (clone .working_dir , METADATA_FILENAME )
32803265 metadata_parser = configparser .ConfigParser (interpolation = None )
32813266 invalid_reason = _parse_package_metadata (metadata_parser , metadata_file )
32823267
@@ -3292,20 +3277,6 @@ def _info_from_clone(clone, package, status, version):
32923277 default_branch = default_branch ,
32933278 )
32943279
3295- # Remove in v3.0 by either silently ignoring LEGACY_METADATA_FILENAME
3296- # completely or error with helpful instructions about zkg.meta.
3297- if (
3298- os .path .basename (metadata_file ) == LEGACY_METADATA_FILENAME
3299- and package .qualified_name () not in _legacy_metadata_warnings
3300- ):
3301- LOG .warning (
3302- "Package %s is using the legacy bro-pkg.meta metadata file. "
3303- "It will soon stop working unless updated to use zkg.meta instead. "
3304- "Please report this to the package maintainers." ,
3305- package .qualified_name (),
3306- )
3307- _legacy_metadata_warnings .add (package .qualified_name ())
3308-
33093280 metadata = _get_package_metadata (metadata_parser )
33103281
33113282 return PackageInfo (
0 commit comments