pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/lintpkgsrc/files lintpkgsrc: properly clean u...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/91a30231715a
branches:  trunk
changeset: 383173:91a30231715a
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sun Aug 14 03:18:36 2022 +0000

description:
lintpkgsrc: properly clean up after chdir

When running 'lintpkgsrc -I tmp/lp-85 -yro', lintpkgsrc couldn't find
the cache file due to the intermediate chdir($pkgdistdir).

diffstat:

 pkgtools/lintpkgsrc/files/lintpkgsrc.pl |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 8d6479d1c9b3 -r 91a30231715a pkgtools/lintpkgsrc/files/lintpkgsrc.pl
--- a/pkgtools/lintpkgsrc/files/lintpkgsrc.pl   Sun Aug 14 03:12:02 2022 +0000
+++ b/pkgtools/lintpkgsrc/files/lintpkgsrc.pl   Sun Aug 14 03:18:36 2022 +0000
@@ -1,5 +1,5 @@
 #!@PERL5@
-# $NetBSD: lintpkgsrc.pl,v 1.90 2022/08/14 03:12:02 rillig Exp $
+# $NetBSD: lintpkgsrc.pl,v 1.91 2022/08/14 03:18:36 rillig Exp $
 
 # Written by David Brownlee <abs%netbsd.org@localhost>.
 #
@@ -1191,6 +1191,7 @@
                }
 
                verbose("checksum mismatches\n");
+               my $prev_cwd = getcwd() or die;
                chdir_or_fail($pkgdistdir);
                foreach my $sum (keys %sumfiles) {
                        if ($sum eq 'Size') {
@@ -1225,7 +1226,7 @@
                        waitpid($pid, 0) || fail "xargs digest $sum";
                        waitpid($pid2, 0) || fail 'pipe write to xargs';
                }
-               chdir_or_fail('/'); # Do not want to stay in $pkgdistdir
+               chdir_or_fail($prev_cwd);
        }
 
        sort keys %unref_distfiles;



Home | Main Index | Thread Index | Old Index