Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [WIP} xbps-triggers: ensure operating in rootdir
@ 2020-12-18 22:40 Chocimier
  2020-12-19  2:43 ` ericonr
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Chocimier @ 2020-12-18 22:40 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Chocimier/void-packages-org xbps-triggers
https://github.com/void-linux/void-packages/pull/27265

[WIP} xbps-triggers: ensure operating in rootdir
Check others:
- [ ] binfmts
- [ ] gconf-schemas
- [ ] xml-catalog

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

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

From ffbf39d8ba292157e857ab4e87a8c342167bda82 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Fri, 18 Dec 2020 23:37:04 +0100
Subject: [PATCH] xbps-triggers: ensure operating in rootdir

---
 srcpkgs/xbps-triggers/files/gtk-icon-cache | 8 ++++----
 srcpkgs/xbps-triggers/files/pycompile      | 8 ++++----
 srcpkgs/xbps-triggers/template             | 2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/srcpkgs/xbps-triggers/files/gtk-icon-cache b/srcpkgs/xbps-triggers/files/gtk-icon-cache
index e905d9b1c1e..abff3281641 100755
--- a/srcpkgs/xbps-triggers/files/gtk-icon-cache
+++ b/srcpkgs/xbps-triggers/files/gtk-icon-cache
@@ -23,8 +23,8 @@ targets)
 run)
 	if [ "$TARGET" = "post-remove" -a "${PKGNAME}" = "gtk+" ]; then
 		for dir in ${gtk_iconcache_dirs}; do
-			if [ -f ${dir}/icon-theme.cache ]; then
-				rm -f ${dir}/icon-theme.cache
+			if [ -f .${dir}/icon-theme.cache ]; then
+				rm -f .${dir}/icon-theme.cache
 				echo -n "Removed GTK+ icon theme "
 				echo "cache for ${dir}."
 			fi
@@ -39,10 +39,10 @@ run)
 	case "$TARGET" in
 	post-*)
 		for dir in ${gtk_iconcache_dirs}; do
-			if [ -d "${dir}" ]; then
+			if [ -d ".${dir}" ]; then
 				echo -n "Updating GTK+ icon cache for "
 				echo "${dir}..."
-				${iconcache_bin} -q -f -t ${dir}
+				${iconcache_bin} -q -f -t .${dir}
 			fi
 		done
 		;;
diff --git a/srcpkgs/xbps-triggers/files/pycompile b/srcpkgs/xbps-triggers/files/pycompile
index 9d1da900b46..fb55a20024b 100755
--- a/srcpkgs/xbps-triggers/files/pycompile
+++ b/srcpkgs/xbps-triggers/files/pycompile
@@ -47,8 +47,8 @@ compile()
 {
 	for f in ${pycompile_dirs}; do
 		echo "Byte-compiling python code in ${f}..."
-		python${pycompile_version} -m compileall -f -q ${f} && \
-		python${pycompile_version} -O -m compileall -f -q ${f}
+		python${pycompile_version} -m compileall -f -q ./${f} && \
+		python${pycompile_version} -O -m compileall -f -q ./${f}
 	done
 	for f in ${pycompile_module}; do
 		echo "Byte-compiling python${pycompile_version} code for module ${f}..."
@@ -71,8 +71,8 @@ remove()
 {
 	for f in ${pycompile_dirs}; do
 		echo "Removing byte-compiled python${pycompile_version} files in ${f}..."
-		find ${f} -type f -name \*.py[co] -delete 2>&1 >/dev/null
-		find ${f} -type d -name __pycache__ -delete 2>&1 >/dev/null
+		find ./${f} -type f -name \*.py[co] -delete 2>&1 >/dev/null
+		find ./${f} -type d -name __pycache__ -delete 2>&1 >/dev/null
 	done
 	for f in ${pycompile_module}; do
 		echo "Removing byte-compiled python${pycompile_version} code for module ${f}..."
diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template
index 75010d6bee7..b649b5f0bfa 100644
--- a/srcpkgs/xbps-triggers/template
+++ b/srcpkgs/xbps-triggers/template
@@ -1,6 +1,6 @@
 # Template file for 'xbps-triggers'
 pkgname=xbps-triggers
-version=0.118
+version=0.119
 revision=1
 bootstrap=yes
 short_desc="XBPS triggers for Void Linux"

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

* Re: [WIP} xbps-triggers: ensure operating in rootdir
  2020-12-18 22:40 [PR PATCH] [WIP} xbps-triggers: ensure operating in rootdir Chocimier
@ 2020-12-19  2:43 ` ericonr
  2020-12-19 16:27 ` [PR REVIEW] " sgn
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ericonr @ 2020-12-19  2:43 UTC (permalink / raw)
  To: ml

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

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/27265#issuecomment-748407852

Comment:
Running the python hooks when installing on another dir at all feels quite wrong, tbh.

Besides that, looks good.

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

* Re: [PR REVIEW] [WIP} xbps-triggers: ensure operating in rootdir
  2020-12-18 22:40 [PR PATCH] [WIP} xbps-triggers: ensure operating in rootdir Chocimier
  2020-12-19  2:43 ` ericonr
@ 2020-12-19 16:27 ` sgn
  2020-12-19 17:31 ` Anachron
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: sgn @ 2020-12-19 16:27 UTC (permalink / raw)
  To: ml

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

