diff mbox series

[isar-cip-core,v2] scripts: Add automated recipe updates for LTP

Message ID 1741312315-25979-1-git-send-email-nobuhiro1.iwamatsu@toshiba.co.jp (mailing list archive)
State New
Headers show
Series [isar-cip-core,v2] scripts: Add automated recipe updates for LTP | expand

Commit Message

Nobuhiro Iwamatsu March 7, 2025, 1:51 a.m. UTC
Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>

---

v2:
  - Update with shellcheck

 scripts/update-ltp.sh | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100755 scripts/update-ltp.sh

Comments

Jan Kiszka March 7, 2025, 7:14 a.m. UTC | #1
On 07.03.25 02:51, Nobuhiro Iwamatsu wrote:
> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
> 
> ---
> 
> v2:
>   - Update with shellcheck
> 
>  scripts/update-ltp.sh | 29 +++++++++++++++++++++++++++++
>  1 file changed, 29 insertions(+)
>  create mode 100755 scripts/update-ltp.sh
> 
> diff --git a/scripts/update-ltp.sh b/scripts/update-ltp.sh
> new file mode 100755
> index 0000000..dc8b947
> --- /dev/null
> +++ b/scripts/update-ltp.sh
> @@ -0,0 +1,29 @@
> +#!/bin/bash
> +
> +REPO_ROOT=$(git rev-parse --show-toplevel)
> +pushd "${REPO_ROOT}"/recipes-core/ltp > /dev/null || exit
> +
> +LATEST_VER=$(git ls-remote --refs --tags  https://github.com/linux-test-project/ltp.git | \
> +	cut --delimiter='/' --fields=3 | \
> +	sort --version-sort | tail --lines=1)
> +
> +SHA256FILE="ltp-full-${LATEST_VER}.tar.xz.sha256"
> +rm -rf "${SHA256FILE}"
> +
> +wget -q "https://github.com/linux-test-project/ltp/releases/download/${LATEST_VER}/${SHA256FILE}"
> +
> +SHA256SUM=$(cut -f 1 -d " " "${SHA256FILE}")
> +RECIPE="ltp-full_${LATEST_VER}.bb"
> +
> +if [ ! -f "${RECIPE}" ]; then
> +	git mv ltp-full*.bb "${RECIPE}"
> +
> +	sed -i 's/\(SRC_URI\[sha256sum\] = "\).*/\1'"${SHA256SUM}"'"'/ "${RECIPE}"
> +	git add "${RECIPE}"
> +
> +	git commit -asm "recipes-core: ltp: Update to ${LATEST_VER}"
> +fi
> +
> +rm -rf "${SHA256FILE}"
> +
> +popd > /dev/null || exit

Thanks, applied.

Jan
diff mbox series

Patch

diff --git a/scripts/update-ltp.sh b/scripts/update-ltp.sh
new file mode 100755
index 0000000..dc8b947
--- /dev/null
+++ b/scripts/update-ltp.sh
@@ -0,0 +1,29 @@ 
+#!/bin/bash
+
+REPO_ROOT=$(git rev-parse --show-toplevel)
+pushd "${REPO_ROOT}"/recipes-core/ltp > /dev/null || exit
+
+LATEST_VER=$(git ls-remote --refs --tags  https://github.com/linux-test-project/ltp.git | \
+	cut --delimiter='/' --fields=3 | \
+	sort --version-sort | tail --lines=1)
+
+SHA256FILE="ltp-full-${LATEST_VER}.tar.xz.sha256"
+rm -rf "${SHA256FILE}"
+
+wget -q "https://github.com/linux-test-project/ltp/releases/download/${LATEST_VER}/${SHA256FILE}"
+
+SHA256SUM=$(cut -f 1 -d " " "${SHA256FILE}")
+RECIPE="ltp-full_${LATEST_VER}.bb"
+
+if [ ! -f "${RECIPE}" ]; then
+	git mv ltp-full*.bb "${RECIPE}"
+
+	sed -i 's/\(SRC_URI\[sha256sum\] = "\).*/\1'"${SHA256SUM}"'"'/ "${RECIPE}"
+	git add "${RECIPE}"
+
+	git commit -asm "recipes-core: ltp: Update to ${LATEST_VER}"
+fi
+
+rm -rf "${SHA256FILE}"
+
+popd > /dev/null || exit