From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.1 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 28E1F1F403; Wed, 13 Jun 2018 02:07:59 +0000 (UTC) Date: Wed, 13 Jun 2018 02:07:59 +0000 From: Eric Wong To: Leah Neukirchen Cc: meta@public-inbox.org Subject: [PATCH] Makefile.PL: do not depend on git Message-ID: <20180613020759.cpl2ewenermewylw@dcvr> References: <871sdfzy80.fsf@gmail.com> <20180612100915.shfo3ltn6aj55mrf@dcvr> <8736xsb5s5.fsf@vuxu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8736xsb5s5.fsf@vuxu.org> List-Id: Leah Neukirchen wrote: > Eric Wong writes: > > been trying to avoid being at the computer too much for health > > reasons. > > No problem, get well soon. Thanks, but they're more preventative measures than anything. > >> 1) Makefile.PL only works properly when run from a checkout, not a tarball. > >> I replaced the beginning with > >> > >> my @EXE_FILES = split("\n", `printf '%s\n' script/* 2>/dev/null`); > >> my $PM_FILES = `find lib 2>/dev/null`; > > > > Thanks, I'd probably add "-name '*.pm'" to find(1) to filter out > > directories. But I wonder if it's better to grep the MANIFEST > > file... > > Yes, using MANIFEST is a better solution. OK, will push this out: ---------8<------- Subject: [PATCH] Makefile.PL: do not depend on git Otherwise, things do not work from a tarball distribution. Reported-by: Leah Neukirchen https://public-inbox.org/meta/871sdfzy80.fsf@gmail.com/ --- Makefile.PL | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index a47e17b..027c3e6 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -3,9 +3,10 @@ # License: AGPL-3.0+ use strict; use ExtUtils::MakeMaker; -my @EXE_FILES = split("\n", `git ls-files 'script/*' 2>/dev/null`); -my $PM_FILES = `git ls-files lib '*.pm' 2>/dev/null`; -$PM_FILES =~ tr/\n/ /; +open my $m, '<', 'MANIFEST' or die "open(MANIFEST): $!\n"; +chomp(my @manifest = (<$m>)); +my @EXE_FILES = grep(m!^script/!, @manifest); +my $PM_FILES = join(' ', grep(m!^lib/.*\.pm$!, @manifest)); WriteMakefile( NAME => 'PublicInbox', -- EW