Re: [hackers] [sbase][PATCH] ed: Allow newlines in a Substitute Command

2023-11-14 Thread Roberto E. Vargas Caballero
Hi,

On Sun, Nov 05, 2023 at 02:38:20PM +0100, Rene Kita wrote:
> On Fri, Nov 03, 2023 at 01:32:37PM +0100, Rene Kita wrote:
> > borked patch
> 
> Patch is not sufficient, sorry for the noise.

I have this problem in my radar. I began to write a solution for it,
but I had to switch to implement bc(1) that I hope I will submit soon.
I think the way to fix this problem is reading the full command before
executing it, otherwise there are so many traps. I am going to try to
fix this in th enext days.

Regards,



Re: [hackers] [sbase] TODO: add replacement bug reported for ed || Hiltjo Posthuma

2023-11-14 Thread Roberto E. Vargas Caballero
Applied, thanks.



Re: [hackers] [PATCH] find: Make parameter error messages more specific

2023-11-14 Thread Roberto E. Vargas Caballero
Applied, thanks.



Re: [hackers] [PATCH 2/2] scripts: Fix non-portable find -perm /mode

2023-11-14 Thread Roberto E. Vargas Caballero
Applied, thanks.



Re: [hackers] [PATCH 1/2] scripts: Fix non-portable usage of find -maxdepth

2023-11-14 Thread Roberto E. Vargas Caballero
Applied, thanks.



Re: [hackers] [PATCH] scripts: Force file copying on install

2023-11-14 Thread Roberto E. Vargas Caballero
Applied, thanks.



Re: [hackers] [PATCH] make: fix rogue parameter in install target

2023-11-14 Thread Roberto E. Vargas Caballero
Applied, thanks.



[hackers] [sbase] scripts: Fix non-portable find -perm /mode || Quentin Rameau

2023-11-14 Thread git
commit 870b26af8eb58e98b8564561ebec8500165c593f
Author: Quentin Rameau 
AuthorDate: Sun Oct 29 12:28:37 2023 +0100
Commit: k0ga 
CommitDate: Tue Nov 14 19:35:23 2023 +0100

scripts: Fix non-portable find -perm /mode

diff --git a/scripts/mkproto b/scripts/mkproto
index ab0ade4..192fe56 100755
--- a/scripts/mkproto
+++ b/scripts/mkproto
@@ -14,7 +14,7 @@ trap "rm -f scripts/proto" EXIT INT QUIT TERM
 
 (set -e
 echo d $prefix/bin $prefix/bin 755
-find . ! -name . -prune -type f -perm /111 |
+find . ! -name . -prune -type f \( -perm -u+x -o -perm -g+x -o -perm o+x \) |
 sed "s@.*@c & $prefix/bin/& 755@"
 
 echo d $manprefix/man1 $manprefix/man1 755



[hackers] [sbase] scripts: Fix non-portable usage of find -maxdepth || Quentin Rameau

2023-11-14 Thread git
commit f496998f4f621bc2b96f972176d32efc2dd259f7
Author: Quentin Rameau 
AuthorDate: Sun Oct 29 12:28:36 2023 +0100
Commit: k0ga 
CommitDate: Tue Nov 14 19:35:03 2023 +0100

scripts: Fix non-portable usage of find -maxdepth

diff --git a/scripts/mkproto b/scripts/mkproto
index 0b2deb3..ab0ade4 100755
--- a/scripts/mkproto
+++ b/scripts/mkproto
@@ -14,11 +14,11 @@ trap "rm -f scripts/proto" EXIT INT QUIT TERM
 
 (set -e
 echo d $prefix/bin $prefix/bin 755
-find . -maxdepth 1 -type f -perm /111 |
+find . ! -name . -prune -type f -perm /111 |
 sed "s@.*@c & $prefix/bin/& 755@"
 
 echo d $manprefix/man1 $manprefix/man1 755
-find . -maxdepth 1 -name '*.1' |
+find . ! -name . -prune -name '*.1' |
 sed "s@.*@c & $manprefix/man1/& 644@") > $proto
 
 trap "" EXIT INT QUIT TERM



[hackers] [sbase] find: Make parameter error messages more specific || Quentin Rameau

2023-11-14 Thread git
commit 4cf7643094e76bab00c5ba370effca3e72f2c7ba
Author: Quentin Rameau 
AuthorDate: Sun Oct 29 12:46:47 2023 +0100
Commit: k0ga 
CommitDate: Tue Nov 14 19:36:18 2023 +0100

find: Make parameter error messages more specific

Differenciate option operands from path operands
when an error is detected on the command line parameters.

diff --git a/find.c b/find.c
index d4d7864..ef28232 100644
--- a/find.c
+++ b/find.c
@@ -809,8 +809,12 @@ parse(int argc, char **argv)
}
tok->type = op->type;
tok->u.oinfo = op;
-   } else { /* token is neither primary nor operator, must be path 
in the wrong place */
-   eprintf("paths must precede expression: %s\n", *arg);
+   } else {
+   /* token is neither primary nor operator, must be */
+   if ((*arg)[0] == '-') /* an unsupported option */
+   eprintf("unknown operand: %s\n", *arg);
+   else /* or a path in the wrong place */
+   eprintf("paths must precede expression: %s\n", 
*arg);
}
if (tok->type != LPAR && tok->type != RPAR)
ntok++; /* won't have parens in rpn */



[hackers] [sbase] make: fix rogue parameter in install target || Quentin Rameau

2023-11-14 Thread git
commit c31af02d2231704f54ec2286ad1a71dc9fe3bdff
Author: Quentin Rameau 
AuthorDate: Sun Oct 29 09:57:15 2023 +0100
Commit: k0ga 
CommitDate: Tue Nov 14 19:34:08 2023 +0100

make: fix rogue parameter in install target

diff --git a/Makefile b/Makefile
index 8da0106..95bb21d 100644
--- a/Makefile
+++ b/Makefile
@@ -219,11 +219,11 @@ getconf.h:
scripts/getconf.sh > $@
 
 install uninstall:
-   scripts/mkproto $@ $(DESTDIR)$(PREFIX) $(DESTDIR)$(MANPREFIX) proto
+   scripts/mkproto $(DESTDIR)$(PREFIX) $(DESTDIR)$(MANPREFIX) proto
scripts/$@ proto
 
 sbase-box-install: sbase-box
-   scripts/mkproto $@ $(DESTDIR)$(PREFIX) $(DESTDIR)$(MANPREFIX) proto
+   scripts/mkproto $(DESTDIR)$(PREFIX) $(DESTDIR)$(MANPREFIX) proto
scripts/$@ proto
$(DESTDIR)$(PREFIX)/bin/sbase-box -i $(DESTDIR)$(PREFIX)/bin/
 



[hackers] [sbase] scripts: Force file copying on install || Quentin Rameau

2023-11-14 Thread git
commit 6fc6bbbf7141533ef8506ae8085eef594b2345fe
Author: Quentin Rameau 
AuthorDate: Sun Oct 29 11:32:50 2023 +0100
Commit: k0ga 
CommitDate: Tue Nov 14 19:34:27 2023 +0100

scripts: Force file copying on install

This would otherwise cause an issue using cp to copy cp to itself.

diff --git a/scripts/install b/scripts/install
index b391715..ce78c1d 100755
--- a/scripts/install
+++ b/scripts/install
@@ -9,7 +9,7 @@ do
mkdir -p $src
;;
c)
-   cp $src $dst
+   cp -f $src $dst
;;
*)
echo install: wrong entry type >&2