Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] alacritty, st, dvtm: prevent ncurses-term from installing conflicting files
@ 2020-11-25 16:00 ahesford
  2020-11-25 16:03 ` ericonr
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: ahesford @ 2020-11-25 16:00 UTC (permalink / raw)
  To: ml

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

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

https://github.com/ahesford/void-packages terminfo
https://github.com/void-linux/void-packages/pull/26701

alacritty, st, dvtm: prevent ncurses-term from installing conflicting files
This is an attempt to address file conflicts in Issue #26700 by adding `noextract` rules to packages that install specific terminfo definitions and then compile these at locations that conflict with files installed by `ncurses-term`. We should definitely prefer these specific versions when they are installed.

I'm not sure what `xbps<0.58` does when it encounters `noextract` definitions. This isn't the most elegant solution, but it may be the only workable solution we currently have to the conflicts here. Any other solution would seem to require knowledge in the `ncurses` template of specific templates that install conflicting files, which is uglier.

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

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

From 14d58a6fad84737d07530523322dccb870385278 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Wed, 25 Nov 2020 10:36:30 -0500
Subject: [PATCH 1/3] alacritty: prevent ncurses-term from extracting
 conflicting files

---
 srcpkgs/alacritty/template | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/alacritty/template b/srcpkgs/alacritty/template
index 86626f44080..4bca24d0dc9 100644
--- a/srcpkgs/alacritty/template
+++ b/srcpkgs/alacritty/template
@@ -1,7 +1,7 @@
 # Template file for 'alacritty'
 pkgname=alacritty
 version=0.5.0
-revision=2
+revision=3
 build_wrksrc="${pkgname}"
 build_style=cargo
 hostmakedepends="pkg-config python3"
@@ -28,7 +28,18 @@ post_install() {
 
 alacritty-terminfo_package() {
 	short_desc+=" - terminfo data"
+	depends="ncurses"
+
 	pkg_install() {
 		vmove usr/share/terminfo
+
+		# Avoid conflicts with ncurses-term
+		vmkdir usr/share/xbps.d
+		local _conflicts="${PKGDESTDIR}/usr/share/xbps.d/${pkgname}.conf"
+		cat > "$_conflicts" <<-EOF
+		noextract=/usr/share/terminfo/a/alacritty
+		noextract=/usr/share/terminfo/a/alacritty-direct
+		EOF
+		chmod 644 "$_conflicts"
 	}
 }

From 66f9591cf756e7092fe7b3658474aef573a3a3da Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Wed, 25 Nov 2020 10:36:30 -0500
Subject: [PATCH 2/3] st: prevent ncurses-term from extracting conflicting
 files

---
 srcpkgs/st/template | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/st/template b/srcpkgs/st/template
index 0041346d2b8..a20b44b548b 100644
--- a/srcpkgs/st/template
+++ b/srcpkgs/st/template
@@ -1,7 +1,7 @@
 # Template file for 'st'
 pkgname=st
 version=0.8.4
-revision=2
+revision=3
 build_style=gnu-makefile
 make_use_env=compliant
 hostmakedepends="pkg-config"
@@ -29,7 +29,20 @@ post_install() {
 
 st-terminfo_package() {
 	short_desc+=" - terminfo data"
+	depends="ncurses"
+
 	pkg_install() {
 		vmove usr/share/terminfo
+
+		# Avoid conflicts with ncurses-term
+		vmkdir usr/share/xbps.d
+		local _conflicts="${PKGDESTDIR}/usr/share/xbps.d/${pkgname}.conf"
+		cat > "$_conflicts" >> EOF
+		noextract=/usr/share/terminfo/s/st
+		noextract=/usr/share/terminfo/s/st-256color
+		noextract=/usr/share/terminfo/s/stterm
+		noextract=/usr/share/terminfo/s/stterm-256color
+		EOF
+		chmod 644 "$_conflicts"
 	}
 }

From acd084516a784251c380083f701ca8437c171da5 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Wed, 25 Nov 2020 10:36:30 -0500
Subject: [PATCH 3/3] dvtm: prevent ncurses-term from extracting conflicting
 files

Fixes: #26700.
---
 srcpkgs/dvtm/template | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/dvtm/template b/srcpkgs/dvtm/template
index a65c17c2d9c..b2e2ee7538d 100644
--- a/srcpkgs/dvtm/template
+++ b/srcpkgs/dvtm/template
@@ -1,7 +1,7 @@
 # Template file for 'dvtm'
 pkgname=dvtm
 version=0.15
-revision=2
+revision=3
 makedepends="ncurses-devel"
 depends="ncurses" # needs tic at post-install
 short_desc="Tiling window manager for the console"
@@ -16,8 +16,18 @@ do_build() {
 	sed -i 's,tic,/bin/true,g' Makefile
 	make CC=$CC V=1
 }
+
 do_install() {
 	make PREFIX=/usr DESTDIR=${DESTDIR} install
 	vlicense LICENSE
 	vinstall dvtm.info 644 usr/share/terminfo/d
+
+	# Avoid conflicts with ncurses-term
+	vmkdir usr/share/xbps.d
+	local _conflicts="${DESTDIR}/usr/share/xbps.d/${pkgname}.conf"
+	cat > "$_conflicts" <<-EOF
+	noextract=/usr/share/terminfo/d/dvtm
+	noextract=/usr/share/terminfo/d/dvtm-256color
+	EOF
+	chmod 644 "$_conflicts"
 }

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

* Re: alacritty, st, dvtm: prevent ncurses-term from installing conflicting files
  2020-11-25 16:00 [PR PATCH] alacritty, st, dvtm: prevent ncurses-term from installing conflicting files ahesford
@ 2020-11-25 16:03 ` ericonr
  2020-11-25 16:04 ` ericonr
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ericonr @ 2020-11-25 16:03 UTC (permalink / raw)
  To: ml

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

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/26701#issuecomment-733798023

Comment:
I think I'd prefer to have a `v<whatever>` helper to install these files. That said, I'm not sure this prevents conflicts when `xbps-install -f ncurses-term alacritty` is run, does it?

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

* Re: alacritty, st, dvtm: prevent ncurses-term from installing conflicting files
  2020-11-25 16:00 [PR PATCH] alacritty, st, dvtm: prevent ncurses-term from installing conflicting files ahesford
  2020-11-25 16:03 ` ericonr
