Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [RFC]: xbps-src: add vrm function
@ 2022-04-07 19:10 paper42
  2022-04-07 19:18 ` [PR REVIEW] " subnut
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: paper42 @ 2022-04-07 19:10 UTC (permalink / raw)
  To: ml

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

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

https://github.com/paper42/void-packages xbps-src-vrm
https://github.com/void-linux/void-packages/pull/36562

[RFC]: xbps-src: add vrm function
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


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

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

From b7d184d8c08f51bdf046506fe8f95cecd295fe83 Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Thu, 7 Apr 2022 20:02:37 +0200
Subject: [PATCH] xbps-src: add vrm function

---
 Manual.md                       |  5 +++++
 common/environment/setup/vrm.sh | 34 +++++++++++++++++++++++++++++++++
 xbps-src                        |  2 +-
 3 files changed, 40 insertions(+), 1 deletion(-)
 create mode 100644 common/environment/setup/vrm.sh

diff --git a/Manual.md b/Manual.md
index 8ec755499bbe..ae3cb5a8c7ca 100644
--- a/Manual.md
+++ b/Manual.md
@@ -362,6 +362,11 @@ The following functions are defined by `xbps-src` and can be used on any templat
 	it will default to `pkgname`. The `shell` argument can be one of `bash`,
 	`fish` or `zsh`.
 
+- *vrm()* `vrm [-r] <file...>`
+
+	Wrapper around rm that checks if the file exists and prints a warning if it
+    doesn't.
+
 > Shell wildcards must be properly quoted, Example: `vmove "usr/lib/*.a"`.
 
 <a id="global_vars"></a>
diff --git a/common/environment/setup/vrm.sh b/common/environment/setup/vrm.sh
new file mode 100644
index 000000000000..4c5971b8645d
--- /dev/null
+++ b/common/environment/setup/vrm.sh
@@ -0,0 +1,34 @@
+# Helper function for calling rm on files and prints a warning if the
+# file doesn't exist.
+
+vrm() {
+	local ARGS recursive broken
+	if [ "$1" = "-r" ]; then
+		recursive=yes
+		ARGS+=" -r"
+		shift
+	fi
+
+	msgfunc=msg_warn
+	if [ -n "$XBPS_STRICT" ]; then
+		msgfunc=msg_red
+	fi
+	for file in "$@"; do
+		if [ "$recursive" ] && ! [ -d "$file" ]; then
+			if [ -n "$XBPS_STRICT" ]; then
+				broken=yes
+			fi
+			$msgfunc "$pkgver: vrm: $file is not a directory\n"
+		elif [ -e "$file" ]; then
+			rm $ARGS "$file"
+		else
+			if [ -n "$XBPS_STRICT" ]; then
+				broken=yes
+			fi
+			$msgfunc "$pkgver: vrm: $file doesn't exist\n"
+		fi
+	done
+	if [ "$broken" ]; then
+		return 1
+	fi
+}
diff --git a/xbps-src b/xbps-src
index 8488c5a3a49c..17842cb46cc1 100755
--- a/xbps-src
+++ b/xbps-src
@@ -217,7 +217,7 @@ $(print_cross_targets)
     with highest priority order than others.
 
 -s
-    Make vsed warnings errors.
+    Make some warnings errors.
 
 -t  Create a temporary masterdir to not pollute the current one. Note that
     the existing masterdir must be fully populated with binary-bootstrap first.

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

* Re: [PR REVIEW] [RFC]: xbps-src: add vrm function
  2022-04-07 19:10 [PR PATCH] [RFC]: xbps-src: add vrm function paper42
@ 2022-04-07 19:18 ` subnut
  2022-04-07 19:18 ` subnut
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: subnut @ 2022-04-07 19:18 UTC (permalink / raw)
  To: ml

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

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36562#discussion_r845487397

Comment:
This sounds better, IMO - 
```
treat some warnings as errors
```

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

* Re: [PR REVIEW] [RFC]: xbps-src: add vrm function
  2022-04-07 19:10 [PR PATCH] [RFC]: xbps-src: add vrm function paper42
  2022-04-07 19:18 ` [PR REVIEW] " subnut
@ 2022-04-07 19:18 ` subnut
  2022-07-11  2:14 ` github-actions
  2022-07-25  2:14 ` [PR PATCH] [Closed]: " github-actions
  3 siblings, 0 replies; 5+ messages in thread
From: subnut @ 2022-04-07 19:18 UTC (permalink / raw)
  To: ml

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

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36562#discussion_r845487397

Comment:
This sounds better, IMO - 
```
Treat some warnings as errors
```

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

* Re: [RFC]: xbps-src: add vrm function
  2022-04-07 19:10 [PR PATCH] [RFC]: xbps-src: add vrm function paper42
  2022-04-07 19:18 ` [PR REVIEW] " subnut
  2022-04-07 19:18 ` subnut
@ 2022-07-11  2:14 ` github-actions
  2022-07-25  2:14 ` [PR PATCH] [Closed]: " github-actions
  3 siblings, 0 replies; 5+ messages in thread
From: github-actions @ 2022-07-11  2:14 UTC (permalink / raw)
  To: ml

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

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/36562#issuecomment-1179888311

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

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

* Re: [PR PATCH] [Closed]: [RFC]: xbps-src: add vrm function
  2022-04-07 19:10 [PR PATCH] [RFC]: xbps-src: add vrm function paper42
                   ` (2 preceding siblings ...)
  2022-07-11  2:14 ` github-actions
@ 2022-07-25  2:14 ` github-actions
  3 siblings, 0 replies; 5+ messages in thread
From: github-actions @ 2022-07-25  2:14 UTC (permalink / raw)
  To: ml

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

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

[RFC]: xbps-src: add vrm function
https://github.com/void-linux/void-packages/pull/36562

Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


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

end of thread, other threads:[~2022-07-25  2:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-07 19:10 [PR PATCH] [RFC]: xbps-src: add vrm function paper42
2022-04-07 19:18 ` [PR REVIEW] " subnut
2022-04-07 19:18 ` subnut
2022-07-11  2:14 ` github-actions
2022-07-25  2:14 ` [PR PATCH] [Closed]: " github-actions

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