pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkgdiff Ensure that the file that is opened i...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/25d0065034a1
branches:  trunk
changeset: 516945:25d0065034a1
user:      bad <bad%pkgsrc.org@localhost>
date:      Tue Aug 01 17:59:17 2006 +0000

description:
Ensure that the file that is opened in the editor is writable by the user.

Approved by wiz@.

diffstat:

 pkgtools/pkgdiff/Makefile      |  4 ++--
 pkgtools/pkgdiff/files/pkgvi   |  6 ++++--
 pkgtools/pkgdiff/files/pkgvi.0 |  7 ++++---
 pkgtools/pkgdiff/files/pkgvi.1 |  7 +++++--
 4 files changed, 15 insertions(+), 9 deletions(-)

diffs (97 lines):

diff -r 42759050cc4b -r 25d0065034a1 pkgtools/pkgdiff/Makefile
--- a/pkgtools/pkgdiff/Makefile Tue Aug 01 17:19:34 2006 +0000
+++ b/pkgtools/pkgdiff/Makefile Tue Aug 01 17:59:17 2006 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.60 2006/04/28 06:51:14 jlam Exp $
+# $NetBSD: Makefile,v 1.61 2006/08/01 17:59:17 bad Exp $
 #
 
-DISTNAME=      pkgdiff-0.118
+DISTNAME=      pkgdiff-0.119
 CATEGORIES=    pkgtools devel
 MASTER_SITES=  # empty
 DISTFILES=     # empty
diff -r 42759050cc4b -r 25d0065034a1 pkgtools/pkgdiff/files/pkgvi
--- a/pkgtools/pkgdiff/files/pkgvi      Tue Aug 01 17:19:34 2006 +0000
+++ b/pkgtools/pkgdiff/files/pkgvi      Tue Aug 01 17:59:17 2006 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: pkgvi,v 1.9 2003/08/23 19:40:19 seb Exp $
+# $NetBSD: pkgvi,v 1.10 2006/08/01 17:59:17 bad Exp $
 #
 # Copyright (c) 2001 Tomasz Luchowski. All rights reserved.
 #
@@ -61,7 +61,8 @@
 
 if [ -f $file.orig ]
 then
-       $editor $cmd $file
+       chmod u+w "$file"
+       $editor $cmd "$file"
        echo "$progname: Backup already exists. For a diff type:"
         echo "pkgdiff $file"
        exit 0
@@ -79,6 +80,7 @@
 fi
 
 cp "$file" "$tmp"
+chmod u+w "$tmp"
 
 if [ $? -ne 0 ]; then
        echo "$progname: unable to create temporary file"
diff -r 42759050cc4b -r 25d0065034a1 pkgtools/pkgdiff/files/pkgvi.0
--- a/pkgtools/pkgdiff/files/pkgvi.0    Tue Aug 01 17:19:34 2006 +0000
+++ b/pkgtools/pkgdiff/files/pkgvi.0    Tue Aug 01 17:59:17 2006 +0000
@@ -1,7 +1,7 @@
 PKGVI(1)                NetBSD General Commands Manual                PKGVI(1)
 
 NNAAMMEE
-     ppkkggvvii - run editor and make backup of given file if necessary
+     ppkkggvvii -- run editor and make backup of given file if necessary
 
 SSYYNNOOPPSSIISS
      ppkkggvvii [+command] _f_i_l_e
@@ -11,7 +11,8 @@
      file.  If no changes are made in the editor, nothing happens.  Else the
      original file is kept as _f_i_l_e_n_a_m_e_._o_r_i_g, and the modified file is saved as
      _f_i_l_e_n_a_m_e.  If ppkkggvvii finds _f_i_l_e_n_a_m_e_._o_r_i_g, it behaves as normal editor and
-     changes are only made to _f_i_l_e_n_a_m_e, not affecting _f_i_l_e_n_a_m_e_._o_r_i_g.
+     changes are only made to _f_i_l_e_n_a_m_e, not affecting _f_i_l_e_n_a_m_e_._o_r_i_g.  In both
+     cases ppkkggvvii ensures that the file to be edited is writable by the user.
 
      Available option:
 
@@ -29,4 +30,4 @@
 AAUUTTHHOORRSS
      The pkgvi utility was written by Tomasz Luchowski <zuntum%netbsd.org@localhost>.
 
-NetBSD 1.6                       May 28, 2003                       NetBSD 1.6
+NetBSD 3.0_STABLE                 Aug 1, 2006                NetBSD 3.0_STABLE
diff -r 42759050cc4b -r 25d0065034a1 pkgtools/pkgdiff/files/pkgvi.1
--- a/pkgtools/pkgdiff/files/pkgvi.1    Tue Aug 01 17:19:34 2006 +0000
+++ b/pkgtools/pkgdiff/files/pkgvi.1    Tue Aug 01 17:59:17 2006 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: pkgvi.1,v 1.7 2003/05/28 14:53:51 seb Exp $
+.\"    $NetBSD: pkgvi.1,v 1.8 2006/08/01 17:59:17 bad Exp $
 .\"
 .\" Copyright (c) 2001 Tomasz Luchowski. All rights reserved.
 .\"
@@ -29,7 +29,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd May 28, 2003
+.Dd Aug 1, 2006
 .Dt PKGVI 1
 .Os
 .Sh NAME
@@ -58,6 +58,9 @@
 .Pa filename ,
 not affecting
 .Pa filename.orig .
+In both cases
+.Nm
+ensures that the file to be edited is writable by the user.
 .Pp
 Available option:
 .Bl -tag -width indent



Home | Main Index | Thread Index | Old Index