Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] workflows: fetch xbps for xlint
@ 2021-05-21 22:19 Chocimier
  2021-05-22  9:55 ` [PR PATCH] [Updated] " Chocimier
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Chocimier @ 2021-05-21 22:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 326 bytes --]

There is a new pull request by Chocimier against master on the void-packages repository

https://github.com/Chocimier/void-packages-org xlint-git
https://github.com/void-linux/void-packages/pull/31058

workflows: fetch xbps for xlint


A patch file from https://github.com/void-linux/void-packages/pull/31058.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xlint-git-31058.patch --]
[-- Type: text/x-diff, Size: 1640 bytes --]

From 34660c33d98668d288cd2b35917a851dad6cd365 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Sat, 22 May 2021 00:14:56 +0200
Subject: [PATCH] workflows: fetch xbps for xlint

---
 .github/workflows/build.yaml |  1 +
 common/travis/fetch-xbps.sh  | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)
 create mode 100755 common/travis/fetch-xbps.sh

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index eb96a151c599..5ca5de2244d4 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -19,6 +19,7 @@ jobs:
           fetch-depth: 200
       - run: common/travis/fetch_upstream.sh
       - run: common/travis/changed_templates.sh
+      - run: common/travis/fetch-xbps.sh
       - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
       # GitHub Action create a merge commit, ignore it
diff --git a/common/travis/fetch-xbps.sh b/common/travis/fetch-xbps.sh
new file mode 100755
index 000000000000..aac9bd980006
--- /dev/null
+++ b/common/travis/fetch-xbps.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# fetch-xbps.sh
+
+command -v xbps-uhelper >/dev/null && exit
+TAR=tar
+command -v bsdtar >/dev/null && TAR=bsdtar
+VERSION=0.59_5
+URL="https://alpha.de.repo.voidlinux.org/static/xbps-static-static-${VERSION}.x86_64-musl.tar.xz"
+FILE=${URL##*/}
+
+mkdir -p /tmp/bin
+
+/bin/echo -e '\x1b[32mInstalling xbps...\x1b[0m'
+if command -v wget >/dev/null; then
+	wget -q -O "$FILE" "$URL" || exit 1
+else
+	curl -s -o "$FILE" "$URL" || exit 1
+fi
+
+$TAR xf "$FILE" -C /tmp/bin --strip-components=3 || exit 1
+rm -r /tmp/bin/xbps

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PR PATCH] [Updated] workflows: fetch xbps for xlint
  2021-05-21 22:19 [PR PATCH] workflows: fetch xbps for xlint Chocimier
@ 2021-05-22  9:55 ` Chocimier
  2021-05-24 20:26 ` Chocimier
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Chocimier @ 2021-05-22  9:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 331 bytes --]

There is an updated pull request by Chocimier against master on the void-packages repository

https://github.com/Chocimier/void-packages-org xlint-git
https://github.com/void-linux/void-packages/pull/31058

workflows: fetch xbps for xlint


A patch file from https://github.com/void-linux/void-packages/pull/31058.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xlint-git-31058.patch --]
[-- Type: text/x-diff, Size: 1648 bytes --]

From 576c5839a330d60592be4865c10e0ed1f8935392 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Sat, 22 May 2021 00:14:56 +0200
Subject: [PATCH] workflows: fetch xbps for xlint

---
 .github/workflows/build.yaml |  1 +
 common/travis/fetch-xbps.sh  | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)
 create mode 100755 common/travis/fetch-xbps.sh

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index eb96a151c599..5ca5de2244d4 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -19,6 +19,7 @@ jobs:
           fetch-depth: 200
       - run: common/travis/fetch_upstream.sh
       - run: common/travis/changed_templates.sh
+      - run: common/travis/fetch-xbps.sh
       - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
       # GitHub Action create a merge commit, ignore it
diff --git a/common/travis/fetch-xbps.sh b/common/travis/fetch-xbps.sh
new file mode 100755
index 000000000000..5a4e458cf565
--- /dev/null
+++ b/common/travis/fetch-xbps.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# fetch-xbps.sh
+
+command -v xbps-uhelper >/dev/null && exit
+TAR=tar
+command -v bsdtar >/dev/null && TAR=bsdtar
+ARCH=$(uname -m)-musl
+VERSION=0.59_5
+URL="https://alpha.de.repo.voidlinux.org/static/xbps-static-static-${VERSION}.${ARCH}.tar.xz"
+FILE=${URL##*/}
+
+mkdir -p /tmp/bin
+
+/bin/echo -e '\x1b[32mInstalling xbps...\x1b[0m'
+if command -v wget >/dev/null; then
+	wget -q -O "$FILE" "$URL" || exit 1
+else
+	curl -s -o "$FILE" "$URL" || exit 1
+fi
+
+$TAR xf "$FILE" -C /tmp/bin --strip-components=3 ./usr/bin || exit 1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PR PATCH] [Updated] workflows: fetch xbps for xlint
  2021-05-21 22:19 [PR PATCH] workflows: fetch xbps for xlint Chocimier
  2021-05-22  9:55 ` [PR PATCH] [Updated] " Chocimier
