Skip to content

Commit b6149ba

Browse files
committed
Merge remote-tracking branch 'origin/topic/timw/remove-bro-references'
* origin/topic/timw/remove-bro-references: Update man page with changes to other documentation Remove references to bro-pkg.meta and bro-pkg.index Remove references to legacy bro naming
2 parents c152666 + 0b1de7b commit b6149ba

File tree

20 files changed

+213
-335
lines changed

20 files changed

+213
-335
lines changed

CHANGES

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,86 @@
1+
2.13.0-46 | 2023-06-30 12:47:34 -0700
2+
3+
* Update man page with changes to other documentation (Tim Wojtulewicz, Corelight)
4+
5+
* Remove references to bro-pkg.meta and bro-pkg.index (Tim Wojtulewicz, Corelight)
6+
7+
* Remove references to legacy bro naming (Tim Wojtulewicz, Corelight)
8+
9+
This intentionally leaves behind references to bro-pkg.meta and __bro_plugin__
10+
but removes all of the other references to scripts and files that have been
11+
deprecated and/or removed since Zeek 3.0.
12+
13+
* User-visible warning when bro-pkg.meta is in use. (Arne Welzel, Corelight)
14+
15+
Relates to #119
16+
17+
* bundle/unbundle: Rework built-in dependency check (Arne Welzel, Corelight)
18+
19+
Extend unbundle to validate dependencies of contained packages and log a
20+
warning if any are not fulfilled or fail to validate. This can happen when
21+
a bundle is created with --nodeps or the target system has different
22+
built-in packages as compared to the source system.
23+
24+
Built-in packages are included in a bundle's manifest.txt file in a new
25+
[meta] section.
26+
27+
* manager: Do not include built-in packages in manifest (Arne Welzel, Corelight)
28+
29+
Bugfix and test for mistakenly recording built-in packages within
30+
the manifest.json file. The built-in information is only ever
31+
requested from Zeek.
32+
33+
* package: Add PackageVersion (Arne Welzel, Corelight)
34+
35+
Make checking if a package version fullfills a version_spec re-usable.
36+
37+
This certainly changes the messages produced, but doesn't seem there
38+
are many tests upset about that.
39+
40+
* Add built-in package awareness (Arne Welzel, Corelight)
41+
42+
This change uses Zeek 6.0's --build-info flags to discover the "zkg.provides"
43+
entry and makes ``zkg`` aware of these as installed packages.
44+
45+
It introduces the following changes
46+
47+
* A pseudo zeek-builtin:// scheme for git_urls to recognize when a
48+
Package instance relates to a built-in package
49+
* The package source name "zeek-builtin" is now reserved
50+
* A zkg bundle's manifest now contains a new section called `[bundle_builtin]`
51+
listing any packages that are expected to exists as built-in packages on
52+
the target system. The content is derived from the built-in packages on
53+
the system building the bundle. This is somewhat narrow and opinionated,
54+
but at the same time avoids the complexity of any constructed scenarios
55+
one can come up with here.
56+
* A new tracking method "builtin" exists. It should act as version but
57+
makes it explicit that a package is built-in.
58+
59+
Most commands have been extended to either ignore (purge) or fail
60+
(install, remove, test, load, unload, pin, unpin) when they detect
61+
a built-in package being operated on. The commands list and info
62+
received a ``--include-builtin`` option for explicitly including
63+
built-in packages in the output.
64+
65+
* zkg: Log warnings by default (Arne Welzel, Corelight)
66+
67+
Currently, to see warnings generated by zkg a user has to pass a single -v.
68+
Change this behavior by always installing the StreamHandler() with a
69+
warning level so that warnings are displayed by default.
70+
71+
* package: Add a few __repr__() implementations (Arne Welzel, Corelight)
72+
73+
Not having __repr__() implemented makes it more difficult than needed
74+
when using print / IPython shell to look around and discover state.
75+
Implement some of them to aid that development style.
76+
77+
They aren't perfect, but better than not having them at all.
78+
79+
* _util: Add ZeekInfo helper class (Arne Welzel, Corelight)
80+
81+
Mostly for collecting executable paths for now, but could also see
82+
the ZEEKPATH collections being done there down the road.
83+
184
2.13.0-32 | 2023-06-20 15:55:21 -0700
285