@ 2020-11-25 16:04 ` ericonr
  2020-11-25 16:08 ` [PR PATCH] [Updated] " ahesford
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ericonr @ 2020-11-25 16:04 UTC (permalink / raw)
  To: ml

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

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/26701#issuecomment-733798023

Comment:
I think I'd prefer to have a `v<whatever>` helper to install these files. That said, I'm not sure this prevents conflicts when `xbps-install -f ncurses-term alacritty` is run, does it?

Also, you can avoid `vmkdir` by piping into a file in the builddir and `vinstall`ing it, which I also prefer.

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

* Re: [PR PATCH] [Updated] alacritty, st, dvtm: prevent ncurses-term from installing conflicting files
  2020-11-25 16:00 [PR PATCH] alacritty, st, dvtm: prevent ncurses-term from installing conflicting files ahesford
  2020-11-25 16:03 ` ericonr
  2020-11-25 16:04 ` ericonr
@ 2020-11-25 16:08 ` ahesford
  2020-11-25 16:13 ` ahesford
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ahesford @ 2020-11-25 16:08 UTC (permalink / raw)
  To: ml

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

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

https://github.com/ahesford/void-packages terminfo
https://github.com/void-linux/void-packages/pull/26701

alacritty, st, dvtm: prevent ncurses-term from installing conflicting files
This is an attempt to address file conflicts in Issue #26700 by adding `noextract` rules to packages that install specific terminfo definitions and then compile these at locations that conflict with files installed by `ncurses-term`. We should definitely prefer these specific versions when they are installed.

I'm not sure what `xbps<0.58` does when it encounters `noextract` definitions. This isn't the most elegant solution, but it may be the only workable solution we currently have to the conflicts here. Any other solution would seem to require knowledge in the `ncurses` template of specific templates that install conflicting files, which is uglier.

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

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

From 14d58a6fad84737d07530523322dccb870385278 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Wed, 25 Nov 2020 10:36:30 -0500
Subject: [PATCH 1/3] alacritty: prevent ncurses-term from extracting
 conflicting files

---
 srcpkgs/alacritty/template | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/alacritty/template b/srcpkgs/alacritty/template
index 86626f44080..4bca24d0dc9 100644
--- a/srcpkgs/alacritty/template
+++ b/srcpkgs/alacritty/template
@@ -1,7 +1,7 @@
 # Template file for 'alacritty'
 pkgname=alacritty
 version=0.5.0
