From owner-freebsd-x11@freebsd.org Thu Aug 2 06:16:01 2018 Return-Path: Delivered-To: freebsd-x11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 938821059A8A for ; Thu, 2 Aug 2018 06:16:01 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 4D8E075675 for ; Thu, 2 Aug 2018 06:16:01 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 0FD5A1059A85; Thu, 2 Aug 2018 06:16:01 +0000 (UTC) Delivered-To: x11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C908A1059A84 for ; Thu, 2 Aug 2018 06:16:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 672037566E for ; Thu, 2 Aug 2018 06:16:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id AF5E024A20 for ; Thu, 2 Aug 2018 06:15:59 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w726FxwE074063 for ; Thu, 2 Aug 2018 06:15:59 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w726FxaU074055 for x11@FreeBSD.org; Thu, 2 Aug 2018 06:15:59 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: x11@FreeBSD.org Subject: [Bug 230287] Mk/Uses/perl5.mk: Check existence of directory before "find" command usage for this directory Date: Thu, 02 Aug 2018 06:15:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: lightside@gmx.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: ports-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status keywords bug_severity priority component assigned_to reporter cc flagtypes.name attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Aug 2018 06:16:01 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D230287 Bug ID: 230287 Summary: Mk/Uses/perl5.mk: Check existence of directory before "find" command usage for this directory Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Keywords: patch Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: ports-bugs@FreeBSD.org Reporter: lightside@gmx.com CC: mat@FreeBSD.org, perl@FreeBSD.org, vd@FreeBSD.org, x11@FreeBSD.org CC: vd@FreeBSD.org, x11@FreeBSD.org Attachment #195755 maintainer-approval?(perl@FreeBSD.org) Flags: CC: perl@FreeBSD.org Created attachment 195755 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D195755&action= =3Dedit Proposed patch (since 473539 revision) Hello. I noticed, that some ports, which have USES+=3Dperl5 (and USE_PERL5=3Dbuild= ), started to report about non existing "<..>/work/stage/usr/local/lib/perl5/site_perl" directory, when using some "find" command. For example, x11-servers/xorg-server port: -8<-- # cd /usr/ports/x11-servers/xorg-server # make stage <..> find: /usr/ports/x11-servers/xorg-server/work/stage/usr/local/lib/perl5/site_perl= : No such file or directory install -s -m 0644 /usr/ports/x11-servers/xorg-server/work/xorg-server-1.18.4/hw/xfree86/dixmo= ds/.libs/libglx.so /usr/ports/x11-servers/xorg-server/work/stage/usr/local/lib/xorg/modules/ex= tensions/.xorg/ <..> # make clean =3D=3D=3D> Cleaning for xorg-server-1.18.4_9,1 -->8- ftp/wget port: -8<-- # cd /usr/ports/ftp/wget # make stage <..> Making install in testenv find: /usr/ports/wget/work/stage/usr/local/lib/perl5/site_perl: No such fil= e or directory =3D=3D=3D=3D> Compressing man pages (compress-man) <..> # make clean =3D=3D=3D> Cleaning for wget-1.19.5 -->8- I found, that this is because of ports r473539 changes, which added removal= of README.pod files, if they exists in "${STAGEDIR}${PREFIX}/${SITE_PERL_REL}" directory. I propose to add some check for "${STAGEDIR}${PREFIX}/${SITE_PERL_REL}" directory before find command usage for this directory: -8<-- @[ -d "${STAGEDIR}${PREFIX}/${SITE_PERL_REL}" ] && \ ${FIND} ${STAGEDIR}${PREFIX}/${SITE_PERL_REL} -name README.pod -del= ete || : -->8- Similar to what was used for "${STAGEDIR}${SITE_MAN3}" directory: https://svnweb.freebsd.org/ports/head/Mk/Uses/perl5.mk?view=3Dmarkup&pathre= v=3D473539#l306 -8<-- @[ -d "${STAGEDIR}${SITE_MAN3}" ] && \ ${FIND} ${STAGEDIR}${SITE_MAN3} -name '*::README.3' -delete || : -->8- How to check: % [ -d "/usr/ports" ] && echo exists || echo not exists exists % find /usr/ports -maxdepth 1 -name Makefile /usr/ports/Makefile % cd /usr/ports && find * -maxdepth 0 -name Makefile Makefile % [ -d "/usr/ports/nonexistent" ] && echo exists || echo not exists not exists % find /usr/ports/nonexistent -maxdepth 1 -name Makefile find: /usr/ports/nonexistent: No such file or directory % [ -d "/usr/ports/nonexistent" ] && find /usr/ports/nonexistent -maxdepth 1 -name Makefile Also possible to redirect message about non-existing directory to /dev/null: % sh -c "find /usr/ports/nonexistent -maxdepth 1 -name Makefile 2>/dev/null" % sh -c "cd /usr/ports/nonexistent 2>/dev/null && find * -maxdepth 0 -name Makefile" CC: mat@ --=20 You are receiving this mail because: You are on the CC list for the bug.=