Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package yank for openSUSE:Factory checked in at 2022-12-01 17:21:18 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yank (Old) and /work/SRC/openSUSE:Factory/.yank.new.1835 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yank" Thu Dec 1 17:21:18 2022 rev:4 rq:1039257 version:1.3.0 Changes: -------- --- /work/SRC/openSUSE:Factory/yank/yank.changes 2019-09-19 15:53:08.579265229 +0200 +++ /work/SRC/openSUSE:Factory/.yank.new.1835/yank.changes 2022-12-01 17:22:10.182543824 +0100 @@ -1,0 +2,6 @@ +Tue Nov 29 08:38:56 UTC 2022 - Andrea Manzini <andrea.manz...@suse.com> + +- Version 1.3.0 + - Add opt-in selection of one and only field. + +------------------------------------------------------------------- Old: ---- yank-1.2.0.tar.gz New: ---- yank-1.3.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yank.spec ++++++ --- /var/tmp/diff_new_pack.nbCaEm/_old 2022-12-01 17:22:10.670546492 +0100 +++ /var/tmp/diff_new_pack.nbCaEm/_new 2022-12-01 17:22:10.674546514 +0100 @@ -1,7 +1,7 @@ # # spec file for package yank # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: yank -Version: 1.2.0 +Version: 1.3.0 Release: 0 Summary: Tool for selecting and copying text from stdin without a mouse License: MIT ++++++ yank-1.2.0.tar.gz -> yank-1.3.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yank-1.2.0/.gitignore new/yank-1.3.0/.gitignore --- old/yank-1.2.0/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/yank-1.3.0/.gitignore 2022-06-18 08:25:45.000000000 +0200 @@ -0,0 +1,2 @@ +/yank.o +/yank diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yank-1.2.0/CHANGELOG.md new/yank-1.3.0/CHANGELOG.md --- old/yank-1.2.0/CHANGELOG.md 2019-08-12 10:27:17.000000000 +0200 +++ new/yank-1.3.0/CHANGELOG.md 2022-06-18 08:25:45.000000000 +0200 @@ -1,5 +1,12 @@ -v1.2.0 - 2019-08-12 -=================== +# v1.3.0 - 2022-06-18 + +## News + +- Add opt-in selection of one and only field. + (d8b2024) + (Anton Lindqvist) + +# v1.2.0 - 2019-08-12 - Add openSUSE installation instructions to README. (c4ce72e) @@ -17,8 +24,7 @@ (dffe105) (Anton Lindqvist) -v1.1.0 - 2018-11-01 -=================== +# v1.1.0 - 2018-11-01 - Fix compilation on FreeBSD by passing preprocessor macros in `CFLAGS` as opposed of using `CPPFLAGS` which is not honored. @@ -33,8 +39,7 @@ (8dff9f3) (Tobias Kortkamp) -v1.0.0 - 2018-09-09 -=================== +# v1.0.0 - 2018-09-09 - Fix a broken reference and improve the semantics of the manual. (f99c6ed, 7a964c1) @@ -52,8 +57,7 @@ instead of relying on the ones created by GitHub. (99a91e2) -v0.8.3 - 2017-06-05 -=================== +# v0.8.3 - 2017-06-05 - Fix typo in README and man page (fe45fc1) (Jakub Wilk) @@ -68,13 +72,11 @@ - `snprintf(3)` can return `-1` (9ecb1f5) (Anton Lindqvist) -v0.8.2 - 2017-02-19 -=================== +# v0.8.2 - 2017-02-19 - Ensure `make clean` always exits with success (47a0ee9) (Sébastien Delafond) -v0.8.1 - 2017-02-18 -=================== +# v0.8.1 - 2017-02-18 - Add Fedora install instructions to README (#33, #34, 8d90aae) (Nemanja Milosevic) @@ -82,8 +84,7 @@ - Allow the name of the compiled binary to be changed using the `PROG` variable (#35, #36, 1c43c46) (Nemanja Milosevic) -v0.8.0 - 2017-01-17 -=================== +# v0.8.0 - 2017-01-17 - Update man page and README (9eac46f, 252a419) (Anton Lindqvist) @@ -93,8 +94,7 @@ - Add support for `DESTDIR` to Makefile (77cf987) (Anton Lindqvist) -v0.7.1 - 2016-10-08 -=================== +# v0.7.1 - 2016-10-08 - Update man page (2e78c28, a5cdba9) (Anton Lindqvist) @@ -110,22 +110,19 @@ - Refactoring and cleanup (2017de6) (Anton Lindqvist) -v0.7.0 - 2016-05-18 -=================== +# v0.7.0 - 2016-05-18 - Add MANPREFIX support to installation task (Anton Lindqvist) - Pledge on OpenBSD (Anton Lindqvist) -v0.6.4 - 2016-03-13 -=================== +# v0.6.4 - 2016-03-13 - Add Vi key bindings (Samson Yeung) - Fix wrong exit code on yank command failure (Anton Lindqvist) -v0.6.3 - 2016-02-20 -=================== +# v0.6.3 - 2016-02-20 - Exit with correct code on invocation failure (Anton Lindqvist) @@ -133,24 +130,20 @@ - Fix endless loop while executing the supplied regex (Anton Lindqvist) -v0.6.2 - 2015-12-15 -=================== +# v0.6.2 - 2015-12-15 - Fix non string literal compilation warning (Anton Lindqvist) -v0.6.1 - 2015-12-15 -=================== +# v0.6.1 - 2015-12-15 - Use more common save/restore cursor capabilities (Eli Young) -v0.6.0 - 2015-12-06 -=================== +# v0.6.0 - 2015-12-06 - Add regex delimiter support using the `-g` option and `-i` to make the pattern case-insensitive (Anton Lindqvist) -v0.5.0 - 2015-11-12 -=================== +# v0.5.0 - 2015-11-12 - Add arrow key bindings (Anton Lindqvist) @@ -158,8 +151,7 @@ - Add OS X installation instructions (Carl Dong) -v0.4.1 - 2015-10-19 -=================== +# v0.4.1 - 2015-10-19 - Fix number of lines in input bug (Anton Lindqvist) @@ -167,8 +159,7 @@ - Fix description in man page (Jeremiah LaRocco) -v0.4.0 - 2015-10-10 -=================== +# v0.4.0 - 2015-10-10 - Always recognize carriage return as a delimiter (Anton Lindqvist) @@ -178,20 +169,17 @@ - Fix number of lines in input bug (Anton Lindqvist) -v0.3.1 - 2015-09-24 -=================== +# v0.3.1 - 2015-09-24 - Fix moving beyond input bug (Anton Lindqvist) -v0.3.0 - 2015-09-21 -=================== +# v0.3.0 - 2015-09-21 - Add `-x` option used to enable usage of the alternate screen (Anton Lindqvist) - Fix `style(9)` violations (Anton Lindqvist) -v0.2.0 - 2015-09-10 -=================== +# v0.2.0 - 2015-09-10 - Add `-l` option used to yank a whole line (Anton Lindqvist) @@ -203,12 +191,10 @@ - Fix number of lines in input bug (Anton Lindqvist) -v0.1.1 - 2015-08-28 -=================== +# v0.1.1 - 2015-08-28 - Add support for linking against musl (Anton Lindqvist) -v0.1.0 - 2015-08-24 -=================== +# v0.1.0 - 2015-08-24 - Initial commit (Anton Lindqvist) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yank-1.2.0/LICENSE new/yank-1.3.0/LICENSE --- old/yank-1.2.0/LICENSE 2019-08-12 10:27:17.000000000 +0200 +++ new/yank-1.3.0/LICENSE 2022-06-18 08:25:45.000000000 +0200 @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Anton Lindqvist +Copyright (c) 2022 Anton Lindqvist Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yank-1.2.0/Makefile new/yank-1.3.0/Makefile --- old/yank-1.2.0/Makefile 2019-08-12 10:27:17.000000000 +0200 +++ new/yank-1.3.0/Makefile 2022-06-18 08:25:45.000000000 +0200 @@ -1,4 +1,4 @@ -VERSION= 1.2.0 +VERSION= 1.3.0 YANKCMD= xsel @@ -8,6 +8,8 @@ PROG= yank OBJS= yank.o +KNFMT+= yank.c + INSTALL_PROGRAM= install -s -m 0755 INSTALL_MAN= install -m 0644 @@ -28,28 +30,36 @@ clean: rm -f ${PROG} ${OBJS} +.PHONY: clean dist: set -e; \ - d=${PROG}-${VERSION}; \ + d=yank-${VERSION}; \ mkdir $$d; \ for f in ${DISTFILES}; do \ mkdir -p $$d/`dirname $$f`; \ - cp $$f $$d/$$f; \ + cp -p ${.CURDIR}/$$f $$d/$$f; \ done; \ - tar czvf $$d.tar.gz $$d; \ - sha256 $$d.tar.gz >$$d.sha256; \ + find $$d -type d -exec touch -r ${.CURDIR}/Makefile {} \;; \ + tar czvf ${.CURDIR}/$$d.tar.gz $$d; \ + (cd ${.CURDIR}; sha256 $$d.tar.gz >$$d.sha256); \ rm -r $$d +.PHONY: dist -distclean: clean - rm -f ${PROG}-${VERSION}.tar.gz ${PROG}-${VERSION}.sha256 +format: + cd ${.CURDIR} && knfmt -is ${KNFMT} +.PHONY: format install: ${PROG} @mkdir -p ${DESTDIR}${PREFIX}/bin @mkdir -p ${DESTDIR}${MANPREFIX}/man1 ${INSTALL_PROGRAM} ${PROG} ${DESTDIR}${PREFIX}/bin ${INSTALL_MAN} yank.1 ${DESTDIR}${MANPREFIX}/man1 +.PHONY: install -.PHONY: all clean dist distclean install +lint: + cd ${.CURDIR} && mandoc -Tlint -Wstyle yank.1 + cd ${.CURDIR} && knfmt -ds ${KNFMT} +.PHONY: lint -include config.mk diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yank-1.2.0/README.md new/yank-1.3.0/README.md --- old/yank-1.2.0/README.md 2019-08-12 10:27:17.000000000 +0200 +++ new/yank-1.3.0/README.md 2022-06-18 08:25:45.000000000 +0200 @@ -81,8 +81,6 @@ ### Debian -On testing and unstable: - ```sh $ sudo apt-get install yank ``` @@ -112,12 +110,18 @@ $ zypper install yank ``` -### macOS +### macOS via Homebrew ```sh $ brew install yank ``` +### macOS via MacPorts + +```sh +$ sudo port install yank +``` + ### FreeBSD ```sh @@ -154,7 +158,7 @@ ## License -Copyright (c) 2018 Anton Lindqvist. +Copyright (c) 2015-2022 Anton Lindqvist. Distributed under the MIT license. [xsel]: http://www.vergenet.net/~conrad/software/xsel/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yank-1.2.0/yank.1 new/yank-1.3.0/yank.1 --- old/yank-1.2.0/yank.1 2019-08-12 10:27:17.000000000 +0200 +++ new/yank-1.3.0/yank.1 2022-06-18 08:25:45.000000000 +0200 @@ -6,7 +6,7 @@ .Nd yank terminal output to clipboard .Sh SYNOPSIS .Nm -.Op Fl ilxv +.Op Fl 1ilxv .Op Fl d Ar delim .Op Fl g Ar pattern .Op Fl - Ar command Op Ar argument ... @@ -39,6 +39,10 @@ .Pp The options are as follows: .Bl -tag -width Ds +.It Fl 1 +If only one field is recognized, select it and invoke +.Ar command +without displaying the selection interface. .It Fl d Ar delim All input characters not present in .Ar delim @@ -131,7 +135,7 @@ Yank the selected field to the clipboard as opposed of the default primary clipboard: .Pp -.Dl $ yank -- xsel -b +.Dl $ yank \(em xsel -b .Sh DIAGNOSTICS .Ex -std .Sh SEE ALSO diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yank-1.2.0/yank.c new/yank-1.3.0/yank.c --- old/yank-1.2.0/yank.c 2019-08-12 10:27:17.000000000 +0200 +++ new/yank-1.3.0/yank.c 2022-06-18 08:25:45.000000000 +0200 @@ -49,14 +49,14 @@ static char **yankargv; static struct { - size_t nmemb; - size_t size; - struct field *v; + size_t nmemb; + size_t size; + struct field *v; } f; static struct { - size_t size; - size_t nmemb; + size_t size; + size_t nmemb; char *v; } in; @@ -70,7 +70,7 @@ static void input(void) { - int n; + int n; in.size = BUFSIZ; if ((in.v = malloc(in.size)) == NULL) @@ -97,10 +97,10 @@ static char * strtopat(const char *s) { - const char *fmt = "[^%s\f\n\r\t]+"; - char *pat; - size_t len; - int n; + const char *fmt = "[^%s\f\n\r\t]+"; + char *pat; + size_t len; + int n; len = strlen(s) + strlen(fmt) + 1; if ((pat = malloc(len)) == NULL) @@ -120,7 +120,7 @@ static int fcmp(const struct field *f1, const struct field *f2) { - size_t s1, s2, e1, e2; + size_t e1, e2, s1, s2; s1 = f1->so - f1->lo, e1 = f1->eo - f1->lo; s2 = f2->so - f2->lo, e2 = f2->eo - f2->lo; @@ -131,8 +131,8 @@ static ssize_t xwrite(int fd, const char *s, size_t nmemb) { - ssize_t r; - size_t n; + ssize_t r; + size_t n; n = nmemb; do { @@ -149,9 +149,9 @@ static void yank(const char *s, size_t nmemb) { - int fd[2]; - int status; - pid_t pid; + int fd[2]; + int status; + pid_t pid; if (!isatty(1)) { if (xwrite(1, s, nmemb) == -1) @@ -198,7 +198,7 @@ static void tputs(const char *s) { - size_t n; + size_t n; n = strlen(s); twrite(s, n); @@ -207,12 +207,12 @@ static void tsetup(void) { - struct termios attr; - struct winsize ws; - regmatch_t r; - char *s, *e; - size_t m, n, w; - unsigned int i, j; + struct termios attr; + struct winsize ws; + regmatch_t r; + char *e, *s; + size_t m, n, w; + unsigned int i, j; if ((tty.rfd = open("/dev/tty", O_RDONLY)) == -1) err(1, "/dev/tty"); @@ -253,8 +253,8 @@ } f.nmemb = MIN(f.nmemb, j); /* Ensure last field does not exceed the terminal width. */ - if (n > 0 && f.nmemb > 0 - && f.v[f.nmemb - 1].eo - f.v[f.nmemb - 1].lo >= ws.ws_col) + if (n > 0 && f.nmemb > 0 && + f.v[f.nmemb - 1].eo - f.v[f.nmemb - 1].lo >= ws.ws_col) f.v[f.nmemb - 1].eo = f.v[f.nmemb - 1].lo + ws.ws_col - 1; /* Number of bytes to output. */ f.v[f.nmemb].lo = MAX(s - in.v - 1, 0); @@ -296,8 +296,8 @@ { static struct { const char *s; - int c; - } keys[] = { + int c; + } keys[] = { { "\n", KEY_ENTER }, { "\001", KEY_HOME }, /* Ctrl-A */ { "\003", KEY_TERM }, /* Ctrl-C */ @@ -317,9 +317,9 @@ { "\033[D", KEY_LEFT }, { NULL, 0 }, }; - char buf[4]; - ssize_t n; - int i; + char buf[4]; + ssize_t n; + int i; n = read(tty.rfd, buf, sizeof(buf) - 1); if (n == -1) @@ -338,8 +338,8 @@ static const struct field * tmain(void) { - size_t n; - int c, i, j, k; + size_t n; + int c, i, j, k; i = j = 0; n = f.v[f.nmemb].lo; @@ -376,24 +376,25 @@ j = i - 1; break; case KEY_DOWN: - j = i; - while (j < (ssize_t)f.nmemb && f.v[i].lo == f.v[j].lo) - j++; - if (j == (ssize_t)f.nmemb) - break; - /* FALLTHROUGH */ - if (0) { case KEY_UP: - k = i; - while (k && f.v[i].lo == f.v[k].lo) - k--; - j = k; - while (j && f.v[j - 1].lo == f.v[k].lo) - j--; - } - for (; fcmp(&f.v[i], &f.v[j]) < 0 - && f.v[j].lo == f.v[j + 1].lo; j++) - /* NOP */; + if (c == KEY_DOWN) { + j = i; + while (j < (ssize_t)f.nmemb && + f.v[i].lo == f.v[j].lo) + j++; + if (j == (ssize_t)f.nmemb) + break; + } else { + k = i; + while (k && f.v[i].lo == f.v[k].lo) + k--; + j = k; + while (j && f.v[j - 1].lo == f.v[k].lo) + j--; + } + for (; fcmp(&f.v[i], &f.v[j]) < 0 && + f.v[j].lo == f.v[j + 1].lo; j++) + continue; break; } if (j >= 0 && j < (ssize_t)f.nmemb) @@ -404,7 +405,7 @@ static void usage(void) { - fprintf(stderr, "usage: yank [-ilxv] [-d delim] [-g pattern] " + fprintf(stderr, "usage: yank [-1ilxv] [-d delim] [-g pattern] " "[-- command [args]]\n"); exit(2); } @@ -412,9 +413,11 @@ int main(int argc, char *argv[]) { - const struct field *field; - char *pat; - int c, i, rflags = REG_EXTENDED; + const struct field *field; + char *pat; + int one = 0; + int rflags = REG_EXTENDED; + int c, i; setlocale(LC_CTYPE, ""); @@ -424,8 +427,11 @@ #endif pat = strtopat(" "); - while ((c = getopt(argc, argv, "ilvxd:g:")) != -1) + while ((c = getopt(argc, argv, "1ilvxd:g:")) != -1) switch (c) { + case '1': + one = 1; + break; case 'd': free(pat); pat = strtopat(optarg); @@ -467,7 +473,10 @@ input(); tsetup(); - field = tmain(); + if (one && f.nmemb == 1) + field = &f.v[0]; + else + field = tmain(); tend(); if (field == NULL) return 1;