-revision=2
+revision=3
 build_wrksrc="${pkgname}"
 build_style=cargo
 hostmakedepends="pkg-config python3"
@@ -28,7 +28,18 @@ post_install() {
 
 alacritty-terminfo_package() {
 	short_desc+=" - terminfo data"
+	depends="ncurses"
+
 	pkg_install() {
 		vmove usr/share/terminfo
+
+		# Avoid conflicts with ncurses-term
+		vmkdir usr/share/xbps.d
+		local _conflicts="${PKGDESTDIR}/usr/share/xbps.d/${pkgname}.conf"
+		cat > "$_conflicts" <<-EOF
+		noextract=/usr/share/terminfo/a/alacritty
+		noextract=/usr/share/terminfo/a/alacritty-direct
+		EOF
+		chmod 644 "$_conflicts"
 	}
 }

From 6812c687103c7cee4933393bbefadd2476c87b6f Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Wed, 25 Nov 2020 10:36:30 -0500
Subject: [PATCH 2/3] st: prevent ncurses-term from extracting conflicting
 files

---
 srcpkgs/st/template | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/st/template b/srcpkgs/st/template
index 0041346d2b8..4355b1ccb89 100644
--- a/srcpkgs/st/template
+++ b/srcpkgs/st/template
@@ -1,7 +1,7 @@
 # Template file for 'st'
 pkgname=st
 version=0.8.4
-revision=2
+revision=3
 build_style=gnu-makefile
 make_use_env=compliant
 hostmakedepends="pkg-config"
@@ -29,7 +29,20 @@ post_install() {
 
 st-terminfo_package() {
 	short_desc+=" - terminfo data"
+	depends="ncurses"
+
 	pkg_install() {
 		vmove usr/share/terminfo
+
+		# Avoid conflicts with ncurses-term
+		vmkdir usr/share/xbps.d
+		local _conflicts="${PKGDESTDIR}/usr/share/xbps.d/${pkgname}.conf"
+		cat > "$_conflicts" <<-EOF
+		noextract=/usr/share/terminfo/s/st
+		noextract=/usr/share/terminfo/s/st-256color
+		noextract=/usr/share/terminfo/s/stterm
+		noextract=/usr/share/terminfo/s/stterm-256color
+		EOF
+		chmod 644 "$_conflicts"
 	}
 }

From 8365f130f63a119f19167414aaa63f906d87e812 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Wed, 25 Nov 2020 10:36:30 -0500
Subject: [PATCH 3/3] dvtm: prevent ncurses-term from extracting conflicting
 files

Fixes: #26700.
---
 srcpkgs/dvtm/template | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/dvtm/template b/srcpkgs/dvtm/template
index a65c17c2d9c..b2e2ee7538d 100644
--- a/srcpkgs/dvtm/template
+++ b/srcpkgs/dvtm/template
@@ -1,7 +1,7 @@
 # Template file for 'dvtm'
 pkgname=dvtm
 version=0.15
-revision=2
+revision=3
 makedepends="ncurses-devel"
 depends="ncurses" # needs tic at post-install
 short_desc="Tiling window manager for the console"
@@ -16,8 +16,18 @@ do_build() {
 	sed -i 's,tic,/bin/true,g' Makefile
 	make CC=$CC V=1
 }
+
 do_install() {
 	make PREFIX=/usr DESTDIR=${DESTDIR} install
 	vlicense LICENSE
 	vinstall dvtm.info 644 usr/share/terminfo/d
+
+	# Avoid conflicts with ncurses-term
+	vmkdir usr/share/xbps.d
+	local _conflicts="${DESTDIR}/usr/share/xbps.d/${pkgname}.conf"
+	cat > "$_conflicts" <<-EOF
+	noextract=/usr/share/terminfo/d/dvtm
+	noextract=/usr/share/terminfo/d/dvtm-256color
+	EOF
+	chmod 644 "$_conflicts"
 }

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

* Re: alacritty, st, dvtm: prevent ncurses-term from installing conflicting files
  2020-11-25 16:00 [PR PATCH] alacritty, st, dvtm: prevent ncurses-term from installing conflicting files ahesford
                   ` (2 preceding siblings ...)
  2020-11-25 16:08 ` [PR PATCH] [Updated] " ahesford
@ 2020-11-25 16:13 ` ahesford
  2020-11-25 16:56 ` ericonr
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ahesford @ 2020-11-25 16:13 UTC (permalink / raw)
  To: ml

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

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/26701#issuecomment-733803669

Comment:
Right, this won't prevent `ncurses-term` from installing those files in advance or simultaneously, and `xbps-pkgdb -a` will still complain after the fact if `ncurses-term` is installed before the rules take effect. At least this prevents reinstallation or upgrades of `ncurses-term` from overwriting the files, and I believe `xbps-remove ncurses-term` will leave the changed files in place.

Of course, because XBPS extracts packages in lexicographic order, `xbps-install alacritty-terminfo ncurses-term` and `xbps-install dvtm ncurses-term` will cause the `ncurses-term` versions to overwrite the specific versions the first time, while `xbps-install st-terminfo ncurses-term` will behave "correctly".

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

* Re: alacritty, st, dvtm: prevent ncurses-term from installing conflicting files
  2020-11-25 16:00 [PR PATCH] alacritty, st, dvtm: prevent ncurses-term from installing conflicting files ahesford
                   ` (3 preceding siblings ...)
  2020-11-25 16:13 ` ahesford
@ 2020-11-25 16:56 ` ericonr
  2020-12-09 21:09 ` ahesford
  2020-12-09 21:09 ` [PR PATCH] [Closed]: " ahesford
  6 siblings, 0 replies; 8+ messages in thread
From: ericonr @ 2020-11-25 16:56 UTC (permalink / raw)
  To: ml

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

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/26701#issuecomment-733828753

Comment:
This feels like hacking around XBPS too much for me to comfortable with :/ 

That said, if others support this move, I'd say it makes more sense for these files to be in `${FILESDIR}`. There's no need to create them in the template when we have `files/` at our disposal.

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

* Re: alacritty, st, dvtm: prevent ncurses-term from installing conflicting files
  2020-11-25 16:00 [PR PATCH] alacritty, st, dvtm: prevent ncurses-term from installing conflicting files ahesford
                   ` (4 preceding siblings ...)
  2020-11-25 16:56 ` ericonr
@ 2020-12-09 21:09 ` ahesford
  2020-12-09 21:09 ` [PR PATCH] [Closed]: " ahesford
  6 siblings, 0 replies; 8+ messages in thread
From: ahesford @ 2020-12-09 21:09 UTC (permalink / raw)
  To: ml

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

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/26701#issuecomment-742054999

Comment:
This isn't really a proper solution to the problem, and I've already propagated my own `noextract` rules to wherever I need them, so I don't really care about the conflicts I no longer see.

The right solution is to decide on who gets to claim ownership of the conflicts, then just make sure only one package actually provides them. Following other distributions and letting `ncurses-term` own everything (*i.e.*, getting rid of the per-emulator terminfo files) is probably the cleanest solution.

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

* Re: [PR PATCH] [Closed]: alacritty, st, dvtm: prevent ncurses-term from installing conflicting files
  2020-11-25 16:00 [PR PATCH] alacritty, st, dvtm: prevent ncurses-term from installing conflicting files ahesford
                   ` (5 preceding siblings ...)
  2020-12-09 21:09 ` ahesford
@ 2020-12-09 21:09 ` ahesford
  6 siblings, 0 replies; 8+ messages in thread
From: ahesford @ 2020-12-09 21:09 UTC (permalink / raw)
  To: ml

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

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

alacritty, st, dvtm: prevent ncurses-term from installing conflicting files
https://github.com/void-linux/void-packages/pull/26701

Description:
This is an attempt to address file conflicts in Issue #26700 by adding `noextract` rules to packages that install specific terminfo definitions and then compile these at locations that conflict with files installed by `ncurses-term`. We should definitely prefer these specific versions when they are installed.

I'm not sure what `xbps<0.58` does when it encounters `noextract` definitions. This isn't the most elegant solution, but it may be the only workable solution we currently have to the conflicts here. Any other solution would seem to require knowledge in the `ncurses` template of specific templates that install conflicting files, which is uglier.

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

end of thread, other threads:[~2020-12-09 21:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-25 16:00 [PR PATCH] alacritty, st, dvtm: prevent ncurses-term from installing conflicting files ahesford
2020-11-25 16:03 ` ericonr
2020-11-25 16:04 ` ericonr
2020-11-25 16:08 ` [PR PATCH] [Updated] " ahesford
2020-11-25 16:13 ` ahesford
2020-11-25 16:56 ` ericonr
2020-12-09 21:09 ` ahesford
2020-12-09 21:09 ` [PR PATCH] [Closed]: " ahesford

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).