@ 2021-05-24 20:26 ` Chocimier
  2021-05-24 20:37 ` common: add lint-version-change Duncaen
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Chocimier @ 2021-05-24 20:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 331 bytes --]

There is an updated pull request by Chocimier against master on the void-packages repository

https://github.com/Chocimier/void-packages-org xlint-git
https://github.com/void-linux/void-packages/pull/31058

workflows: fetch xbps for xlint


A patch file from https://github.com/void-linux/void-packages/pull/31058.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xlint-git-31058.patch --]
[-- Type: text/x-diff, Size: 5763 bytes --]

From 171c48e7fa74a8cbde1b7c75f89a4d04a8f1a6e3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Sat, 22 May 2021 00:14:56 +0200
Subject: [PATCH 1/3] workflows: fetch xbps for lint step

---
 .github/workflows/build.yaml |  1 +
 common/travis/fetch-xbps.sh  | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)
 create mode 100755 common/travis/fetch-xbps.sh

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index eb96a151c599..5ca5de2244d4 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -19,6 +19,7 @@ jobs:
           fetch-depth: 200
       - run: common/travis/fetch_upstream.sh
       - run: common/travis/changed_templates.sh
+      - run: common/travis/fetch-xbps.sh
       - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
       # GitHub Action create a merge commit, ignore it
diff --git a/common/travis/fetch-xbps.sh b/common/travis/fetch-xbps.sh
new file mode 100755
index 000000000000..5a4e458cf565
--- /dev/null
+++ b/common/travis/fetch-xbps.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# fetch-xbps.sh
+
+command -v xbps-uhelper >/dev/null && exit
+TAR=tar
+command -v bsdtar >/dev/null && TAR=bsdtar
+ARCH=$(uname -m)-musl
+VERSION=0.59_5
+URL="https://alpha.de.repo.voidlinux.org/static/xbps-static-static-${VERSION}.${ARCH}.tar.xz"
+FILE=${URL##*/}
+
+mkdir -p /tmp/bin
+
+/bin/echo -e '\x1b[32mInstalling xbps...\x1b[0m'
+if command -v wget >/dev/null; then
+	wget -q -O "$FILE" "$URL" || exit 1
+else
+	curl -s -o "$FILE" "$URL" || exit 1
+fi
+
+$TAR xf "$FILE" -C /tmp/bin --strip-components=3 ./usr/bin || exit 1

From 5979b462c414c6b9ec7a9d5f4df7c5b6cd8f48f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Mon, 24 May 2021 22:13:35 +0200
Subject: [PATCH 2/3] common/changed_templates.sh: store merge-base in file

---
 common/travis/changed_templates.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/common/travis/changed_templates.sh b/common/travis/changed_templates.sh
index 6b27ad8227fe..d36ac8c52a99 100755
--- a/common/travis/changed_templates.sh
+++ b/common/travis/changed_templates.sh
@@ -8,9 +8,11 @@ elif command -v git >/dev/null 2>&1; then
 	GIT_CMD=$(command -v git)
 fi
 
+printf '%s ' "$(git merge-base FETCH_HEAD HEAD)" HEAD  > /tmp/revisions
+
 /bin/echo -e '\x1b[32mChanged packages:\x1b[0m'
 $GIT_CMD diff-tree -r --no-renames --name-only --diff-filter=AM \
-	"$(git merge-base FETCH_HEAD HEAD)" HEAD \
+	$(cat /tmp/revisions) \
 	-- 'srcpkgs/*/template' |
 	cut -d/ -f 2 |
 	tee /tmp/templates |

From 508921bf8cd4bb217de0f2e8fa2c447a3474bb03 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Mon, 24 May 2021 22:18:54 +0200
Subject: [PATCH 3/3] common: add lint-version-change

---
 common/scripts/lint-version-change | 90 ++++++++++++++++++++++++++++++
 common/travis/xlint.sh             |  2 +
 2 files changed, 92 insertions(+)
 create mode 100755 common/scripts/lint-version-change

diff --git a/common/scripts/lint-version-change b/common/scripts/lint-version-change
new file mode 100755
index 000000000000..5e9687799384
--- /dev/null
+++ b/common/scripts/lint-version-change
@@ -0,0 +1,90 @@
+#!/bin/sh
+
+# when $3 is empty, template is read from working directory
+template="$1" base_rev="$2" tip_rev="$3"
+status=0
+
+die() {
+	printf '%s\n' "$*" >&2
+	exit 1
+}
+
+if ! [ "$base_rev" ]; then
+	die "usage: $0 TEMPLATE BASE-REVISION [TIP-REVISION]"
+fi
+
+if command -v chroot-git >/dev/null 2>&1; then
+	GIT_CMD=$(command -v chroot-git)
+elif command -v git >/dev/null 2>&1; then
+	GIT_CMD=$(command -v git)
+else
+	die "neither chroot-git nor git could be found"
+fi
+
+scan() {
+	rx="$1" msg="$2"
+	template_path=$template
+	if [ "$tip_rev" ]; then
+		template_path="${tip_rev}:${template}"
+		maybe_git="$GIT_CMD"
+		revspec="[^:]*:"
+	fi
+	$maybe_git grep -P -Hn -e "$rx" "$template_path" |
+		grep -v -P -e "[^:]*:[^:]*:\s*#" |
+		sed "s/^${revspec}\([^:]*:[^:]*:\)\(.*\)/\1 $msg/"
+}
+
+show_template() {
+	rev="$1"
+	if [ "$rev" ]; then
+		$GIT_CMD cat-file blob "${rev}:${template}" 2>/dev/null
+	else
+		cat "${template}" 2>/dev/null
+	fi
+}
+
+show_template_var() {
+	rev="$1" var="$2"
+	show_template "$rev" | grep -Po '^'${var}'=\K.*'
+}
+
+revision_reset() {
+	[ "${revision}" = 1 ] && return
+	if [ "$prev_version" ]; then
+		case "$prev_reverts" in
+			*"$version"_*) return
+		esac
+		action=update
+	else
+		action=creation
+	fi
+	scan "^revision=" "revision should be set to 1 on ${action}"
+	status=1
+}
+
+reverts_on_downgrade() {
+	[ "$version" ] || return
+	case "$reverts" in
+		*"$prev_version"_*) ;;
+		*)
+			scan "^version=" "missing reverts= for downgrade $prev_version to $version"
+			status=1
+	esac
+}
+
+version_change() {
+	version="$(show_template_var "$tip_rev" version)"
+	revision="$(show_template_var "$tip_rev" revision)"
+	reverts="$(show_template_var "$tip_rev" reverts)"
+	prev_version="$(show_template_var "$base_rev" version)"
+	prev_reverts="$(show_template_var "$base_rev" reverts)"
+	xbps-uhelper cmpver "$version" "$prev_version"
+	case "$?" in
+		1) revision_reset;;
+		-1|255) reverts_on_downgrade;;
+	esac
+}
+
+version_change
+
+exit $status
diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index 753d4a1fa51f..fc15d20a3fcf 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -5,8 +5,10 @@
 [ "$XLINT" ] || exit 0 
 
 EXITCODE=0
