9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Error when trying to install contrib/install
@ 2023-02-22  8:00 quiekaizam via 9fans
  2023-02-24  7:45 ` Anthony Sorace
  0 siblings, 1 reply; 4+ messages in thread
From: quiekaizam via 9fans @ 2023-02-22  8:00 UTC (permalink / raw)
  To: 9fans

Poking around with Plan 9 for the first time ever, so forgive the PEBKACiness.

Trying to get the contrib/install command installed, running

    % 9fs sources
    % mkdir -p /dist/replica/client
    % /n/sources/contrib/fgb/root/rc/bin/contrib/install fgb/contrib

However, it immediately fails with an error:

    test: unexpected operator/operand: -w
    cannot write in /dist/replica

It looks like that's coming from line 43:

    if(! test -d /dist/replica -w)

Indeed, my test(1) doesn't seem to support such syntax. Is this a version
problem? Any pointers would be appreciated.

Obligatory version information:

    % Last build and install from here
    % cat /dist/plan9front/.git/refs/heads/front
    c6a92afc...


- B. Wilson

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

* Re: [9fans] Error when trying to install contrib/install
  2023-02-22  8:00 [9fans] Error when trying to install contrib/install quiekaizam via 9fans
@ 2023-02-24  7:45 ` Anthony Sorace
  2023-02-24 12:33   ` Alex Musolino
  0 siblings, 1 reply; 4+ messages in thread
From: Anthony Sorace @ 2023-02-24  7:45 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 833 bytes --]

On Feb 22, 2023, at 00:02, quiekaizam via 9fans <9fans@9fans.net> wrote:
> 
> Indeed, my test(1) doesn't seem to support such syntax. Is this a version problem?

I believe so, yes. It looks like 9front has made some significant changes to (or removed? I didn’t dig in) test’s handling of “implied” -a and -o operands. 

For comparison, see:
https://9p.io/sources/plan9/sys/src/cmd/test.c
http://git.9front.org/plan9front/plan9front/e6c6217b35c319127f0200fdb28ec86e1b774a4f/sys/src/cmd/test.c/f.html

I would suggest compiling the plan9 version locally and seeing if that fixes the issue.
------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T23b7964cf6e8776e-M0bae6a73a226a2a612a81a32
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

[-- Attachment #2: Type: text/html, Size: 1824 bytes --]

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

* Re: [9fans] Error when trying to install contrib/install
  2023-02-24  7:45 ` Anthony Sorace
@ 2023-02-24 12:33   ` Alex Musolino
  2023-02-24 13:43     ` ori
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Musolino @ 2023-02-24 12:33 UTC (permalink / raw)
  To: 9fans

> I believe so, yes.  It looks like 9front has made some significant
> changes to (or removed?  I didn’t dig in) test’s handling of
> “implied” -a and -o operands.

Test(1) was changed for 9front because the old test(1) was broken.  It
does not have any sort of "implied" -a or -o operands.  Actually, it
silently ignores what comes after the first expression if there is no
-o or -a to combine it with other expressions.

The specific example from fgb's contrib/install script is doubly wrong
since there's no argument supplied to the -w option.  I guess because
old test(1) doesn't complain, people may have assumed that this syntax
was a cute way to check that a directory exists *and* that it is
writable.  Ratrace(1), however, will show you that the old test(1)
only does one stat(5) syscall in this case and, in fact, calls
exits(0) regardless of whether the directory is writable or not.

The new test(1) in 9front passes the following test suite, which is
mostly stolen from something the OpenBSD folks had used to test their
own test(1) program:

http://git.9front.org/plan9front/regress/717df14acac498bfb4496066a60c1ae83e93d9b7/cmd/test.rc/f.html

> I would suggest compiling the plan9 version locally and seeing if
> that fixes the issue.

That will probably get you by, but I'd say the contrib/install script
should be fixed also.

--
Cheers,
Alex Musolino


------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T23b7964cf6e8776e-Mdbb0237c5d0d5fa0441d5e2e
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

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

* Re: [9fans] Error when trying to install contrib/install
  2023-02-24 12:33   ` Alex Musolino
@ 2023-02-24 13:43     ` ori
  0 siblings, 0 replies; 4+ messages in thread
From: ori @ 2023-02-24 13:43 UTC (permalink / raw)
  To: 9fans

Quoth Alex Musolino <alex@musolino.id.au>:
> The new test(1) in 9front passes the following test suite, which is
> mostly stolen from something the OpenBSD folks had used to test their
> own test(1) program:
> 
> http://git.9front.org/plan9front/regress/717df14acac498bfb4496066a60c1ae83e93d9b7/cmd/test.rc/f.html
>

quick note -- the regression tests are moving into the 9front repo,
instead of living on their own;

https://git.9front.org/plan9front/plan9front/HEAD/sys/src/cmd/test/test.rc/f.html

so, 'mk test' should test it out of the box.


------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T23b7964cf6e8776e-Mb7e3026445d325472c627a99
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

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

end of thread, other threads:[~2023-02-24 13:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-22  8:00 [9fans] Error when trying to install contrib/install quiekaizam via 9fans
2023-02-24  7:45 ` Anthony Sorace
2023-02-24 12:33   ` Alex Musolino
2023-02-24 13:43     ` 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).