386
* Add --ignore-dirty-git option to test and install commands (Tim Wojtulewicz, Corelight)

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.13.0-32
1+
2.13.0-46

doc/man/zkg.1

Lines changed: 35 additions & 27 deletions
Large diffs are not rendered by default.

doc/package.rst

Lines changed: 15 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ This is the package's metadata file in INI file format and may contain
2222
:ref:`additional fields <metadata-fields>` that describe the package as well
2323
as how it inter-operates with Zeek, the package manager, or other packages.
2424

25-
.. note::
26-
27-
:file:`zkg.meta` is the canonical metadata file name used :program:`since
28-
zkg v2.0`. The previous metadata file name of :file:`bro-pkg.meta` is also
29-
accepted when no :file:`zkg.meta` exists.
30-
3125
.. _package-shorthand-name:
3226

3327
Note that the shorthand name for your package that may be used by :ref:`zkg
@@ -36,7 +30,7 @@ last component of its git URL. E.g. a package at ``https://github.com/zeek/foo``
3630
may be referred to as **foo** when using :program:`zkg` and a Zeek
3731
script that wants to load all the scripts within that package can use:
3832

39-
.. code-block:: bro
33+
.. code-block:: zeek
4034
4135
@load foo
4236
@@ -229,11 +223,6 @@ though the following step are the essentials needed to create a package.
229223
script_dir = scripts/Demo/Rot13
230224
build_command = ./configure && make
231225

232-
.. note::
233-
234-
See :ref:`legacy-bro-support` for notes on configuring packages to
235-
support Bro 2.5 or earlier.
236-
237226
#. Add example script code:
238227

239228
.. code-block:: console
@@ -257,9 +246,7 @@ though the following step are the essentials needed to create a package.
257246
*p = (*p - b + 13) % 26 + b;
258247
}
259248
260-
BroString* bs = new BroString(1, reinterpret_cast<byte_vec>(rot13),
261-
strlen(rot13));
262-
return new StringVal(bs);
249+
return make_intrusive<StringVal>(strlen(rot13), rot13);
263250
%}
264251

265252
#. Commit everything to git:
@@ -576,11 +563,6 @@ An example :file:`zkg.meta`::
576563
script_dir = scripts/Demo/Rot13
577564
build_command = ./configure && make
578565

579-
.. note::
580-
581-
See :ref:`legacy-bro-support` for notes on configuring packages to
582-
support Bro 2.5 or earlier.
583-
584566
The default CMake skeleton for Zeek plugins will use :file:`build/` as the
585567
directory for the final/built version of the plugin, which matches the defaulted
586568
value of the omitted `plugin_dir` metadata field.
@@ -591,31 +573,6 @@ script components, the "plugin" part is always unconditionally loaded by Zeek,
591573
but the "script" components must either be explicitly loaded (e.g. :samp:`@load
592574
{<package_name>}`) or the package marked as :ref:`loaded <load-command>`.
593575

594-
.. _legacy-bro-support:
595-
596-
Supporting Older Bro Versions
597-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
598-
599-
Plugin skeletons generated before Bro v2.6 and also any packages
600-
that generally want to support such Bro versions need to pass
601-
an additional configuration option such as::
602-
603-
build_command = ./configure --bro-dist=%(bro_dist)s && make
604-
605-
See the :ref:`Value Interpolation <metadata-interpolation>`
606-
section for more information on what the ``%(bro_dist)s``
607-
string does, but a brief explanation is that it will expand to
608-
a path containing the Bro source-code on the user's system.
609-
For newer versions of Bro, packages are able to work entirely
610-
with the installation path and don't require original source code.
611-
612-
Also note that other various Zeek scripting and CMake infrastructure may
613-
have changed between Bro v2.6 and Zeek v3.0. So if you plan to support
614-
older version of Bro (before the Zeek rename), then you should keep an eye
615-
out for various things that got renamed. For example, the `zeek_init` event
616-
won't exist in any version before Zeek v3.0, nor will any CMake macros
617-
that start with `zeek_plugin`.
618-
619576
.. _metadata-interpolation:
620577

621578
Value Interpolation
@@ -624,18 +581,14 @@ Value Interpolation
624581
The `build_command field`_ may reference the settings any given user has in
625582
their customized :ref:`package manager config file <zkg-config-file>`.
626583

627-
For example, if a metadata field's value contains the ``%(bro_dist)s`` string,
584+
For example, if a metadata field's value contains the ``%(zeek_dist)s`` string,
628585
then :program:`zkg` operations that use that field will automatically
629-
substitute the actual value of `bro_dist` that the user has in their local
586+
substitute the actual value of `zeek_dist` that the user has in their local
630587
config file. Note the trailing 's' character at the end of the interpolation
631-
string, ``%(bro_dist)s``, is intended/necessary for all such interpolation
632-
usages. Note that :program:`since zkg v2.0`, `zeek_dist` is the canonical name
633-
for `bro_dist` within the :ref:`zkg config file <zkg-config-file>`,
634-
but either one means the same thing and should work. To support older
635-
versions of :program:`bro-pkg`, you'd want to use `bro_dist` in package
636-
metadata files.
637-
638-
Besides the `bro_dist`/`zeek_dist` config keys, any key inside the
588+
string, ``%(zeek_dist)s``, is intended/necessary for all such interpolation
589+
usages.
590+
591+
Besides the `zeek_dist` config key, any key inside the
639592
`user_vars` sections of their :ref:`package manager config file
640593
<zkg-config-file>` that matches the key of an entry in the package's
641594
`user_vars field`_ will be interpolated.
@@ -777,38 +730,24 @@ An example :file:`zkg.meta`::
777730
The field is a list of dependency names and their version requirement
778731
specifications.
779732

780-
A dependency name may be either `zeek`, `zkg`, `bro`, `bro-pkg`,
733+
A dependency name may be either `zeek`, `zkg`,
781734
a full git URL of the package, or a :ref:`package shorthand name
782735
<package-shorthand-name>`.
783736

784-
- The special `zeek` and `bro` dependencies refers not to a package,
785-
but the version of Zeek that the package requires in order to function. If
786-
the user has :program:`zeek-config` or :program:`bro-config` in their
787-
:envvar:`PATH` when installing/upgrading a package that specifies a `zeek` or
788-
`bro` dependency, then :program:`zkg` will enforce that the requirement is
789-
satisfied.
737+
- The special `zeek` dependency refers not to a package, but the version of Zeek
738+
that the package requires in order to function. If the user has
739+
:program:`zeek-config` in their :envvar:`PATH` when installing/upgrading a
740+
package that specifies a `zeek` dependency, then :program:`zkg` will enforce
741+
that the requirement is satisfied.
790742

791-
.. note::
792-
793-
In this context, `zeek` and `bro` mean the same thing -- the
794-
later is maintained for backwards compatibility while the former
795-
became available :program:`since zkg v2.0`.
796-
797-
- The special `zkg` and `bro-pkg` dependencies refers to the version of the
743+
- The special `zkg` dependency refers to the version of the
798744
package manager that is required by the package. E.g. if a package takes
799745
advantage of new features that are not present in older versions of the
800746
package manager, then it should indicate that so users of those old version
801747
will see an error message an know to upgrade instead of seeing a cryptic
802748
error/exception, or worse, seeing no errors, but without the desired
803749
functionality being performed.
804750

805-
.. note::
806-
807-
This feature itself, via use of a `bro-pkg` dependency, is only
808-
available :program:`since bro-pkg v1.2` while a `zkg` dependency is only
809-
recognized :program:`since zkg v2.0`. Otherwise, `zkg` and `bro-pkg` mean
810-
the same thing in this context.
811-
812751
- The full git URL may be directly specified in the `depends` metadata if you
813752
want to force the dependency to always resolve to a single, canonical git
814753
repository. Typically this is the safe approach to take when listing

doc/quickstart.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ have Zeek automatically load the scripts from all
141141
:ref:`installed <install-command>` packages that are also marked as
142142
":ref:`loaded <load-command>`" add:
143143

144-
.. code-block:: bro
144+
.. code-block:: zeek
145145
146146
@load packages
147147

doc/source.rst

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ usernames or some unique way of identifying the organization/person that
2222
maintains Zeek packages. However, a source is free to use a flat organization
2323
with a single, top-level :file:`zkg.index`.
2424

25-
.. note::
26-
27-
The magic index file name of :file:`zkg.index` is available :program:`since
28-
zkg v2.0`. For compatibility purposes, the old index file name of
29-
:file:`bro-pkg.index` is also still supported.
30-
3125
After creating a git repo for the package source and adding package index files
3226
to it, it's ready to be used by :ref:`zkg <zkg>`.
3327

@@ -36,10 +30,9 @@ to it, it's ready to be used by :ref:`zkg <zkg>`.
3630
Package Index Files
3731
-------------------
3832

39-
Files named :file:`zkg.index` (or the legacy :file:`bro-pkg.index`) are used to
40-
describe the :doc:`Zeek Packages <package>` found within the package source.
41-
They are simply a list of git URLs pointing to the git repositories of
42-
packages. For example::
33+
Files named :file:`zkg.index` are used to describe the :doc:`Zeek Packages
34+
<package>` found within the package source. They are simply a list of git URLs
35+
pointing to the git repositories of packages. For example::
4336

4437
https://github.com/zeek/foo
4538
https://github.com/zeek/bar
@@ -75,9 +68,8 @@ Aggregating Metadata
7568
--------------------
7669

7770
The maintainer/operator of a package source may choose to periodically aggregate
78-
the metadata contained in its packages' :file:`zkg.meta` (and legacy
79-
:file:`bro-pkg.meta`) files. The :ref:`zkg refresh <refresh-command>`
80-
is used to perform the task. For example:
71+
the metadata contained in its packages' :file:`zkg.meta` files. The :ref:`zkg
72+
refresh <refresh-command>` is used to perform the task. For example:
8173

8274
.. code-block:: console
8375

doc/zkg.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
.. _bro-pkg:
2-
31
.. _zkg:
42

53
zkg Command-Line Tool
@@ -217,8 +215,6 @@ template info
217215
:prog: zkg
218216
:path: template info
219217

220-
.. _bro-pkg-config-file:
221-
222218
.. _zkg-config-file:
223219

224220
Config File

testing/baselines/tests.install-bro-pkg-warning/stderr

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
22
XXXX-XX-XX XX:XX:XX DEBUG found source clone of "one" at <...>/one
33
XXXX-XX-XX XX:XX:XX DEBUG refresh "one": pulling <...>/one
4-
XXXX-XX-XX XX:XX:XX WARNING <...>/bro-pkg.meta: missing metadata file
5-
XXXX-XX-XX XX:XX:XX WARNING skipping aggregation of <...>/bad_pkg: bad metadata: missing zkg.meta (or bro-pkg.meta) metadata file
4+
XXXX-XX-XX XX:XX:XX WARNING <...>/zkg.meta: missing metadata file
5+
XXXX-XX-XX XX:XX:XX WARNING skipping aggregation of <...>/bad_pkg: bad metadata: missing zkg.meta metadata file
66
XXXX-XX-XX XX:XX:XX DEBUG metadata refresh: 8 additions (alice/bar, alice/baz, alice/foo, alice/i-have-no-scripts, alice/new_pkg, alice/qux, bob/corge, bob/grault), 0 changes, 0 removals
77
XXXX-XX-XX XX:XX:XX INFO committed package source "one" metadata update
88
XXXX-XX-XX XX:XX:XX DEBUG fetch package one<...>/foo
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
22
XXXX-XX-XX XX:XX:XX DEBUG found source clone of "one" at <...>/one
33
XXXX-XX-XX XX:XX:XX DEBUG refresh "one": pulling <...>/one
4-
XXXX-XX-XX XX:XX:XX WARNING <...>/bro-pkg.meta: missing metadata file
5-
XXXX-XX-XX XX:XX:XX WARNING skipping aggregation of <...>/bad_pkg: bad metadata: missing zkg.meta (or bro-pkg.meta) metadata file
4+
XXXX-XX-XX XX:XX:XX WARNING <...>/zkg.meta: missing metadata file
5+
XXXX-XX-XX XX:XX:XX WARNING skipping aggregation of <...>/bad_pkg: bad metadata: missing zkg.meta metadata file
66
XXXX-XX-XX XX:XX:XX DEBUG metadata refresh: 8 additions (alice/bar, alice/baz, alice/foo, alice/i-have-no-scripts, alice/new_pkg, alice/qux, bob/corge, bob/grault), 0 changes, 0 removals
77
XXXX-XX-XX XX:XX:XX DEBUG fetch package one<...>/foo

0 commit comments

Comments
 (0)