pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/pkgtools/pkgdiff



Module Name:    pkgsrc
Committed By:   schmonz
Date:           Wed Nov 15 16:15:47 UTC 2023

Modified Files:
        pkgsrc/pkgtools/pkgdiff: Makefile
        pkgsrc/pkgtools/pkgdiff/files: pkgvi pkgvi.1

Log Message:
pkgdiff: update to 1.11. Changes:

- Let pkgvi take multiple file arguments
- Update HOMEPAGE
- Quell pkglint


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 pkgsrc/pkgtools/pkgdiff/Makefile
cvs rdiff -u -r1.11 -r1.12 pkgsrc/pkgtools/pkgdiff/files/pkgvi
cvs rdiff -u -r1.10 -r1.11 pkgsrc/pkgtools/pkgdiff/files/pkgvi.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/pkgtools/pkgdiff/Makefile
diff -u pkgsrc/pkgtools/pkgdiff/Makefile:1.102 pkgsrc/pkgtools/pkgdiff/Makefile:1.103
--- pkgsrc/pkgtools/pkgdiff/Makefile:1.102      Sun Nov  6 13:22:01 2022
+++ pkgsrc/pkgtools/pkgdiff/Makefile    Wed Nov 15 16:15:47 2023
@@ -1,11 +1,10 @@
-# $NetBSD: Makefile,v 1.102 2022/11/06 13:22:01 tnn Exp $
+# $NetBSD: Makefile,v 1.103 2023/11/15 16:15:47 schmonz Exp $
 
-PKGNAME=       pkgdiff-1.10
-PKGREVISION=   2
+PKGNAME=       pkgdiff-1.11
 CATEGORIES=    pkgtools devel
 
 MAINTAINER=    wiz%NetBSD.org@localhost
-HOMEPAGE=      ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/doc/pkgsrc.html
+HOMEPAGE=      https://cdn.NetBSD.org/pub/pkgsrc/current/pkgsrc/doc/pkgsrc.html
 COMMENT=       Tools to create, maintain, and send back patches for pkgsrc
 LICENSE=       2-clause-bsd AND original-bsd
 
@@ -13,7 +12,7 @@ NO_CONFIGURE= yes
 
 WRKSRC=                ${WRKDIR}
 USE_LANGUAGES= # empty
-USE_TOOLS+=    perl:run
+USE_TOOLS+=    diff perl:run
 
 MAKE_ENV+=     PKGSRCDIR=${_PKGSRCDIR:Q}
 
@@ -65,7 +64,7 @@ do-install:
 .for f in mkpatches patchdiff pkgdiff pkgvi feedback-patches
        ${INSTALL_SCRIPT} ${WRKSRC}/${f} ${DESTDIR}${PREFIX}/bin
 .  if !empty(MANINSTALL:Mcatinstall)
-.    if defined(CATMAN_SECTION_SUFFIX) && !empty(CATMAN_SECTION_SUFFIX:M[Yy][Ee][Ss])
+.    if defined(CATMAN_SECTION_SUFFIX) && ${CATMAN_SECTION_SUFFIX:U:tl} == yes
        ${INSTALL_MAN} ${WRKSRC}/${f}.0 ${DESTDIR}${PREFIX}/${PKGMANDIR}/cat1/${f}.1
 .    else
        ${INSTALL_MAN} ${WRKSRC}/${f}.0 ${DESTDIR}${PREFIX}/${PKGMANDIR}/cat1

Index: pkgsrc/pkgtools/pkgdiff/files/pkgvi
diff -u pkgsrc/pkgtools/pkgdiff/files/pkgvi:1.11 pkgsrc/pkgtools/pkgdiff/files/pkgvi:1.12
--- pkgsrc/pkgtools/pkgdiff/files/pkgvi:1.11    Tue Aug 23 21:47:18 2011
+++ pkgsrc/pkgtools/pkgdiff/files/pkgvi Wed Nov 15 16:15:47 2023
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: pkgvi,v 1.11 2011/08/23 21:47:18 abs Exp $
+# $NetBSD: pkgvi,v 1.12 2023/11/15 16:15:47 schmonz Exp $
 #
 # Copyright (c) 2001 Tomasz Luchowski. All rights reserved.
 #
@@ -31,80 +31,68 @@
 # SUCH DAMAGE.
 #
 
