pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files ${CP} should not be used to ins...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/050a0970c055
branches:  trunk
changeset: 514713:050a0970c055
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Jun 17 10:03:09 2006 +0000

description:
${CP} should not be used to install files, since it cannot overwrite
read-only files.

diffstat:

 pkgtools/pkglint/files/pkglint.pl |  13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diffs (28 lines):

diff -r 3118cd6a59bb -r 050a0970c055 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Sat Jun 17 09:51:19 2006 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Sat Jun 17 10:03:09 2006 +0000
@@ -1,5 +1,5 @@
 #! @PERL@
-# $NetBSD: pkglint.pl,v 1.623 2006/06/17 09:51:19 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.624 2006/06/17 10:03:09 rillig Exp $
 #
 
 # pkglint - static analyzer and checker for pkgsrc packages
@@ -3358,6 +3358,17 @@
                                "the prepared files to their final location. The file's contents should",
                                "not be changed anymore.");
 
+               } elsif ($shellcmd eq "\${CP}") {
+                       $line->log_warning("\${CP} should not be used to install files.");
+                       $line->explain_warning(
+                               "The \${CP} command is highly platform dependent and cannot overwrite",
+                               "files that don't have write permission. Please use \${PAX} instead.",
+                               "",
+                               "For example, instead of",
+                               "\t\${CP} -R \${WRKSRC}/* \${PREFIX}/foodir",
+                               "you should use",
+                               "\tcd \${WRKSRC} && \${PAX} -wr * \${PREFIX}/foodir");
+
                } else {
                        $opt_debug_misc and $line->log_debug("May \"${shellcmd}\" be used in the install phase?");
                }



Home | Main Index | Thread Index | Old Index