From f4cb798e84851f3337b39c12755be10e4e8d3bd6 Mon Sep 17 00:00:00 2001 From: Ronny Berndt Date: Tue, 26 Mar 2024 08:10:45 +0100 Subject: [PATCH] Remove unused build files (#5019) Breaking up is never easy, we know, but they have to go. --- Makefile | 6 ---- Makefile.win | 6 ---- build-aux/dist-error | 28 ---------------- build-aux/introspect | 73 ------------------------------------------ build-aux/sphinx-build | 34 -------------------- build-aux/sphinx-touch | 24 -------------- 6 files changed, 171 deletions(-) delete mode 100755 build-aux/dist-error delete mode 100755 build-aux/introspect delete mode 100755 build-aux/sphinx-build delete mode 100755 build-aux/sphinx-touch diff --git a/Makefile b/Makefile index 85cea61e7e8..8995faed917 100644 --- a/Makefile +++ b/Makefile @@ -375,12 +375,6 @@ xref: @./build-aux/xref-helper.sh $(REBAR) $(DIALYZE_OPTS) -.PHONY: introspect -# target: introspect - Check for commits difference between rebar.config and repository -introspect: - @$(REBAR) -r update-deps - @build-aux/introspect - ################################################################################ # Distributing ################################################################################ diff --git a/Makefile.win b/Makefile.win index 240a00b5cf8..05f8a157276 100644 --- a/Makefile.win +++ b/Makefile.win @@ -336,12 +336,6 @@ dialyze: .rebar xref: @$(REBAR) --keep-going --recursive xref $(DIALYZE_OPTS) -.PHONY: introspect -# target: introspect - Check for commits difference between rebar.config and repository -introspect: - @$(REBAR) -r update-deps - @escript build-aux\introspect - ################################################################################ # Distributing diff --git a/build-aux/dist-error b/build-aux/dist-error deleted file mode 100755 index 73486b5dbde..00000000000 --- a/build-aux/dist-error +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -e - -# Licensed under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -# This script is called by the build system and is used to provide an error -# about missing or empty files. Some files are optional, and will be built when -# the environment allows. But these files are required for distribution. - -cat << EOF -ERROR: This file is missing or incomplete: - - $1 - - This file is optional at build and install time, - but is required when preparing a distribution. -EOF - -exit 1 diff --git a/build-aux/introspect b/build-aux/introspect deleted file mode 100755 index 9b527455f09..00000000000 --- a/build-aux/introspect +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env escript -%% -*- mode: erlang -*- - -main(_) -> - introspect("rebar.config.script"). - -introspect(File) -> - Bindings = [{'SCRIPT', File}, {'CONFIG', []}], - {ok, Config} = file:script(File, Bindings), - {deps, Deps} = lists:keyfind(deps, 1, Config), - introspect_deps(Deps). - -introspect_deps([]) -> - ok; -introspect_deps([Dep | Rest]) -> - introspect_dep(Dep), - introspect_deps(Rest). - -introspect_dep({App, VsnRegex, {git, Url, From}, _Raw}) -> - introspect_dep({App, VsnRegex, {git, Url, From}}); -introspect_dep({App, _VsnRegex, {git, _Url, From}}) -> - io:format(bold("~s~n"), [App]), - introspect_diff(App, From), - io:format("~n", []), - ok. - -revision({branch, Branch}) -> - Branch; -revision({tag, Tag}) -> - Tag; -revision(Rev) -> - Rev. - -introspect_diff(App, From) -> - introspect_diff(App, revision(From), "origin/master"). - -introspect_diff(App, From, ToBranch) -> - {ok, Log} = sh(App, io_lib:format("git log --pretty=oneline ~s..~s", [From, ToBranch])), - case Log of - [] -> - io:format(" up to date on ~s~n", [bold(ToBranch)]); - _ -> - io:format(" ~B commits behind ~s~n", [length(Log), bold(ToBranch)]), - io:format("~s~n~n", [string:join([" " ++ L || L <- Log], "\n")]) - end. - -sh(App, Cmd) -> - Dir = lists:flatten(["src/", atom_to_list(App)]), - Port = open_port({spawn, lists:flatten(Cmd)}, - [{cd, Dir}, - {line, 16384}, - exit_status, - stderr_to_stdout, - use_stdio]), - read_port(Port). - -read_port(Port) -> - read_port(Port, []). - -read_port(Port, Acc) -> - receive - {Port, {data, {eol, Line}}} -> - read_port(Port, [Line | Acc]); - {Port, {data, {noeol, Line}}} -> - read_port(Port, [Line | Acc]); - {Port, {exit_status, 0}} -> - {ok, lists:reverse(Acc)}; - {Port, {exit_status, Code}} -> - {error, Code, Acc} - end. - -bold(Text) -> - "\e[1m" ++ Text ++ "\e[0m". diff --git a/build-aux/sphinx-build b/build-aux/sphinx-build deleted file mode 100755 index 8ecf43a551e..00000000000 --- a/build-aux/sphinx-build +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -e - -# Licensed under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -# This script is called by the build system and is used to call sphinx-build if -# is is available, or alternatively, emit a warning, and perform a no-op. Any -# required directories or Makefiles are created and stubbed out as appropriate. - -if test -z "`which sphinx-build`"; then - missing=yes - cat << EOF -WARNING: 'sphinx-build' is needed, and is missing on your system. - You might have modified some files without having the - proper tools for further handling them. -EOF -fi - -if test "$2" = "html"; then - if test "$missing" != "yes"; then - sphinx-build $* - else - mkdir -p html - fi -fi diff --git a/build-aux/sphinx-touch b/build-aux/sphinx-touch deleted file mode 100755 index ed7217de252..00000000000 --- a/build-aux/sphinx-touch +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -e - -# Licensed under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. - -# This script is called by the build system and is used to touch the list of -# expected output files when sphinx-build is not available. If the files exist, -# this will satisfy make. If they do not exist, we create of empty files. - -if test -z "`which sphinx-build`"; then - for file in $*; do - mkdir -p `dirname $file` - touch $file - done -fi \ No newline at end of file