Quellcode durchsuchen

Remove unused/deprecated scripts

Tianon Gravi vor 7 Jahren
Ursprung
Commit
898043307b
2 geänderte Dateien mit 0 neuen und 136 gelöschten Zeilen
  1. 0 76
      build-and-push.sh
  2. 0 60
      children.sh

+ 0 - 76
build-and-push.sh

@@ -1,76 +0,0 @@
-#!/bin/bash
-set -eu -o pipefail
-
-# set "$0" so that tmux shows something more useful than "bash" in the statusbar
-desired0='b-a-p'
-if ! grep -q "$desired0" "/proc/$$/cmdline"; then
-	exec -a "$desired0" "$SHELL" -- "$BASH_SOURCE" "$@"
-fi
-
-if [ "$#" -eq 0 ]; then
-	self="$(basename "$0")"
-	cat >&2 <<-EOF
-		error: missing arguments
-		usage: $self <build args>
-		   ie: $self debian ubuntu
-	EOF
-	exit 1
-fi
-
-# allow for specifying an alternate path to "bashbrew"
-: "${BASHBREW:=bashbrew}"
-
-# normalize "$@" to be the "--uniq" versions (and deduplicate)
-# also grab the list of associated repos in explicit build order (so we can build/push grouped by repo)
-IFS=$'\n'
-set -- $("$BASHBREW" list --uniq --repos "$@" | sort -u | xargs "$BASHBREW" list --uniq --repos --build-order --apply-constraints)
-repos=( $(echo "$*" | cut -d: -f1 | xargs "$BASHBREW" list --repos --build-order --apply-constraints) )
-unset IFS
-
-declare -A repoTags=()
-for repoTag; do
-	repo="${repoTag%%:*}"
-	repoTags[$repo]+=" $repoTag"
-done
-
-# fill "$@" back up with the corrected build order (especially for the "Children:" output)
-set --
-for repo in "${repos[@]}"; do
-	set -- "$@" ${repoTags[$repo]}
-done
-
-children="$("$(dirname "$BASH_SOURCE")/children.sh" "$@")"
-
-echo
-echo
-echo "Children: (of $*)"
-echo "${children:-<none>}"
-echo
-echo
-
-for repo in "${repos[@]}"; do
-	tags=( ${repoTags[$repo]} )
-	(
-		set -x
-		time "$BASHBREW" build "${tags[@]}"
-		time "$BASHBREW" tag "${tags[@]}"
-		time "$BASHBREW" push "${tags[@]}"
-	)
-done
-
-echo
-echo
-echo "Children: (of $*)"
-echo "${children:-<none>}"
-echo
-echo
-
-if [ "$children" ]; then
-	echo 'Suggested command:'
-	echo "  ./children.sh $* | xargs ./build-and-push.sh"
-	echo
-fi
-
-# end by printing only warnings (stderr) for images we skipped (such as "windowsservercore" when building on Linux)
-# this helps remind us to switch BASHBREW or servers
-"$BASHBREW" list --apply-constraints "$@" > /dev/null

+ 0 - 60
children.sh

@@ -1,60 +0,0 @@
-#!/bin/bash
-set -eu -o pipefail
-
-# "bashbrew children" can't work with "--uniq" and "bashbrew build" will build the entire "tag group", so we need to filter the output to just uniq values
-
-: "${BASHBREW:=bashbrew}"
-
-IFS=$'\n'
-set -- $("$BASHBREW" list --uniq --repos --build-order --apply-constraints "$@")
-
-# \o/ https://github.com/docker-library/official-images/commit/9e57342714f99074ec205eea668c8b73aada36ec
-comm -13 \
-		<("$BASHBREW" list "$@" | sort -u) \
-		<("$BASHBREW" children --apply-constraints "$@" | sort -u) \
-	| xargs --no-run-if-empty "$BASHBREW" list --build-order --apply-constraints --uniq
-exit 0
-
-children=( $("$BASHBREW" children --apply-constraints "$@") )
-
-[ "${#children[@]}" -gt 0 ] || exit 0
-
-# just repo names so we can get the right build-order for all of their tags
-childrenRepos=( $(echo "${children[*]}" | cut -d: -f1 | sort -u) )
-
-# all uniq tags from all repos which have relevant children, in proper build order
-childrenReposUniq=( $("$BASHBREW" list --uniq --build-order --apply-constraints "${childrenRepos[@]}") )
-
-# the canonical ("uniq") versions of the children we're after (same as the values now in "childrenReposUniq")
-#   use "comm" to suppress "$@" from the list of children we care about
-childrenUniq=(
-	$(
-		comm -13 \
-			<(
-				"$BASHBREW" list --uniq "$@" \
-					| sort -u
-			) \
-			<(
-				"$BASHBREW" list --uniq "${children[@]}" \
-					| sort -u
-			)
-	)
-)
-
-[ "${#childrenUniq[@]}" -gt 0 ] || exit 0
-
-unset IFS
-
-# create a lookup table of whether we should return a particular tag
-declare -A wantChild=()
-for child in "${childrenUniq[@]}"; do
-	wantChild["$child"]=1
-done
-
-# loop over the canonical build order and print out tags we want :)
-for child in "${childrenReposUniq[@]}"; do
-	[ "${wantChild[$child]:-}" ] || continue
-	echo "$child"
-done
-
-# note that we can't use "comm" by itself here because "childrenUniq" and "childrenReposUniq" are not in the same order, which "comm" requires