New review comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/27265#discussion_r546256378

Comment:
Would it be better to use `./` instead of `.`?

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

* Re: [PR REVIEW] [WIP} xbps-triggers: ensure operating in rootdir
  2020-12-18 22:40 [PR PATCH] [WIP} xbps-triggers: ensure operating in rootdir Chocimier
  2020-12-19  2:43 ` ericonr
  2020-12-19 16:27 ` [PR REVIEW] " sgn
@ 2020-12-19 17:31 ` Anachron
  2020-12-19 17:33 ` ericonr
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Anachron @ 2020-12-19 17:31 UTC (permalink / raw)
  To: ml

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

New review comment by Anachron on void-packages repository

https://github.com/void-linux/void-packages/pull/27265#discussion_r546262601

Comment:
Why even bother with `./`?

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

* Re: [PR REVIEW] [WIP} xbps-triggers: ensure operating in rootdir
  2020-12-18 22:40 [PR PATCH] [WIP} xbps-triggers: ensure operating in rootdir Chocimier
                   ` (2 preceding siblings ...)
  2020-12-19 17:31 ` Anachron
@ 2020-12-19 17:33 ` ericonr
  2020-12-30 19:16 ` Chocimier
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ericonr @ 2020-12-19 17:33 UTC (permalink / raw)
  To: ml

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

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/27265#discussion_r546262813

Comment:
@sgn I believe these are always generated automatically, so we are sure that they will contain a leading slash.

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

* Re: [WIP} xbps-triggers: ensure operating in rootdir
  2020-12-18 22:40 [PR PATCH] [WIP} xbps-triggers: ensure operating in rootdir Chocimier
                   ` (3 preceding siblings ...)
  2020-12-19 17:33 ` ericonr
@ 2020-12-30 19:16 ` Chocimier
  2020-12-30 22:58 ` ericonr
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Chocimier @ 2020-12-30 19:16 UTC (permalink / raw)
  To: ml

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

New comment by Chocimier on void-packages repository

https://github.com/void-linux/void-packages/pull/27265#issuecomment-752729055

Comment:
@ericonr, why do you see it wrong to byte-compile?

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

* Re: [WIP} xbps-triggers: ensure operating in rootdir
  2020-12-18 22:40 [PR PATCH] [WIP} xbps-triggers: ensure operating in rootdir Chocimier
                   ` (4 preceding siblings ...)
  2020-12-30 19:16 ` Chocimier
@ 2020-12-30 22:58 ` ericonr
  2020-12-30 23:01 ` ericonr
  2021-01-11 22:47 ` Chocimier
  7 siblings, 0 replies; 9+ messages in thread
From: ericonr @ 2020-12-30 22:58 UTC (permalink / raw)
  To: ml

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

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/27265#issuecomment-752783275

Comment:
@Chocimier I dislike the idea of running binaries for an arch other than the current one; but I guess if you're doing that, you should be using `XBPS_TARGET_ARCH` instead of `ARCH`

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

* Re: [WIP} xbps-triggers: ensure operating in rootdir
  2020-12-18 22:40 [PR PATCH] [WIP} xbps-triggers: ensure operating in rootdir Chocimier
                   ` (5 preceding siblings ...)
  2020-12-30 22:58 ` ericonr
@ 2020-12-30 23:01 ` ericonr
  2021-01-11 22:47 ` Chocimier
  7 siblings, 0 replies; 9+ messages in thread
From: ericonr @ 2020-12-30 23:01 UTC (permalink / raw)
  To: ml

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

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/27265#issuecomment-752783275

Comment:
@Chocimier I dislike the idea of running binaries for an arch other than the current one; but I guess if you're doing that, you should be using `XBPS_TARGET_ARCH` instead of `ARCH`

It's an issue with running almost any hook at all, not only this specific one. So for the situation at hand I'd say it's ok.

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

* Re: [WIP} xbps-triggers: ensure operating in rootdir
  2020-12-18 22:40 [PR PATCH] [WIP} xbps-triggers: ensure operating in rootdir Chocimier
                   ` (6 preceding siblings ...)
  2020-12-30 23:01 ` ericonr
@ 2021-01-11 22:47 ` Chocimier
  7 siblings, 0 replies; 9+ messages in thread
From: Chocimier @ 2021-01-11 22:47 UTC (permalink / raw)
  To: ml

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

New comment by Chocimier on void-packages repository

https://github.com/void-linux/void-packages/pull/27265#issuecomment-758273280

Comment:
It is not only that triggers try to write to host root. Their executables are linked with dynamic libraries from host, eg. resulting in loud errors when installing other libc, and likely silent breakage when having outdated libraries in host.

Running triggers for alternative rootdir should be disabled at whole, I guess.

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

end of thread, other threads:[~2021-01-11 22:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-18 22:40 [PR PATCH] [WIP} xbps-triggers: ensure operating in rootdir Chocimier
2020-12-19  2:43 ` ericonr
2020-12-19 16:27 ` [PR REVIEW] " sgn
2020-12-19 17:31 ` Anachron
2020-12-19 17:33 ` ericonr
2020-12-30 19:16 ` Chocimier
2020-12-30 22:58 ` ericonr
2020-12-30 23:01 ` ericonr
2021-01-11 22:47 ` 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).