diff options
author | Kerin Millar <kfm@plushkava.net> | 2024-08-02 15:31:54 +0100 |
---|---|---|
committer | Kerin Millar <kfm@plushkava.net> | 2024-08-02 17:21:14 +0100 |
commit | 2e8bbd04cb55163b3d18ab407ffd8be24bf82c6e (patch) | |
tree | 2f3dab2cf0280736681c24a6654312afe34a672b /functions.sh | |
parent | Render hr() faster still for shells other than bash (diff) | |
download | gentoo-functions-2e8bbd04cb55163b3d18ab407ffd8be24bf82c6e.tar.gz gentoo-functions-2e8bbd04cb55163b3d18ab407ffd8be24bf82c6e.tar.bz2 gentoo-functions-2e8bbd04cb55163b3d18ab407ffd8be24bf82c6e.zip |
Move is_subset() to experimental
I'm not yet ready to commit to it being among the core functions for the
inaugural API level.
Signed-off-by: Kerin Millar <kfm@plushkava.net>
Diffstat (limited to 'functions.sh')
-rw-r--r-- | functions.sh | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/functions.sh b/functions.sh index a002e54..69b9bf5 100644 --- a/functions.sh +++ b/functions.sh @@ -247,46 +247,6 @@ is_anyof() } # -# Collects the intersection of the parameters up to - but not including - a -# sentinel value then determines whether the resulting set is a subset of the -# intersection of the remaining parameters. If the SENTINEL variable is set, it -# shall be taken as the value of the sentinel. Otherwise, the value of the -# sentinel shall be defined as <hyphen-dash><hyphen-dash>. If the sentinel value -# is not encountered or if either set is empty then the return value shall be -# greater than 1. -# -is_subset() -{ - SENTINEL=${SENTINEL-'--'} awk -f - -- "$@" <<-'EOF' - BEGIN { - argc = ARGC - ARGC = 1 - for (i = 1; i < argc; i++) { - word = ARGV[i] - if (word == ENVIRON["SENTINEL"]) { - break - } else { - set1[word] - } - } - if (i == 1 || argc - i < 2) { - exit 1 - } - for (i++; i < argc; i++) { - word = ARGV[i] - set2[word] - } - for (word in set2) { - delete set1[word] - } - for (word in set1) { - exit 1 - } - } - EOF -} - -# # Considers one or more pathnames and prints the one having the newest # modification time. If at least one parameter is provided, all parameters shall # be considered as pathnames to be compared to one another. Otherwise, the |