Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/topic/awelzel/revert-ignore-dirt…
Browse files Browse the repository at this point in the history
…y-git'

* origin/topic/awelzel/revert-ignore-dirty-git:
  Revert --ignore-dirty-git addition
  • Loading branch information
timwoj committed Feb 15, 2024
2 parents 1730332 + 508393a commit 7221a8c
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 92 deletions.
6 changes: 6 additions & 0 deletions CHANGES
@@ -1,3 +1,9 @@
2.13.0-72 | 2024-02-15 09:21:42 -0500

* Revert --ignore-dirty-git addition (Arne Welzel, Corelight)

This reverts commit e3de7c2dd70afde8e5512bdb608ec16138aaf525.

2.13.0-70 | 2024-01-24 12:27:36 -0800

* Set language in conf.py to avoid Sphinx warning (Christian Kreibich, Corelight)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
2.13.0-70
2.13.0-72
72 changes: 31 additions & 41 deletions doc/man/zkg.1

Large diffs are not rendered by default.

16 changes: 0 additions & 16 deletions testing/tests/ignore-dirty

This file was deleted.

8 changes: 1 addition & 7 deletions testing/tests/install-invalid
Expand Up @@ -17,12 +17,6 @@ mkdir ./packages/notagitrepo
zkg --config=$CONFIG install --force ./packages/notagitrepo

mkdir ./packages/dirtyrepo
( cd ./packages/dirtyrepo && \
git init . && \
touch README && \
cp ${PACKAGES}/foo/zkg.meta zkg.meta && \
git add README zkg.meta && \
git commit -m "Initial commit")
( cd ./packages/dirtyrepo && git init . && touch README && git add README && git commit -m "Initial commit")
echo README > ./packages/dirtyrepo/README

zkg --config=$CONFIG install --force ./packages/dirtyrepo
2 changes: 1 addition & 1 deletion zeekpkg/__init__.py
Expand Up @@ -9,7 +9,7 @@

import logging

__version__ = "2.13.0-70"
__version__ = "2.13.0-72"
__all__ = ["manager", "package", "source", "template", "uservar"]

LOG = logging.getLogger(__name__)
Expand Down
31 changes: 5 additions & 26 deletions zkg
Expand Up @@ -354,12 +354,12 @@ def is_local_git_repo_dirty(git_url):
return repo.is_dirty(untracked_files=True)


def check_local_git_repo(git_url, allow_dirty):
def check_local_git_repo(git_url):
if is_local_git_repo_url(git_url):
if not is_local_git_repo(git_url):
print_error(f"error: path {git_url} is not a git repository")
return False
if not allow_dirty and is_local_git_repo_dirty(git_url):
if is_local_git_repo_dirty(git_url):
print_error(f"error: local git clone at {git_url} is dirty")
return False

Expand Down Expand Up @@ -525,7 +525,7 @@ def cmd_test(manager, args, config, configfile):
package_infos = []

for name in args.package:
if not check_local_git_repo(name, args.ignore_dirty_git):
if not check_local_git_repo(name):
sys.exit(1)

# If the package to be tested is included with Zeek, don't allow
Expand Down Expand Up @@ -602,7 +602,7 @@ def cmd_install(manager, args, config, configfile):
package_infos = []

for name in args.package:
if not check_local_git_repo(name, args.ignore_dirty_git):
if not check_local_git_repo(name):
sys.exit(1)

# Outright prevent installing a package that Zeek has built-in.
Expand Down Expand Up @@ -878,7 +878,7 @@ def cmd_bundle(manager, args, config, configfile):
new_pkgs = []

for name, version in packages:
if not check_local_git_repo(name, args.ignore_dirty_git):
if not check_local_git_repo(name):
sys.exit(1)

if not version:
Expand Down Expand Up @@ -2475,13 +2475,6 @@ def argparser():
" the latest version tag, or if a package has none,"
' the default branch, like "main" or "master".',
)
sub_parser.add_argument(
"--ignore-dirty-git",
action="store_true",
help=(
"Allows installation of packages from 'dirty' git clones instead of failing."
),
)

# install
sub_parser = command_parser.add_parser(
Expand Down Expand Up @@ -2523,13 +2516,6 @@ def argparser():
" the latest version tag, or if a package has none,"
' the default branch, like "main" or "master".',
)
sub_parser.add_argument(
"--ignore-dirty-git",
action="store_true",
help=(
"Allows installation of packages from 'dirty' git clones instead of failing."
),
)
add_uservar_args(sub_parser)

# bundle
Expand Down Expand Up @@ -2587,13 +2573,6 @@ def argparser():
" left blank to indicate that the latest available version should be"
" used.",
)
sub_parser.add_argument(
"--ignore-dirty-git",
action="store_true",
help=(
"Allows installation of packages from 'dirty' git clones instead of failing."
),
)

# unbundle
sub_parser = command_parser.add_parser(
Expand Down

0 comments on commit 7221a8c

Please sign in to comment.