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
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
%
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)
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
> 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...
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.
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.