diff options
Diffstat (limited to 'hack')
-rwxr-xr-x | hack/btrfs_installed_tag.sh | 2 | ||||
-rwxr-xr-x | hack/btrfs_tag.sh | 2 | ||||
-rwxr-xr-x | hack/get_ci_vm.sh | 6 | ||||
-rwxr-xr-x | hack/libdm_tag.sh | 2 | ||||
-rwxr-xr-x | hack/podman-commands.sh | 8 | ||||
-rwxr-xr-x | hack/release.sh | 2 | ||||
-rwxr-xr-x | hack/systemd_tag.sh | 2 | ||||
-rwxr-xr-x | hack/xref-helpmsgs-manpages | 27 |
8 files changed, 35 insertions, 16 deletions
diff --git a/hack/btrfs_installed_tag.sh b/hack/btrfs_installed_tag.sh index c4d99f377..f2f2b33c8 100755 --- a/hack/btrfs_installed_tag.sh +++ b/hack/btrfs_installed_tag.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -cc -E - > /dev/null 2> /dev/null << EOF +${CPP:-${CC:-cc} -E} ${CPPFLAGS} - > /dev/null 2> /dev/null << EOF #include <btrfs/ioctl.h> EOF if test $? -ne 0 ; then diff --git a/hack/btrfs_tag.sh b/hack/btrfs_tag.sh index 59cb969ad..ea753d4d0 100755 --- a/hack/btrfs_tag.sh +++ b/hack/btrfs_tag.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -cc -E - > /dev/null 2> /dev/null << EOF +${CPP:-${CC:-cc} -E} ${CPPFLAGS} - > /dev/null 2> /dev/null << EOF #include <btrfs/version.h> EOF if test $? -ne 0 ; then diff --git a/hack/get_ci_vm.sh b/hack/get_ci_vm.sh index f8c7e792e..0755470a2 100755 --- a/hack/get_ci_vm.sh +++ b/hack/get_ci_vm.sh @@ -7,7 +7,7 @@ # problems specifically related to Cirrus-CI automated testing. However, # because it's only loosely coupled to the `.cirrus.yml` configuration, it must # orchestrate VMs in GCP directly. This means users need to have -# pre-authorization (access) to manipulate google-cloud resoures. Additionally, +# pre-authorization (access) to manipulate google-cloud resources. Additionally, # there are no guarantees it will remain in-sync with other automation-related # scripts. Therefore it may not always function for everybody in every # future scenario without updates/modifications/tweaks. @@ -149,7 +149,7 @@ parse_args(){ VM_IMAGE_NAME="$1" - # Word-splitting is desireable in this case + # Word-splitting is desirable in this case # shellcheck disable=SC2207 ENVS=( $(get_env_vars) @@ -166,7 +166,7 @@ parse_args(){ } # Returns true if user has run an 'init' and has a valid token for -# the specific project-id and named-configuration argumens in $PGCLOUD. +# the specific project-id and named-configuration arguments in $PGCLOUD. function has_valid_credentials() { if $PGCLOUD info |& grep -Eq 'Account:.*None'; then return 1 diff --git a/hack/libdm_tag.sh b/hack/libdm_tag.sh index d3668aab1..815b5d914 100755 --- a/hack/libdm_tag.sh +++ b/hack/libdm_tag.sh @@ -2,7 +2,7 @@ tmpdir="$PWD/tmp.$RANDOM" mkdir -p "$tmpdir" trap 'rm -fr "$tmpdir"' EXIT -cc -o "$tmpdir"/libdm_tag -ldevmapper -x c - > /dev/null 2> /dev/null << EOF +${CC:-cc} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o "$tmpdir"/libdm_tag -x c - -ldevmapper > /dev/null 2> /dev/null << EOF #include <libdevmapper.h> int main() { struct dm_task *task; diff --git a/hack/podman-commands.sh b/hack/podman-commands.sh index 587cac782..0455287d4 100755 --- a/hack/podman-commands.sh +++ b/hack/podman-commands.sh @@ -23,8 +23,14 @@ function die() { # the command name but not its description. function podman_commands() { $PODMAN help "$@" |\ - awk '/^Available Commands:/{ok=1;next}/^Flags:/{ok=0}ok { print $1 }' |\ + awk '/^Available Commands:/{ok=1;next}/^Options:/{ok=0}ok { print $1 }' |\ grep . + + # Special case: podman-completion is a hidden command + # it does not show in podman help so add it here + if [[ -z "$@" ]]; then + echo "completion" + fi } # Read a list of subcommands from a command's metadoc diff --git a/hack/release.sh b/hack/release.sh index 56cd04079..e9eeaa73b 100755 --- a/hack/release.sh +++ b/hack/release.sh @@ -27,7 +27,7 @@ LAST_TAG=$(git describe --tags --abbrev=0) write_go_version() { LOCAL_VERSION="$1" - sed -i "s/^\(var Version = semver.MustParse\( \"\).*/\1${LOCAL_VERSION}\"\)/" version/version.go + sed -i "s/^\(var Version = semver.MustParse( *\"\).*/\1${LOCAL_VERSION}\")/" version/version.go } write_spec_version() diff --git a/hack/systemd_tag.sh b/hack/systemd_tag.sh index 19a7bf6a6..5af322881 100755 --- a/hack/systemd_tag.sh +++ b/hack/systemd_tag.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -cc -E - > /dev/null 2> /dev/null << EOF +${CPP:-${CC:-cc} -E} ${CPPFLAGS} - > /dev/null 2> /dev/null << EOF #include <systemd/sd-daemon.h> EOF if test $? -eq 0 ; then diff --git a/hack/xref-helpmsgs-manpages b/hack/xref-helpmsgs-manpages index a7063259f..55c8b6582 100755 --- a/hack/xref-helpmsgs-manpages +++ b/hack/xref-helpmsgs-manpages @@ -181,6 +181,9 @@ sub xref_by_man { next if $k eq 'varlink'; next if "@subcommand" eq 'system' && $k eq 'service'; + # Special case: podman completion is a hidden command + next if $k eq 'completion'; + warn "$ME: podman @subcommand: $k in $man, but not --help\n"; ++$Errs; } @@ -248,7 +251,7 @@ sub podman_help { unless $subcommand eq 'help'; # 'help' not in man } } - elsif ($section eq 'flags') { + elsif ($section eq 'options') { # Handle '--foo' or '-f, --foo' if ($line =~ /^\s{1,10}(--\S+)\s/) { print "> podman @_ $1\n" if $debug; @@ -293,7 +296,7 @@ sub podman_man { elsif ($line =~ /^\#\#\s+(SUB)?COMMANDS/) { $section = 'commands'; } - elsif ($line =~ /^\#\#/) { + elsif ($line =~ /^\#\#[^#]/) { $section = ''; } @@ -329,12 +332,22 @@ sub podman_man { } @most_recent_flags = (); - # Handle any variation of '**--foo**, **-f**' - while ($line =~ s/^\*\*((--[a-z0-9-]+)|(-.))\*\*(,\s+)?//g) { - $man{$1} = 1; + # As of PR #8292, all options are <h4> and anchored + if ($line =~ s/^\#{4}\s+//) { + # If option has long and short form, long must come first. + # This is a while-loop because there may be multiple long + # option names, e.g. --net/--network + while ($line =~ s/^\*\*(--[a-z0-9-]+)\*\*(=\*[a-zA-Z0-9-]+\*)?(,\s+)?//g) { + $man{$1} = 1; + push @most_recent_flags, $1; + } + # Short form + if ($line =~ s/^\*\*(-[a-zA-Z0-9])\*\*(=\*[a-zA-Z0-9-]+\*)?//g) { + $man{$1} = 1; - # Keep track of them, in case we see 'Not implemented' below - push @most_recent_flags, $1; + # Keep track of them, in case we see 'Not implemented' below + push @most_recent_flags, $1; + } } } } |