9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] git: install rc scripts into /rc/bin/git/
@ 2022-07-14 20:32 an2qzavok
  2022-07-14 20:52 ` Jacob Moody
  0 siblings, 1 reply; 7+ messages in thread
From: an2qzavok @ 2022-07-14 20:32 UTC (permalink / raw)
  To: 9front

rc script files should probably be installed to rc directory.

Unfortunately, cleaning up files already installed in /$objtype is
left as an exercise for the reader.

diff ce2ad9701d018dcff87ecabf1038bb202ea39a50 uncommitted
--- a/sys/src/cmd/git/mkfile
+++ b/sys/src/cmd/git/mkfile
@@ -1,6 +1,7 @@
 </$objtype/mkfile
 
 BIN=/$objtype/bin/git
+RCBIN=/rc/bin/git
 TARG=\
 	conf\
 	get\
@@ -45,7 +46,7 @@
 
 # Override install target to install rc.
 install:V:
-	mkdir -p $BIN
+	mkdir -p $BIN $RCBIN
 	mkdir -p /sys/lib/git
 	for (i in $TARG)
 		mk $MKFLAGS $i.install
@@ -53,5 +54,5 @@
 		mk $MKFLAGS $i.rcinstall
 
 %.rcinstall:V:
-	cp $stem $BIN/$stem
-	chmod +x $BIN/$stem
+	cp $stem $RCBIN/$stem
+	chmod +x $RCBIN/$stem


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9front] git: install rc scripts into /rc/bin/git/
  2022-07-14 20:32 [9front] git: install rc scripts into /rc/bin/git/ an2qzavok
@ 2022-07-14 20:52 ` Jacob Moody
  2022-07-14 21:33   ` an2qzavok
  0 siblings, 1 reply; 7+ messages in thread
From: Jacob Moody @ 2022-07-14 20:52 UTC (permalink / raw)
  To: 9front

On 7/14/22 14:32, an2qzavok@gmail.com wrote:
> rc script files should probably be installed to rc directory.
> 
> Unfortunately, cleaning up files already installed in /$objtype is
> left as an exercise for the reader.
> 
> diff ce2ad9701d018dcff87ecabf1038bb202ea39a50 uncommitted
> --- a/sys/src/cmd/git/mkfile
> +++ b/sys/src/cmd/git/mkfile
> @@ -1,6 +1,7 @@
>  </$objtype/mkfile
>  
>  BIN=/$objtype/bin/git
> +RCBIN=/rc/bin/git
>  TARG=\
>  	conf\
>  	get\
> @@ -45,7 +46,7 @@
>  
>  # Override install target to install rc.
>  install:V:
> -	mkdir -p $BIN
> +	mkdir -p $BIN $RCBIN
>  	mkdir -p /sys/lib/git
>  	for (i in $TARG)
>  		mk $MKFLAGS $i.install
> @@ -53,5 +54,5 @@
>  		mk $MKFLAGS $i.rcinstall
>  
>  %.rcinstall:V:
> -	cp $stem $BIN/$stem
> -	chmod +x $BIN/$stem
> +	cp $stem $RCBIN/$stem
> +	chmod +x $RCBIN/$stem
> 

Did you test this? This doesn't seem like it
would work at all to me. Unions on plan9 are not
deep, if two directories are unioned together
then subdirectories are "either or" based
on if -b or -a was passed. So if you have
both /$objtype/bin/git and /rc/bin/git,
for how /bin is usually binded, one will
take precedence over the other. You can
see for yourself:

% ramfs
% mkdir /tmp/fakebin
% mkdir /tmp/fakebin/git
% touch /tmp/fakebin/git/FILE
% ls /bin/git
/bin/git/add
/bin/git/branch
/bin/git/clone
...
%

# bind before; our new git subdir takes precedence
% bind -b /tmp/fakebin /bin
% ls /bin/git
/bin/git/FILE
% unmount /tmp/fakebin /bin

# bind after; existing git subdir is kept
% bind -a /tmp/fakebin /bin
% ls /bin/git | grep FILE
%

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9front] git: install rc scripts into /rc/bin/git/
  2022-07-14 20:52 ` Jacob Moody
@ 2022-07-14 21:33   ` an2qzavok
  2022-07-14 23:02     ` Jacob Moody
  0 siblings, 1 reply; 7+ messages in thread
From: an2qzavok @ 2022-07-14 21:33 UTC (permalink / raw)
  To: 9front


Quoth Jacob Moody <moody@mail.posixcafe.org>:

