diff --git a/chain-build.sh b/chain-build.sh index 2d6486a..a657542 100755 --- a/chain-build.sh +++ b/chain-build.sh @@ -9,7 +9,7 @@ # ... # fedpkg commit # fedpkg push -# ./chain-build.sh +# ./chain-build.sh # MIT License # @@ -39,38 +39,14 @@ set -o errexit set -o nounset set -o pipefail - -function usage { - echo "usage: $BASH_ARGV0 [-P] [-d|-v] [bug-number]" - exit 2 -} - -no_pull_requests= -quiet=-q -while getopts 'dPv' OPT; do - case "$OPT" in - d) - set -o xtrace - quiet= - ;; - P) - no_pull_requests=1 - ;; - v) - quiet= - ;; - *) - usage - ;; - esac -done -shift $((OPTIND - 1)) +set -o xtrace if (( $# == 1 )); then typeset -i bug=$1 shift; elif (( $# > 1 )); then - usage + echo "usage: $0 [bug-number]" + exit 2 fi function create_authorization_header_file { @@ -116,18 +92,18 @@ koji moshimoshi > /dev/null # Install potential dependencies: if [[ ! -x /usr/bin/crudini \ || ! -x /usr/bin/jq ]]; then - sudo dnf $quiet install -y /usr/bin/crudini /usr/bin/jq + sudo dnf install -y /usr/bin/crudini /usr/bin/jq fi branch="$(git branch --show-current)" # Get a list of packages that require libtree-sitter: packages=($( - dnf $quiet repoquery \ + dnf repoquery \ --repo=fedora --repo=updates \ --releasever="${branch#f}" \ - --whatrequires='libtree-sitter.so.*' \ - --qf='%{source_name}\n' \ + --whatrequires=libtree-sitter \ + --qf='%{source_name}' \ | grep -v '^tree-sitter$' )) @@ -149,40 +125,34 @@ if [[ -z ${side_tag:-} ]]; then | grep --perl-regexp --only-matching "(?<=^Side tag ').*(?=')" )" echo "$side_tag" > .side-tag - koji $quiet wait-repo --no-request "$side_tag" + koji wait-repo "$side_tag" fi # Build tree-sitter in the side tag: verrel="$(fedpkg verrel)" -fedpkg $quiet build --target="$side_tag" -koji $quiet wait-repo --request --build="$verrel" "$side_tag" +fedpkg build --target="$side_tag" +koji wait-repo --request --build="$verrel" "$side_tag" # Try to bump and rebuild the requiring packages: message="Rebuild against $verrel" tmp_dir="$(mktemp -td tree-sitter-chain-build.XXXXXX)" -declare -i i=0 for package in "${packages[@]}"; do - fedpkg $quiet clone --branch="$branch" --depth=1 "$package" \ - "$tmp_dir/$package" + fedpkg clone --branch="$branch" --depth=1 "$package" "$tmp_dir/$package" cd "$tmp_dir/$package" - rpmdev-bumpspec --comment="$message" "$package.spec" >/dev/null + rpmdev-bumpspec --comment="$message" "$package.spec" git add "$package.spec" git commit --allow-empty --message="$message" - if fedpkg $quiet push; then + if fedpkg push; then # Build the requiring package in the side tag: - fedpkg $quiet build --target="$side_tag" --nowait - elif [[ -n $no_pull_requests ]]; then - echo "Skipping $package, which would require a pull request" - skipped_packages+=("$package") - unset packages[$i] + fedpkg build --target="$side_tag" --nowait else # We lack permission for the requiring package, so submit a pull # request instead. - fedpkg $quiet fork - git fetch $quiet --unshallow + fedpkg fork + git fetch --unshallow fas_login="$( git remote -v \ @@ -190,14 +160,13 @@ for package in "${packages[@]}"; do '^(\w+)(?=\s+ssh://(\1)@pkgs\.fedoraproject\.org/forks/\1/rpms/.+ \(push\)$)' )" - git switch $quiet --create "$verrel" - git push $quiet "$fas_login" "$verrel" + git switch --create "$verrel" + git push "$fas_login" "$verrel" create_authorization_header_file distgit response=$( curl \ - ${quiet:+--silent --show-error} \ --fail-with-body \ --header @"$tmp_dir/distgit_authorization" \ --data title="$message" \ @@ -223,9 +192,8 @@ Relates to https://bugzilla.redhat.com/show_bug.cgi?id=$bug. pull_request_urls+=("$response") fi fi - cd - >/dev/null + cd - rm -rf "$tmp_dir/$package" - i=$((i + 1)) done ## If we had permission to push to all of the repos ourselves, we could @@ -244,25 +212,18 @@ There should be builds for each of: ${pull_request_urls:+The following pull requests have been created: ${pull_request_urls[*]} -}${skipped_packages:+The following packages were skipped: - ${skipped_packages[*]} - }When all ${pull_request_urls:+pull requests are merged, and }packages are built, run: bodhi updates new --from-tag ${bug:+--bugs=$bug }... '$side_tag'" -echo " +echo "$summary" -$summary" - -if [[ -n ${bug:-} ]]; then +if [[ -n $bug ]]; then # We could probably use Kerberos here, but # https://bugzilla.redhat.com/docs/en/html/api/core/v1/general.html#authentication # says it's not supported. create_authorization_header_file bugzilla curl \ - ${quiet:+--silent --show-error} \ - ${quiet:+--output /dev/null} \ --fail-with-body \ --header @"$tmp_dir/bugzilla_authorization" \ --variable "summary=$summary" \ diff --git a/sources b/sources index 9599e8c..a4d4f43 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (tree-sitter-0.25.10.tar.gz) = f0465a2fabe303c1b62f1f55ed08aa57372ac11370d229adcccd99b5e8067be53e92da281cdfbcd034e2ecefb33ac90a119eeac9035670ac8fbaa4242cb87a11 +SHA512 (tree-sitter-0.25.2.tar.gz) = 8acdb410c8b5c2552e9dd5524d80ab1d529e418f408d7c495619e6781f3b70ea2d61b6f69b5b3d1ebd753b739c0f9dd744302808d9a3051b5c7dcf68dba30002 diff --git a/tree-sitter.spec b/tree-sitter.spec index 19fac45..2fc2c34 100644 --- a/tree-sitter.spec +++ b/tree-sitter.spec @@ -1,12 +1,7 @@ -%global tree_sitter_so_version 0 - -# Keep these up-to-date with the values in lib/include/tree_sitter/api.h: -%global tree_sitter_language_version 15 -%global tree_sitter_min_compatible_language_version 13 - +%global treesitter_so_version 0 Name: tree-sitter -Version: 0.25.10 +Version: 0.25.2 Release: %autorelease Summary: An incremental parsing system for programming tools @@ -33,12 +28,6 @@ edited. Tree-sitter aims to be: %package -n lib%{name} Summary: Incremental parsing library for programming tools -%{lua: - for i = rpm.expand('%tree_sitter_min_compatible_language_version'), - rpm.expand('%tree_sitter_language_version') do - print(string.format("Provides: tree-sitter(:LANGUAGE_VERSION) = %d\n", i)) - end -} %description -n lib%{name} Tree-sitter is a parser generator tool and an incremental parsing @@ -70,22 +59,11 @@ export PREFIX='%{_prefix}' LIBDIR='%{_libdir}' INCLUDEDIR='%{_includedir}' find %{buildroot}%{_libdir} -type f \( -name "*.la" -o -name "*.a" \) -delete -print -install -d %{buildroot}%{_datadir}/tree-sitter/queries - - -%check -grep -q '^#define TREE_SITTER_LANGUAGE_VERSION %tree_sitter_language_version' \ - lib/include/tree_sitter/api.h -grep -q '^#define TREE_SITTER_MIN_COMPATIBLE_LANGUAGE_VERSION %tree_sitter_min_compatible_language_version' \ - lib/include/tree_sitter/api.h - %files -n lib%{name} %license LICENSE %doc README.md -%dir %{_datadir}/tree-sitter -%dir %{_datadir}/tree-sitter/queries -%{_libdir}/libtree-sitter.so.%{tree_sitter_so_version}* +%{_libdir}/libtree-sitter.so.%{treesitter_so_version}* %files -n lib%{name}-devel %{_includedir}/tree_sitter