Skip to content

Commit

Permalink
scripts(bin/*): adapt commit mwssages to new guiselines
Browse files Browse the repository at this point in the history
  • Loading branch information
thunder-coding committed Oct 9, 2022
1 parent e596d14 commit 5d28887
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
16 changes: 10 additions & 6 deletions scripts/bin/revbump
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
## limitations under the License.
##

echo "WARNING: interface to this script has been changed. Run without any arguments to see the help message"

if [ "${#}" = "0" ]; then
echo
echo "Usage: revbump [package name] ..."
echo "Usage: revbump [reason for rebuild] [package names] ..."
echo
echo "Add or increment TERMUX_PKG_REVISION of package."
echo
Expand All @@ -31,11 +33,13 @@ if git status >/dev/null 2>&1; then
IS_GIT_REPOSITORY=true
fi

for package in "${@}"; do
for package in "${@:2}"; do
package="${package%%/}"
buildsh_path=
for repo in $(jq --raw-output 'keys | .[]' ${REPO_ROOT}/repo.json); do
_buildsh_path="${REPO_ROOT}/${repo}/${package}/build.sh"
repo=
for repo_path in $(jq --raw-output 'keys | .[]' ${REPO_ROOT}/repo.json); do
_buildsh_path="${REPO_ROOT}/${repo_path}/${package}/build.sh"
repo=$(jq --raw-output ".[\"${repo_path}\"].repo" ${REPO_ROOT}/repo.json)
echo $_buildsh_path

if [ -f "${_buildsh_path}" ]; then
Expand Down Expand Up @@ -76,13 +80,13 @@ for package in "${@}"; do
git --no-pager diff --patch "${buildsh_path}"
echo "--------------------"
echo
echo "${package}: bump revision"
echo "rebuild(${repo}/${package}): $1"
echo
read -re -p "Do you want to commit these changes ? (y/n) " CHOICE
echo
if [[ ${CHOICE} =~ (Y|y) ]]; then
git add "${buildsh_path}"
git commit -m "${package}: bump revision"
git commit -m "rebuild(${repo}/${package}): $1"
else
echo "Not committing to Git!"
fi
Expand Down
7 changes: 5 additions & 2 deletions scripts/bin/update-checksum
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@ fi

for package in "${@}"; do
buildsh_path=
repo=
if [ -d "${package}" ] && [ -f "${package}/build.sh" ]; then
buildsh_path="${package}/build.sh"
package=$(basename ${package})
else
for repo_path in $(jq --raw-output 'keys | .[]' $REPO_ROOT/repo.json); do
if [ -d "${repo_path}/${package}" ] && [ -f "${repo_path}/${package}/build.sh" ]; then
repo=$(jq --raw-output '.["'$repo_path'"].name' $REPO_ROOT/repo.json)
repo=${repo#"termux-"}
buildsh_path="${repo_path}/${package}/build.sh"
package=$(basename ${package})
fi
Expand Down Expand Up @@ -90,13 +93,13 @@ for package in "${@}"; do
git --no-pager diff --patch "${buildsh_path}"
echo "--------------------"
echo
echo "${package}: update to $(. "${buildsh_path}"; echo "${TERMUX_PKG_VERSION}" | cut -d: -f2-)"
echo "upgpkg(${repo}/${package}): update to $(. "${buildsh_path}"; echo "${TERMUX_PKG_VERSION}" | cut -d: -f2-)"
echo
read -re -p "Do you want to commit changes ? (y/n) " CHOICE
echo
if [[ ${CHOICE} =~ (Y|y) ]]; then
git add "${buildsh_path}"
git commit -m "${package}: update to $(. "${buildsh_path}"; echo "${TERMUX_PKG_VERSION}" | cut -d: -f2-)"
git commit -m "upgpkg(${repo}/${package}): update to $(. "${buildsh_path}"; echo "${TERMUX_PKG_VERSION}" | cut -d: -f2-)"
else
echo "Not committing to Git!"
fi
Expand Down
3 changes: 2 additions & 1 deletion scripts/updates/utils/termux_pkg_upgrade_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,13 @@ termux_pkg_upgrade_version() {
fi

echo "INFO: Trying to build package."
repo=$(jq --raw-output $(basename $(dirname ${TERMUX_SCRIPTDIR}/*packages/${TERMUX_PKG_NAME})) ${TERMUX_SCRIPTDIR}/repo.json)
if "${TERMUX_SCRIPTDIR}/scripts/run-docker.sh" ./build-package.sh -a "${TERMUX_ARCH}" -I "${TERMUX_PKG_NAME}"; then
if [[ "${GIT_COMMIT_PACKAGES}" == "true" ]]; then
echo "INFO: Committing package."
stderr="$(
git add "${TERMUX_PKG_BUILDER_DIR}" 2>&1 >/dev/null
git commit -m "${TERMUX_PKG_NAME}: update to ${LATEST_VERSION}" \
git commit -m "upgpkg(${repo}/${TERMUX_PKG_NAME}): update to ${LATEST_VERSION}" \
-m "This commit has been automatically submitted by Github Actions." 2>&1 >/dev/null
)" || {
termux_error_exit <<-EndOfError
Expand Down

0 comments on commit 5d28887

Please sign in to comment.