~habibalamin

Trackers

~habibalamin/flock-proxy

Last active 2 years ago

#14 Cross-platform Makefile 3 months ago

Comment by ~habibalamin on ~emersion/hut

#14 Cross-platform Makefile 3 months ago

Comment by ~habibalamin on ~emersion/hut

Combined diff:

diff -ru a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -36,14 +36,14 @@
 	$(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) \
 		$(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

This fixes the issue on BSD install (macOS 12.1), and though it should work on GNU install as well, given the assumptions above hold, I haven't tested this on GNU install.

#14 Cross-platform Makefile 3 months ago

Comment by ~habibalamin on ~emersion/hut

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.

Again, the fix seems simple enough:

diff --git a/Makefile b/Makefile
index 07947a0..5ab2588 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

#14 Cross-platform Makefile 3 months ago

Comment by ~habibalamin on ~emersion/hut

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

This is probably 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 no, 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.

Assuming I read the -p flag documentation correctly, the fix seems simple enough:

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 Cached responses are never renewed 2 years ago

Ticket created by ~habibalamin on ~habibalamin/flock-proxy

#1 Cache leaks memory 2 years ago

Ticket created by ~habibalamin on ~habibalamin/flock-proxy