+set -e
+
+progname=`basename $0`
+editor="vi"
 if [ "$PKGEDITOR" != "" ]; then
        editor="$PKGEDITOR"
 elif [ "$EDITOR" != "" ]; then
        editor="$EDITOR"
-else
-       editor="vi"
-fi
-
-progname=`basename $0`
-
-if [ $# -eq 0 ]
-then
-       echo Usage: $progname file >&2
-       exit 1
-fi
-
-file="$1"
-cmd=""
-case x"$file" in
-        x+*) cmd="$1"; shift ; file="$1" ;;
-esac
-
-if [ ! -f "$file" ]
-then
-       echo "$progname: $file: No such file"
-       exit 2
-fi
-
-if [ -f "$file.orig" ]
-then
-       chmod u+w "$file"
-       $editor $cmd "$file"
-       echo "$progname: Backup already exists. For a diff type:"
-        echo "pkgdiff $file"
-       exit 0
 fi
 
-bfile=`basename "$file"`
-dfile=`dirname "$file"`
+die() {
+       _exitcode=$1; shift
+       warn "$@"
+       exit ${_exitcode}
+}
+
+warn() {
+       echo >&2 "$@"
+}
+
+usage() {
+       die 1 "Usage: $progname [+cmd] file [...]"
+}
+
+prepare_backup_files() {
+       for file in $@; do
+               [ -f "$file" ] || die 2 "$progname: $file: No such file"
+               chmod u+w "$file"
+               if [ -f "$file.orig" ]; then
+                       echo "$progname: Backup already exists."
+               else
+                       cp "$file" "$file.orig"
+               fi
+       done
+}
+
+remove_unneeded_backup_files() {
+       for file in $@; do
+               if cmp "$file" "$file.orig" >/dev/null 2>&1; then
+                       echo "$progname: File unchanged."
+                       rm -f "$file.orig"
+               else
+                       echo "$progname: File was modified. For a diff, type:"
+                       echo "pkgdiff \"$file\""
+               fi
+       done
+}
+
+main() {
+       [ $# -eq 0 ] && usage
+
+       cmd=""
+       case "$1" in
+               +*)     cmd="$1"; shift ;;
+       esac
+
+       prepare_backup_files "$@"
 
-ext=`echo $bfile | awk -F. '{ print $NF }'`
+       $editor $cmd $@
 
-if [ "$bfile" != "$ext" ]; then
-       tmp="$dfile/$bfile.$$.$ext"
-else
-       tmp="$file.$$"
-fi
-
-cp "$file" "$tmp"
-chmod u+w "$tmp"
-
-if [ $? -ne 0 ]; then
-       echo "$progname: unable to create temporary file"
-       exit 1
-fi
-
-$editor $cmd "$tmp"
+       remove_unneeded_backup_files "$@"
+}
 
-if cmp "$file" "$tmp" >/dev/null 2>&1
-then
-       echo "$progname: File unchanged."
-else
-       mv "$file" "$file.orig"
-       mv "$tmp" "$file"
-       echo "$progname: File was modified. For a diff, type:"
-       echo "pkgdiff \"$file\""
-fi
-
-if [ -f "$tmp" ]
-then
-       rm "$tmp"
-fi
-
-if [ -f "$tmp~" ]
-then
-       rm "$tmp~"
-fi
+main "$@"
+exit $?

Index: pkgsrc/pkgtools/pkgdiff/files/pkgvi.1
diff -u pkgsrc/pkgtools/pkgdiff/files/pkgvi.1:1.10 pkgsrc/pkgtools/pkgdiff/files/pkgvi.1:1.11
--- pkgsrc/pkgtools/pkgdiff/files/pkgvi.1:1.10  Sat Jul 20 21:50:53 2013
+++ pkgsrc/pkgtools/pkgdiff/files/pkgvi.1       Wed Nov 15 16:15:47 2023
@@ -1,4 +1,4 @@
-.\"    $NetBSD: pkgvi.1,v 1.10 2013/07/20 21:50:53 wiz Exp $
+.\"    $NetBSD: pkgvi.1,v 1.11 2023/11/15 16:15:47 schmonz Exp $
 .\"
 .\" Copyright (c) 2001 Tomasz Luchowski. All rights reserved.
 .\"
@@ -39,6 +39,7 @@
 .Nm
 .Op +command
 .Ar file
+.Ar [file...]
 .Sh DESCRIPTION
 The
 .Nm



Home | Main Index | Thread Index | Old Index