+read base tip < /tmp/revisions
 for t in $(awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates); do
 	/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
 	xlint "$t" || EXITCODE=$?
+	common/scripts/lint-version-change "$t" $base $tip || EXITCODE=$?
 done
 exit $EXITCODE

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: common: add lint-version-change
  2021-05-21 22:19 [PR PATCH] workflows: fetch xbps for xlint Chocimier
  2021-05-22  9:55 ` [PR PATCH] [Updated] " Chocimier
  2021-05-24 20:26 ` Chocimier
@ 2021-05-24 20:37 ` Duncaen
  2021-05-24 20:40 ` Chocimier
  2021-05-27 19:18 ` [PR PATCH] [Merged]: " Chocimier
  4 siblings, 0 replies; 6+ messages in thread
From: Duncaen @ 2021-05-24 20:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 216 bytes --]

New comment by Duncaen on void-packages repository

https://github.com/void-linux/void-packages/pull/31058#issuecomment-847318458

Comment:
I don't get why xbps needs to be fetched, isn't this a masterdir container?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: common: add lint-version-change
  2021-05-21 22:19 [PR PATCH] workflows: fetch xbps for xlint Chocimier
                   ` (2 preceding siblings ...)
  2021-05-24 20:37 ` common: add lint-version-change Duncaen
@ 2021-05-24 20:40 ` Chocimier
  2021-05-27 19:18 ` [PR PATCH] [Merged]: " Chocimier
  4 siblings, 0 replies; 6+ messages in thread
From: Chocimier @ 2021-05-24 20:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 256 bytes --]

New comment by Chocimier on void-packages repository

https://github.com/void-linux/void-packages/pull/31058#issuecomment-847320213

Comment:
xlint step do not use masterdir container, because fetching it takes significantly more time than linting proper.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PR PATCH] [Merged]: common: add lint-version-change
  2021-05-21 22:19 [PR PATCH] workflows: fetch xbps for xlint Chocimier
                   ` (3 preceding siblings ...)
  2021-05-24 20:40 ` Chocimier
@ 2021-05-27 19:18 ` Chocimier
  4 siblings, 0 replies; 6+ messages in thread
From: Chocimier @ 2021-05-27 19:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 165 bytes --]

There's a merged pull request on the void-packages repository

common: add lint-version-change
https://github.com/void-linux/void-packages/pull/31058

Description:


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-05-27 19:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-21 22:19 [PR PATCH] workflows: fetch xbps for xlint Chocimier
2021-05-22  9:55 ` [PR PATCH] [Updated] " Chocimier
2021-05-24 20:26 ` Chocimier
2021-05-24 20:37 ` common: add lint-version-change Duncaen
2021-05-24 20:40 ` Chocimier
2021-05-27 19:18 ` [PR PATCH] [Merged]: " Chocimier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).