pkgsrc-Changes archive

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

CVS commit: pkgsrc/pkgtools/pkgclean



Module Name:    pkgsrc
Committed By:   gutteridge
Date:           Sun Jan 19 03:31:30 UTC 2020

Modified Files:
        pkgsrc/pkgtools/pkgclean: Makefile
        pkgsrc/pkgtools/pkgclean/files: pkgclean.sh

Log Message:
pkgclean: check that PKGSRCDIR is a valid directory

For those of us who have multiple pkgsrc trees, or move them around,
and forget the path gets hard-coded into the shell script, or make a
typo when supplying an alternate PKGSRCDIR, and then wonder why nothing
gets cleaned.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 pkgsrc/pkgtools/pkgclean/Makefile
cvs rdiff -u -r1.3 -r1.4 pkgsrc/pkgtools/pkgclean/files/pkgclean.sh

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

Modified files:

Index: pkgsrc/pkgtools/pkgclean/Makefile
diff -u pkgsrc/pkgtools/pkgclean/Makefile:1.22 pkgsrc/pkgtools/pkgclean/Makefile:1.23
--- pkgsrc/pkgtools/pkgclean/Makefile:1.22      Thu May 23 19:23:13 2019
+++ pkgsrc/pkgtools/pkgclean/Makefile   Sun Jan 19 03:31:30 2020
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.22 2019/05/23 19:23:13 rillig Exp $
+# $NetBSD: Makefile,v 1.23 2020/01/19 03:31:30 gutteridge Exp $
 
-PKGNAME=       pkgclean-20051116
+PKGNAME=       pkgclean-20200119
 CATEGORIES=    pkgtools
 
 MAINTAINER=    pkgsrc-users%NetBSD.org@localhost

Index: pkgsrc/pkgtools/pkgclean/files/pkgclean.sh
diff -u pkgsrc/pkgtools/pkgclean/files/pkgclean.sh:1.3 pkgsrc/pkgtools/pkgclean/files/pkgclean.sh:1.4
--- pkgsrc/pkgtools/pkgclean/files/pkgclean.sh:1.3      Tue Apr 29 05:46:08 2008
+++ pkgsrc/pkgtools/pkgclean/files/pkgclean.sh  Sun Jan 19 03:31:30 2020
@@ -1,8 +1,8 @@
 #! @SH@
-# $NetBSD: pkgclean.sh,v 1.3 2008/04/29 05:46:08 martin Exp $
+# $NetBSD: pkgclean.sh,v 1.4 2020/01/19 03:31:30 gutteridge Exp $
 #
 
-# Copyright (c) 2005 The NetBSD Foundation, Inc.
+# Copyright (c) 2005, 2020 The NetBSD Foundation, Inc.
 # All rights reserved.
 #
 # This code is derived from software contributed to The NetBSD Foundation
@@ -45,11 +45,17 @@ esac
 # Sanity checks
 #
 
+if [ ! -d "$pkgsrcdir" ]; then
+       echo "$0: error: PKGSRCDIR is not valid." 1>&2
+       exit 1
+fi
+
 case $pkgsrcdir in
 /*)    ;;
 *)     echo "$0: error: PKGSRCDIR must be an absolute path." 1>&2
        exit 1;;
 esac
+
 case $wrkdir_basename in
 */*)   echo "$0: error: wrkdir_basename must not contain slashes." 1>&2
        exit 1;;



Home | Main Index | Thread Index | Old Index