Github messages for voidlinux
 help / color / mirror / Atom feed
From: ElDifinitivo <ElDifinitivo@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] New package: ouch-0.3.1
Date: Thu, 03 Mar 2022 21:04:49 +0100	[thread overview]
Message-ID: <20220303200449.YA_qj0neQIvFCGcqx-burWiTsnwjrTQl9i8eXCYVYwA@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-34931@inbox.vuxu.org>

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

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

https://github.com/ElDifinitivo/void-packages ouch
https://github.com/void-linux/void-packages/pull/34931

New package: ouch-0.3.1
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

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

#### Local build testing
- I built this PR locally for my native architecture, (x86_64)

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

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

From c599c652fec8ba2dd65b0f02211edf92b1ea77cd Mon Sep 17 00:00:00 2001
From: Savoy <git@liberation.red>
Date: Fri, 7 Jan 2022 15:34:41 -0600
Subject: [PATCH] New package: ouch-0.3.1

---
 ...riding-the-completions-output-direct.patch | 40 ++++++++++++++++
 ...single-quotes-from-clap-doc-comments.patch | 46 +++++++++++++++++++
 srcpkgs/ouch/template                         | 24 ++++++++++
 3 files changed, 110 insertions(+)
 create mode 100644 srcpkgs/ouch/patches/0001-chore-allow-overriding-the-completions-output-direct.patch
 create mode 100644 srcpkgs/ouch/patches/0002-fix-remove-single-quotes-from-clap-doc-comments.patch
 create mode 100644 srcpkgs/ouch/template

