public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: William Hu <purplearmadillo77@proton.me>
To: Jon Turney <jon.turney@dronecode.org.uk>
Cc: "cygwin-apps@cygwin.com" <cygwin-apps@cygwin.com>
Subject: Re: Cygport Bug: "find: No such file" Errors When Packaging
Date: Sun, 02 Oct 2022 20:49:17 +0000	[thread overview]
Message-ID: <_pSvDjVpHcqGBZuFHsXs6DrWlNOAtZ9cmYrKJ_Hmm96KOpEgvVgj-8ptZa7-OV5gLVJ_mU4nmqmR455wEEfTv08UrRjCzCDvlWxRF1JfUFs=@proton.me> (raw)
In-Reply-To: <36e04564-451e-f569-4f08-6dd79901b87c@dronecode.org.uk>

[-- Attachment #1: Type: text/plain, Size: 740 bytes --]

Hi Jon,

> This change is probably safe and does what you say, but it looks like it
> could potentially misbehave when ${mldir} doesn't exist, but
> ${D}/${mldir} does (a situation which probably can't occur, as it
> doesn't seem to make sense to build ocaml libraries when ocaml isn't
> installed?)

Sorry for the delay - I fell ill but I'm better now. You make a very good 
point which was actually the edge case I initially intended to fix. Thanks 
for the catch!

> In future, please try to use git-format-patch, if possible, as that
> saves me having to write patch commentary, and ensures correct patch
> attribution.

Patch attached. Please let me know if I did it properly (first time using 
git format).

William

[-- Attachment #2: 0001-Fix-find-errors-for-nonexistent-mldir.patch --]
[-- Type: application/octet-stream, Size: 1133 bytes --]

From bc6be2bb4bcb94a7331db61fe7c174648aa44dbf Mon Sep 17 00:00:00 2001
From: William Hu <purplearmadillo77@proton.me>
Date: Sun, 2 Oct 2022 16:20:35 -0400
Subject: [PATCH] Fix find errors for nonexistent ${mldir}

---
 lib/pkg_info.cygpart | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/pkg_info.cygpart b/lib/pkg_info.cygpart
index 4c51483..c399cc5 100644
--- a/lib/pkg_info.cygpart
+++ b/lib/pkg_info.cygpart
@@ -364,13 +364,18 @@ __list_deps() {
 	if check_prog ocamlc.opt
 	then
 		mldir=$(ocamlc.opt -where)
+		sys_mldir=$mldir
+		if [ ! -d ${sys_mldir} ]
+		then
+			sys_mldir=""
+		fi
 		if [ -d ${D}${mldir} ]
 		then
-			for cma in $(find ${D}${mldir} ${mldir} -name '*.cma')
+			for cma in $(find ${D}${mldir} ${sys_mldir} -name '*.cma')
 			do
 				ocamlobjinfo $cma | sed -nr "s#(Unit|Module) name: #$cma:#p"
 			done > ${T}/.cmaobjinfo.out
-			for cmxa in $(find ${D}${mldir} ${mldir} -name '*.cmxa')
+			for cmxa in $(find ${D}${mldir} ${sys_mldir} -name '*.cmxa')
 			do
 				ocamlobjinfo $cmxa | sed -nr "s#(Unit|Module) name: #$cmxa:#p"
 			done > ${T}/.cmxaobjinfo.out
-- 
2.37.3


      reply	other threads:[~2022-10-02 20:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-15 19:38 William Hu
2022-09-17 12:27 ` Jon Turney
2022-09-17 21:14   ` William Hu
2022-09-18 13:17     ` Jon Turney
2022-10-02 20:49       ` William Hu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='_pSvDjVpHcqGBZuFHsXs6DrWlNOAtZ9cmYrKJ_Hmm96KOpEgvVgj-8ptZa7-OV5gLVJ_mU4nmqmR455wEEfTv08UrRjCzCDvlWxRF1JfUFs=@proton.me' \
    --to=purplearmadillo77@proton.me \
    --cc=cygwin-apps@cygwin.com \
    --cc=jon.turney@dronecode.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).