> Did you test this? This doesn't seem like it
> would work at all to me. Unions on plan9 are not
> deep, if two directories are unioned together
> then subdirectories are "either or" based
> on if -b or -a was passed. So if you have
> both /$objtype/bin/git and /rc/bin/git,
> for how /bin is usually binded, one will
> take precedence over the other.

I indeed did not test this, only checked that `mk install` runs without complaining.

I apologize for the noise.

(resending this, because I think google ate my previous mail)


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9front] git: install rc scripts into /rc/bin/git/
  2022-07-14 21:33   ` an2qzavok
@ 2022-07-14 23:02     ` Jacob Moody
  2022-07-15  0:03       ` umbraticus
  0 siblings, 1 reply; 7+ messages in thread
From: Jacob Moody @ 2022-07-14 23:02 UTC (permalink / raw)
  To: 9front

On 7/14/22 15:33, an2qzavok@gmail.com wrote:
> 
> Quoth Jacob Moody <moody@mail.posixcafe.org>:
> 
>> Did you test this? This doesn't seem like it
>> would work at all to me. Unions on plan9 are not
>> deep, if two directories are unioned together
>> then subdirectories are "either or" based
>> on if -b or -a was passed. So if you have
>> both /$objtype/bin/git and /rc/bin/git,
>> for how /bin is usually binded, one will
>> take precedence over the other.
> 
> I indeed did not test this, only checked that `mk install` runs without complaining.
> 
> I apologize for the noise.

No worries. You thought you had found a bug
and went through the effort of fixing it and sending it out.
I appreciate the effort.


---
moody

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9front] git: install rc scripts into /rc/bin/git/
  2022-07-14 23:02     ` Jacob Moody
@ 2022-07-15  0:03       ` umbraticus
  2022-07-15  1:04         ` Stuart Morrow
  0 siblings, 1 reply; 7+ messages in thread
From: umbraticus @ 2022-07-15  0:03 UTC (permalink / raw)
  To: 9front

> Unions on plan9 are not deep

Perhaps this is a good moment to wonder aloud whether
something like https://git.sr.ht/~kvik/unionfs should
find its way into the system...

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9front] git: install rc scripts into /rc/bin/git/
  2022-07-15  0:03       ` umbraticus
@ 2022-07-15  1:04         ` Stuart Morrow
  2022-07-15  1:22           ` ori
  0 siblings, 1 reply; 7+ messages in thread
From: Stuart Morrow @ 2022-07-15  1:04 UTC (permalink / raw)
  To: 9front

On 15/07/2022, umbraticus@prosimetrum.com <umbraticus@prosimetrum.com> wrote:
>> Unions on plan9 are not deep
>
> Perhaps this is a good moment to wonder aloud whether
> something like https://git.sr.ht/~kvik/unionfs should

If it's really so important to keep rc scripts out of /$cputype, there
is another way:

Let /bin/git be /rc/bin/git.
/$cputype/bin/git doesn't exist; binaries live in aux/git/  (note
trailing slash).
/rc/bin/git is populated with wrapper pointers to the binaries.
The binaries could be modified to be run directly from the #! line.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9front] git: install rc scripts into /rc/bin/git/
  2022-07-15  1:04         ` Stuart Morrow
@ 2022-07-15  1:22           ` ori
  0 siblings, 0 replies; 7+ messages in thread
From: ori @ 2022-07-15  1:22 UTC (permalink / raw)
  To: 9front

Quoth Stuart Morrow <morrow.stuart@gmail.com>:
> On 15/07/2022, umbraticus@prosimetrum.com <umbraticus@prosimetrum.com> wrote:
> >> Unions on plan9 are not deep
> >
> > Perhaps this is a good moment to wonder aloud whether
> > something like https://git.sr.ht/~kvik/unionfs should
> 
> If it's really so important to keep rc scripts out of /$cputype, there
> is another way:
> 
> Let /bin/git be /rc/bin/git.
> /$cputype/bin/git doesn't exist; binaries live in aux/git/  (note
> trailing slash).
> /rc/bin/git is populated with wrapper pointers to the binaries.
> The binaries could be modified to be run directly from the #! line.

There were a few options I considered to keep rc scripts out
of $cputype, none really seemed worth the effort.



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-07-15  1:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-14 20:32 [9front] git: install rc scripts into /rc/bin/git/ an2qzavok
2022-07-14 20:52 ` Jacob Moody
2022-07-14 21:33   ` an2qzavok
2022-07-14 23:02     ` Jacob Moody
2022-07-15  0:03       ` umbraticus
2022-07-15  1:04         ` Stuart Morrow
2022-07-15  1:22           ` ori

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 NNTP newsgroup(s).