diff --git a/srcpkgs/ouch/patches/0001-chore-allow-overriding-the-completions-output-direct.patch b/srcpkgs/ouch/patches/0001-chore-allow-overriding-the-completions-output-direct.patch
new file mode 100644
index 000000000000..da97e65e7658
--- /dev/null
+++ b/srcpkgs/ouch/patches/0001-chore-allow-overriding-the-completions-output-direct.patch
@@ -0,0 +1,40 @@
+From 60763a64c1b7268050bb61fb8cef1c982bbd4aca Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?=
+ <jan.christian@gruenhage.xyz>
+Date: Sun, 13 Feb 2022 09:53:28 +0100
+Subject: [PATCH 1/2] chore: allow overriding the completions output directory
+
+---
+ build.rs | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/build.rs b/build.rs
+index 5372154..b5c56c4 100644
+--- a/build.rs
++++ b/build.rs
+@@ -1,7 +1,7 @@
+ use clap::{ArgEnum, IntoApp};
+ use clap_generate::{generate_to, Shell};
+ 
+-use std::{env, fs::create_dir_all, path::Path};
++use std::{env, fs::create_dir_all};
+ 
+ include!("src/opts.rs");
+ 
+@@ -12,7 +12,13 @@ fn main() {
+         return;
+     }
+ 
+-    let out = &Path::new(&env::var_os("OUT_DIR").unwrap()).join("completions");
++    let out = &env::var_os("OUCH_COMPLETIONS_DIR")
++        .map(|path| PathBuf::from(&path))
++        .or_else(|| env::var_os("OUT_DIR")
++                 .map(|path| PathBuf::from(&path))
++                 .map(|path| path.join("completions"))
++        ).unwrap();
++
+     create_dir_all(out).unwrap();
+     let app = &mut Opts::into_app();
+ 
+-- 
+2.35.1
diff --git a/srcpkgs/ouch/patches/0002-fix-remove-single-quotes-from-clap-doc-comments.patch b/srcpkgs/ouch/patches/0002-fix-remove-single-quotes-from-clap-doc-comments.patch
new file mode 100644
index 000000000000..a44a7d183e0b
--- /dev/null
+++ b/srcpkgs/ouch/patches/0002-fix-remove-single-quotes-from-clap-doc-comments.patch
@@ -0,0 +1,46 @@
+From b6279d75db53ddc34dd6ba727df1b7fd0ad134dd Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?=
+ <jan.christian@gruenhage.xyz>
+Date: Sun, 13 Feb 2022 10:09:29 +0100
+Subject: [PATCH 2/2] fix: remove single quotes from clap doc comments
+
+Apparently, clap_complete doesn't properly escape single quotes in doc
+comments, leading to broken shell completions for zsh. To circumvent
+this, I've removed the single quote in the one place where it shouldn't
+have been in the first place ("it's" vs "its", contraction vs possessive
+pronoun), and replaced "it's" with "it is" in the other place.
+
+Reference to upstream issue: https://github.com/clap-rs/clap/issues/1596
+---
+ src/commands.rs | 2 +-
+ src/opts.rs     | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/commands.rs b/src/commands.rs
+index 106e36d..692dceb 100644
+--- a/src/commands.rs
++++ b/src/commands.rs
+@@ -99,7 +99,7 @@ pub fn run(args: Opts, question_policy: QuestionPolicy) -> crate::Result<()> {
+             let output_file = fs::File::create(&output_path)?;
+ 
+             if !represents_several_files(&files) {
+-                // It's possible the file is already partially compressed so we don't want to compress it again
++                // It is possible the file is already partially compressed so we don't want to compress it again
+                 // `ouch compress file.tar.gz file.tar.gz.xz` should produce `file.tar.gz.xz` and not `file.tar.gz.tar.gz.xz`
+                 let input_extensions = extension::extensions_from_path(&files[0]);
+ 
+diff --git a/src/opts.rs b/src/opts.rs
+index 14d6997..e532e7b 100644
+--- a/src/opts.rs
++++ b/src/opts.rs
+@@ -39,7 +39,7 @@ pub enum Subcommand {
+         #[clap(required = true, min_values = 1)]
+         files: Vec<PathBuf>,
+ 
+-        /// The resulting file. It's extensions can be used to specify the compression formats.
++        /// The resulting file. Its extensions can be used to specify the compression formats.
+         #[clap(required = true, value_hint = ValueHint::FilePath)]
+         output: PathBuf,
+     },
+-- 
+2.35.1
diff --git a/srcpkgs/ouch/template b/srcpkgs/ouch/template
new file mode 100644
index 000000000000..9e585cdda85e
--- /dev/null
+++ b/srcpkgs/ouch/template
@@ -0,0 +1,24 @@
+# Template file for 'ouch'
+pkgname=ouch
+version=0.3.1
+revision=1
+build_style=cargo
+makedepends="liblzma-devel bzip2-devel libzip-devel"
+short_desc="CLI utility for easily compressing and decompressing files and dirs"
+maintainer="Savoy <savoy@liberation.red>"
+license="MIT"
+homepage="https://github.com/ouch-org/ouch"
+distfiles="https://github.com/ouch-org/ouch/archive/refs/tags/${version}.tar.gz"
+checksum=269abaf5ac2f80da3796dbf5e73419c1b64104d1295f3ff57965141f079e6f6d
+
+pre_build() {
+	export GEN_COMPLETIONS=1
+	export OUCH_COMPLETIONS_DIR=completions
+}
+
+post_install() {
+	vlicense LICENSE
+	vcompletion "completions/_ouch" zsh
+	vcompletion "completions/ouch.fish" fish
+	vcompletion "completions/ouch.bash" bash
+}

  parent reply	other threads:[~2022-03-03 20:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-07 21:36 [PR PATCH] " ElDifinitivo
2022-01-07 21:39 ` [PR REVIEW] " abenson
2022-01-07 21:39 ` abenson
2022-01-07 21:57 ` [PR PATCH] [Updated] " ElDifinitivo
2022-01-14 15:26 ` ElDifinitivo
2022-02-13  9:27 ` jcgruenhage
2022-02-13  9:52 ` jcgruenhage
2022-02-13 17:05 ` ElDifinitivo
2022-02-13 17:09 ` ElDifinitivo
2022-02-13 17:18 ` jcgruenhage
2022-02-13 19:25 ` [PR PATCH] [Updated] " ElDifinitivo
2022-02-14  7:20 ` paper42
2022-02-14 14:49 ` [PR PATCH] [Updated] " ElDifinitivo
2022-02-14 14:58 ` ElDifinitivo
2022-02-14 15:55 ` ElDifinitivo
2022-02-14 15:57 ` ElDifinitivo
2022-02-28 15:28 ` ElDifinitivo
2022-03-03 20:04 ` ElDifinitivo [this message]
2022-03-03 21:50 ` [PR PATCH] [Merged]: " paper42

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220303200449.YA_qj0neQIvFCGcqx-burWiTsnwjrTQl9i8eXCYVYwA@z \
    --to=eldifinitivo@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).