~emersion/hut-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3 2

[PATCH 0/2] Fix BSD install errors

Details
Message ID
<20220420234856.49833-1-ha.alamin@gmail.com>
DKIM signature
missing
Download raw message
From: Habib Alamin <ha.alamin@gmail.com>

This patchset fixes the Makefile's use of install to be compatible with
BSD install by removing some flags which turned out to be not just
incompatible, but also unnecessary in this case.

I have tested this on macOS 12.1, but not GNU install, so while this
fixes the Makefile for BSD isntall, it's possible it has regressed on
GNU install, but I have outlined the justification for each change in
the respective patch's commit message.

Habib Alamin (2):
  Fix BSD install error when mixing `-d` and `-C` (via `-p`)
  Fix BSD install error when using `-t` option

 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
2.35.1

[PATCH 1/2] Fix BSD install error when mixing `-d` and `-C` (via `-p`)

Details
Message ID
<20220420234856.49833-2-ha.alamin@gmail.com>
In-Reply-To
<20220420234856.49833-1-ha.alamin@gmail.com> (view parent)
DKIM signature
missing
Download raw message
Patch: +1 -1
From: Habib Alamin <ha.alamin@gmail.com>

>```
>install: the -d and -C options may not be specified together
>```

This is because of the `-p` flag on the first `install` command line;

>```
>     -p      Preserve the modification time.  Copy the file, as if the -C
>             (compare and copy) option is specified, except if the target file
>             doesn't already exist or is different, then preserve the
>             modification time of the file.
>```

This reads to me like the target file will have the same modification
time as the source file, so at first, I thought we're copying
directories across and we want to preserve the modification times of the
directories, but even after a `make`, the directories being installed
don't exist in the repo directory, they're just being created directly
on the target path. Using the `-p` flag is just pointless in this case.
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 07947a0..5565e63 100644
--- a/Makefile
+++ b/Makefile
@@ -36,7 +36,7 @@ clean:
	$(RM) -f hut doc/hut.1 hut.bash hut.zsh hut.fish

install:
	$(INSTALL) -dp \
	$(INSTALL) -d \
		$(DESTDIR)$(PREFIX)/$(BINDIR)/ \
		$(DESTDIR)$(PREFIX)/$(MANDIR)/man1/ \
		$(DESTDIR)$(BASHCOMPDIR) \
-- 
2.35.1

[PATCH 2/2] Fix BSD install error when using `-t` option

Details
Message ID
<20220420234856.49833-3-ha.alamin@gmail.com>
In-Reply-To
<20220420234856.49833-1-ha.alamin@gmail.com> (view parent)
DKIM signature
missing
Download raw message
Patch: +2 -2
From: Habib Alamin <ha.alamin@gmail.com>

>```
>install: -t: No such file or directory
>```

BSD install doesn't have the `-t` option, but according to the GNU info
page for `install`:

>```
>   • If the ‘--target-directory’ (‘-t’) option is given, or failing that
>     if the last file is a directory and the ‘--no-target-directory’
>     (‘-T’) option is not given, ‘install’ copies each SOURCE file to
>     the specified directory, using the SOURCEs’ names.
>```

The directories are strictly specified with a trailing slash, and I
suspect if the directory didn't exist, GNU install would still treat
it as a directory and complain about it being missing. That said, we
don't need to rely on that because the previous line which gives us the
error about combining `-C` and `-d` is exactly the line that creates the
required directories.
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 5565e63..90ddaef 100644
--- a/Makefile
+++ b/Makefile
@@ -42,8 +42,8 @@ install:
		$(DESTDIR)$(BASHCOMPDIR) \
		$(DESTDIR)$(ZSHCOMPDIR) \
		$(DESTDIR)$(FISHCOMPDIR)
	$(INSTALL) -pm 0755 hut -t $(DESTDIR)$(PREFIX)/$(BINDIR)/
	$(INSTALL) -pm 0644 doc/hut.1 -t $(DESTDIR)$(PREFIX)/$(MANDIR)/man1/
	$(INSTALL) -pm 0755 hut $(DESTDIR)$(PREFIX)/$(BINDIR)/
	$(INSTALL) -pm 0644 doc/hut.1 $(DESTDIR)$(PREFIX)/$(MANDIR)/man1/
	$(INSTALL) -pm 0644 hut.bash $(DESTDIR)$(BASHCOMPDIR)/hut
	$(INSTALL) -pm 0644 hut.zsh $(DESTDIR)$(ZSHCOMPDIR)/_hut
	$(INSTALL) -pm 0644 hut.fish $(DESTDIR)$(FISHCOMPDIR)/hut.fish
-- 
2.35.1

Re: [PATCH 2/2] Fix BSD install error when using `-t` option

Details
Message ID
<xzN54hHgxJujyLDi9n5CpJL__Qq5IPJZnMdlXsMMg7d6gJo6c3lizPUGW469gkoQdtroBWAaWWLUsZRJ0vboXjFU6C-D2rtEbfs_xg2TI0I=@emersion.fr>
In-Reply-To
<20220420234856.49833-3-ha.alamin@gmail.com> (view parent)
DKIM signature
missing
Download raw message
Seems like this doesn't regress with GNU tools. Both patches pushed, thanks!
Reply to thread Export thread (mbox)