[hackers] [sbase] build: Fix sbase-box-install target || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Tue, 12 Mar 2024 17:14:47 +0100 (CET)

commit ac6d382515327bf0bf14d5d355d33ceffddc7fd7
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Tue Mar 12 17:11:35 2024 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Tue Mar 12 17:11:35 2024 +0100

    build: Fix sbase-box-install target
    
    The target tried to execute a non valid shell script
    and there was a possibility to fatorize the creation
    of the proto file instead of repeating it in all
    the actions that required.

diff --git a/Makefile b/Makefile
index 8cfd981..e3b6936 100644
--- a/Makefile
+++ b/Makefile
_AT_@ -220,18 +220,19 @@ getconf.o: getconf.h
 getconf.h:
         scripts/getconf.sh > $_AT_
 
-install uninstall:
+proto: $(BIN)
         scripts/mkproto $(DESTDIR)$(PREFIX) $(DESTDIR)$(MANPREFIX) proto
- scripts/$_AT_ proto
 
-sbase-box-install: sbase-box
- scripts/mkproto $(DESTDIR)$(PREFIX) $(DESTDIR)$(MANPREFIX) proto
+install uninstall: proto
         scripts/$_AT_ proto
+
+sbase-box-install: sbase-box proto
+ scripts/install proto
         $(DESTDIR)$(PREFIX)/bin/sbase-box -i $(DESTDIR)$(PREFIX)/bin/
 
-sbase-box-uninstall: sbase-box
+sbase-box-uninstall: sbase-box proto
         $(DESTDIR)$(PREFIX)/bin/sbase-box -d $(DESTDIR)$(PREFIX)/bin/
- $(MAKE) uninstall
+ scripts/uninstall proto
 
 dist: clean
         mkdir -p sbase-$(VERSION)
diff --git a/scripts/mkbox b/scripts/mkbox
index db2bdb9..99e4044 100755
--- a/scripts/mkbox
+++ b/scripts/mkbox
_AT_@ -61,6 +61,7 @@ install(char *path)
                                 bp->name);
                         exit(1);
                 }
+ remove(fname);
                 if (symlink("sbase-box", fname) < 0) {
                         fprintf(stderr,
                                 "sbase-box: %s: %s\n",
Received on Tue Mar 12 2024 - 17:14:47 CET

This archive was generated by hypermail 2.3.0 : Tue Mar 12 2024 - 17:24:37 CET