pkgsrc-Changes archive

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

CVS commit: pkgsrc/pkgtools/url2pkg/files



Module Name:    pkgsrc
Committed By:   rillig
Date:           Sun Aug 18 05:32:00 UTC 2019

Modified Files:
        pkgsrc/pkgtools/url2pkg/files: url2pkg.pl

Log Message:
pkgtools/url2pkg: run editor with line number only if supported

For example, ed doesn't support line numbers.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 pkgsrc/pkgtools/url2pkg/files/url2pkg.pl

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

Modified files:

Index: pkgsrc/pkgtools/url2pkg/files/url2pkg.pl
diff -u pkgsrc/pkgtools/url2pkg/files/url2pkg.pl:1.45 pkgsrc/pkgtools/url2pkg/files/url2pkg.pl:1.46
--- pkgsrc/pkgtools/url2pkg/files/url2pkg.pl:1.45       Sat Aug 17 13:55:41 2019
+++ pkgsrc/pkgtools/url2pkg/files/url2pkg.pl    Sun Aug 18 05:32:00 2019
@@ -1,5 +1,5 @@
 #! @PERL@
-# $NetBSD: url2pkg.pl,v 1.45 2019/08/17 13:55:41 rillig Exp $
+# $NetBSD: url2pkg.pl,v 1.46 2019/08/18 05:32:00 rillig Exp $
 #
 
 # Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -52,7 +52,12 @@ sub run_editor($$) {
 
        my $editor = $ENV{"PKGEDITOR"} || $ENV{"EDITOR"} || "vi";
 
-       system { $editor } ($editor, "+${lineno}", $fname);
+       my @args;
+       push(@args, $editor);
+       push(@args, "+$lineno") if $editor =~ qr"(^|/)(mcedit|nano|pico|vi|vim)$";
+       push(@args, $fname);
+
+       system { $args[0] } (@args);
 }
 
 sub get_maintainer() {



Home | Main Index | Thread Index | Old Index