pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/devel/diffbreaker Diffbreaker 0.4
details: https://anonhg.NetBSD.org/pkgsrc/rev/20387b029519
branches: trunk
changeset: 381782:20387b029519
user: nat <nat%pkgsrc.org@localhost>
date: Wed Jul 13 11:48:05 2022 +0000
description:
Diffbreaker 0.4
New features:
Ability to jump between files in a multi-file unified diff.
Ability to search diffs.
Bug fixes:
Correctly calculate file offsets at the start of the diff.
Now at its new home on Github at https://github.com/AceHusky12/diffbreaker.
diffstat:
devel/diffbreaker/Makefile | 16 +-
devel/diffbreaker/distinfo | 5 +
devel/diffbreaker/files/diffbreaker/Makefile | 9 -
devel/diffbreaker/files/diffbreaker/diffbreaker.1 | 96 ---
devel/diffbreaker/files/diffbreaker/diffbreaker.c | 702 ----------------------
5 files changed, 14 insertions(+), 814 deletions(-)
diffs (truncated from 866 to 300 lines):
diff -r 167ffef19e50 -r 20387b029519 devel/diffbreaker/Makefile
--- a/devel/diffbreaker/Makefile Wed Jul 13 11:41:06 2022 +0000
+++ b/devel/diffbreaker/Makefile Wed Jul 13 11:48:05 2022 +0000
@@ -1,15 +1,20 @@
-# $NetBSD: Makefile,v 1.6 2021/05/14 14:47:55 nia Exp $
+# $NetBSD: Makefile,v 1.7 2022/07/13 11:48:05 nat Exp $
-PKGNAME= diffbreaker-0.3
+VERSION= 0.4
+GITHUB_PROJECT= diffbreaker
+DISTNAME= ${GITHUB_PROJECT}-${VERSION}
+PKGNAME= ${GITHUB_PROJECT}-${VERSION}
+
#PKGREVISION= 1
CATEGORIES= devel
+MASTER_SITES= ${MASTER_SITE_GITHUB:=AceHusky12/}
+EXTRACT_SUFX= .zip
MAINTAINER= nat%NetBSD.org@localhost
+HOMEPAGE= https://github.com/AceHusky12/diffbreaker
COMMENT= Tool to manuipulate unified diffs using curses
LICENSE= 2-clause-bsd
-WRKSRC= ${WRKDIR}/diffbreaker
-
USE_BSD_MAKEFILE= yes
.include "../../mk/bsd.prefs.mk"
@@ -24,9 +29,6 @@
INSTALLATION_DIRS+= ${PKGMANDIR}/man1
.endif
-do-extract:
- ${CP} -R ${FILESDIR}/diffbreaker ${WRKDIR}
-
do-install:
.for f in diffbreaker
${INSTALL_SCRIPT} ${WRKSRC}/${f} ${DESTDIR}${PREFIX}/bin
diff -r 167ffef19e50 -r 20387b029519 devel/diffbreaker/distinfo
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/diffbreaker/distinfo Wed Jul 13 11:48:05 2022 +0000
@@ -0,0 +1,5 @@
+$NetBSD: distinfo,v 1.1 2022/07/13 11:48:05 nat Exp $
+
+BLAKE2s (diffbreaker-0.4.zip) = 2bacad24b044c351b68c911d0c7a60bf08b07fda54cad0ef21cf18a0b1ea9a8c
+SHA512 (diffbreaker-0.4.zip) = 6be72e4db473d5015c741a3c00407ce97b9efd4da0eb20014275124bc61f127c9dd670db83871929f2c71ed3effc20f84c7d18f1a9dd363e4b6620c680055885
+Size (diffbreaker-0.4.zip) = 8919 bytes
diff -r 167ffef19e50 -r 20387b029519 devel/diffbreaker/files/diffbreaker/Makefile
--- a/devel/diffbreaker/files/diffbreaker/Makefile Wed Jul 13 11:41:06 2022 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-# $NetBSD: Makefile,v 1.1 2020/05/24 16:44:20 nat Exp $
-
-PROG= diffbreaker
-MAN= diffbreaker.1
-DPADD= ${LIBCURSES} ${LIBTERMINFO}
-LDADD= -lcurses -lterminfo
-
-WARNS?= 6
-.include <bsd.prog.mk>
diff -r 167ffef19e50 -r 20387b029519 devel/diffbreaker/files/diffbreaker/diffbreaker.1
--- a/devel/diffbreaker/files/diffbreaker/diffbreaker.1 Wed Jul 13 11:41:06 2022 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-.\" $NetBSD: diffbreaker.1,v 1.1 2020/05/24 16:44:20 nat Exp $
-.\"
-.\" Copyright (c) 2020 Nathanial Sloss <nathanialsloss%yahoo.com.au@localhost>
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
-.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
-.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-.\" POSSIBILITY OF SUCH DAMAGE.
-.\"
-.Dd April 10, 2020
-.Dt DIFFBREAKER 1
-.Os
-.Sh NAME
-.Nm diffbreaker
-.Nd unified diff cherry picker / patch set editor
-.Sh SYNOPSIS
-.Nm
-.Op Fl s
-.Fl i Ar input file
-.Fl o Ar output file
-.Sh DESCRIPTION
-The
-.Nm
-command allows the user to create incremental patches from a single unified diff
-interactively using
-.Xr curses 3 .
-.Bl -tag -indent width
-.It Fl i Ar input file
-Unified diff input file.
-.It Fl o Ar output file / beginning of file path.
-Output location / file.
-A file name of "-" means to write to stderr, useful for redirecting the output.
-.It Op Fl s
-If the
-.Op Fl s
-switch is given the output file argument is a prefix and path for files to be
-output.
-Files are written from output file.1.diff etc.
-.PP
-If no
-.Op Fl s
-switch is
-.Em not
-given the output file is appended to on each subsequent
-write.
-.El
-.Sh KEYS
-.Nm
-accepts the following keys:
-.Bl -tag -indent width
-.It [SPACE]
-Select / Un-select change.
-.It [l]
-Redraw the current screen.
-.It [j]
-Move down 1 line.
-.It [k]
-Move up 1 line.
-.It [G]
-Move to the beginning of the diff.
-.It [g]
-Move to the end of the diff.
-.It [w]
-Write changes to output file(s).
-Clearing sections from the screen in which all changes within a block or file
-have been written and return to the top of the diff.
-.It [q]
-Quit the program,
-.Em DISCARDING
-any unsaved changes.
-.Sh STATUS LINE
-At the bottom of the screen the number of unwritten lines in the buffer is
-displayed.
-.Sh SEE ALSO
-.Xr curses 3
-.Xr diff 1
-.Xr patch 1
-.Sh AUTHORS
-Nathanial Sloss
diff -r 167ffef19e50 -r 20387b029519 devel/diffbreaker/files/diffbreaker/diffbreaker.c
--- a/devel/diffbreaker/files/diffbreaker/diffbreaker.c Wed Jul 13 11:41:06 2022 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,702 +0,0 @@
-/* $NetBSD: diffbreaker.c,v 1.10 2020/10/11 01:57:04 nat Exp $ */
-
-/*-
- * Copyright (c) 2018, 2019 Nathanial Sloss <nathanialsloss%yahoo.com.au@localhost>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <curses.h>
-#include <err.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-ssize_t finalize_context(ssize_t context, ssize_t current, ssize_t secthead,
- ssize_t first, ssize_t part, ssize_t origoffs,
- ssize_t newoffs, ssize_t last, ssize_t pos);
-ssize_t find_next_marker(ssize_t current, int direction);
-ssize_t update_context(ssize_t lines, ssize_t current, ssize_t last);
-ssize_t get_context(ssize_t current, ssize_t last, ssize_t num);
-void print_buffer(ssize_t myLine, ssize_t dispLines);
-void parse_buffer(char *outfile, bool incremental, uint32_t *filesuffix);
-void read_data_to_buffer(char *myFile);
-void free_buffers_actions(void);
-void setup_screen(void);
-void mark_dirty(void);
-#ifndef __dead
-#define __dead __attribute__((__noreturn__))
-#endif
-#ifdef __linux__
-extern char *__progname;
-#define getprogname() __progname
-#endif
-
-__dead static void usage(void);
-
-int dispLine, promptLine, scrcols, scrlines;
-int displayLines;
-WINDOW *mywin = NULL;
-static char *buffer;
-static char *newbuffer;
-static char *action;
-static char *newaction;
-static ssize_t currentLine, totalLines, cpl;
-
-#define ORIGBUF(x) (buffer + ((x) * cpl))
-#define NEWBUF(x) (newbuffer + ((x) * cpl))
-
-#define COLORTEXT(x) \
- do { \
- if (has_colors()) \
- attrset(COLOR_PAIR(x)); \
- else \
- attrset(A_REVERSE); \
- } while (0)
-
-#define NORMALTEXT \
- do { \
- if (has_colors()) \
- attrset(COLOR_PAIR(1)); \
- else \
- attrset(A_NORMAL); \
- } while (0)
-void
-mark_dirty(void)
-{
- bool writetome = false, display = false;
- bool pending = false, writesect = false;
- ssize_t i, j = 0, last = 0, myfile = 0;
- size_t len = (size_t)cpl;
-
- j = 0;
- for (i = 0; i < totalLines; i++) {
- switch (action[i]) {
- case 2: /* Selected */
- if (*ORIGBUF(i) == '-') {
- continue;
- }
- if (*ORIGBUF(i) == '+') {
- strncpy(NEWBUF(j), ORIGBUF(i), len);
- *NEWBUF(j) = ' ';
- action[j] = 0;
- }
- break;
- case 5: /* @@ marker */
- if (pending == false && writesect == false)
- j = last;
- last = j;
- pending = false;
- writesect = false;
- action[j] = action[i];
- strncpy(NEWBUF(j), ORIGBUF(i), len);
- break;
- case 6: /* --- */
- if (pending == false && writesect == false)
- j = last;
- if (writetome == false)
- j = myfile;
- myfile = j;
- pending = true;
- writetome = false;
- writesect = true;
- strncpy(NEWBUF(j), ORIGBUF(i), len);
- action[j] = action[i];
- break;
- case 7: /* +++ */
- strncpy(NEWBUF(j), ORIGBUF(i), len);
- action[j] = action[i];
- break;
- case 1: /* unselected change */
- display = true;
Home |
Main Index |
Thread Index |
Old Index