jlalkjadlkjdsalk

This commit is contained in:
2025-05-23 15:31:01 +02:00
parent 56fb959489
commit 30185df714

View File

@@ -38,15 +38,15 @@ export NIX_PATH := `echo "${NIX_PATH_ORIG:-"${NIX_PATH:-}"}"`
list-packages +$cut_args="-c1-": _packages_json
#!/usr/bin/env -S bash -euo pipefail
cachefile=/tmp/nixpkgs-packages.json.tsv
if [[ -s "$cachefile" && "$cachefile" -nt packages.json ]]; then
cut <"$cachefile" "$@"
else
if ! [[ -s "$cachefile" && "$cachefile" -nt packages.json ]]; then
jq <packages.json 'to_entries[] | select(.value.meta.position==null|not) | [.key, .value.meta.position] | @tsv' -r \
| tr '0123456789' '9876543210' | sort | tr '0123456789' '9876543210' \
| sed -e 's#:\([0-9]*\)$#\t\1#' \
| grep . >"$cachefile"
#| sed -e "s#\t$(realpath master)/#\t#" \
fi
cut <"$cachefile" "$@"
@_list_packages_fname_filtered:
xargs -d $'\n' -n 2000 just __list_packages_fname_filtered \
@@ -746,7 +746,7 @@ setup:
if [[ ! -d ../upstream/"$branch" ]]; then
set -x
$GIT fetch upstream "$branch"
$GIT worktree add ../upstream/"$branch" -B "$branch" upstream/"$branch"
$GIT worktree add ../upstream/"$branch" -B "upstream-$branch" upstream/"$branch"
else
cd ../upstream/"$branch"
if [[ $(( "$epoch" - "$($GIT log --oneline --format="%ct" HEAD -n1)" )) -gt $(( 60*60*24 )) ]]; then
@@ -756,8 +756,8 @@ setup:
fi
)
declare -a branches=()
readarray -td $'\n' branches < <( just _upstream_release_branches "" "" | grep -vxF master )
# TODo: clean old release branches
readarray -td $'\n' branches < <( just _upstream_release_branches "" "" )
# TODO: clean old release branches
for branch in "${branches[@]}"; do
add_upstream "$branch"
done
@@ -976,12 +976,13 @@ _packages_json:
$(( "$epoch" - "$(stat -c %Y packages.json )" )) -gt $(( 60*60*24*7 ))
]]; then
set -x
if ! $GIT -C master/ diff HEAD --exit-code --quiet 1>&2; then
echo >&2 "ERROR: $(realpath master) is dirty!"
[[ -d upstream/master/ ]] || just setup
if ! $GIT -C upstream/master/ diff HEAD --exit-code --quiet 1>&2; then
echo >&2 "ERROR: $(realpath upstream/master) is dirty!"
false
fi
git -C master/ pull upstream master --rebase --autostash 1>&2
just mk-packages-json "packages.json" "./master" false
git -C upstream/master/ pull upstream master --rebase --autostash 1>&2
just mk-packages-json "packages.json" "./upstream/master" false
fi
}