-
Notifications
You must be signed in to change notification settings - Fork 79
Added support for fifos and sockets (#42) #204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 10 commits
375bfed
65a62aa
a1cad0f
0f1f759
2bf8a53
e3bc7fa
98bc6dc
abe8f9d
e62bf80
9ecca5b
6e0c845
fbefc3f
21ec4a5
0144546
a22c784
6854cc2
635d883
4911a8a
f9c9cb1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,21 +10,27 @@ AC_ARG_ENABLE([utils], | |
| [don't compile C utilities for summarizing and committing changes (default is yes)])], | ||
| [enable_utils=${enableval}], [enable_utils=yes]) | ||
|
|
||
|
|
||
| AC_REQUIRE_AUX_FILE([utils/make-socket.c]) | ||
|
|
||
| # build tools | ||
| AC_PROG_CC | ||
|
|
||
| # CFLAGS AND CPPFLAGGS | ||
| if test -z "$CFLAGS" | ||
| then | ||
| AUTO_CFLAGS="-g -Wall -O2" | ||
| AUTO_CPPFLAGS="-g -Wall -O2" | ||
|
mgree marked this conversation as resolved.
Outdated
|
||
| else | ||
| AUTO_CFLAGS="" | ||
| AUTO_CPPFLAGS="" | ||
| fi | ||
|
|
||
| if test "$enable_utils" = "yes" | ||
| then | ||
| AC_REQUIRE_AUX_FILE([utils/try-commit.c]) | ||
|
|
||
| # build tools | ||
| AC_PROG_CC | ||
|
|
||
| # CFLAGS and CPPFLAGGS | ||
| if test -z "$CFLAGS" | ||
| then | ||
| AUTO_CFLAGS="-g -Wall -O2" | ||
| else | ||
| AUTO_CFLAGS="" | ||
| fi | ||
| AUTO_CPPFLAGS="" | ||
| AUTO_CPPFLAGS="" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should go now, since we've set it unconditionally above.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this comment is still active---no need to set AUTO_CPPFLAGS here. |
||
|
|
||
| CFLAGS=${CFLAGS-"$AUTO_CFLAGS"} | ||
|
mgree marked this conversation as resolved.
|
||
| CPPFLAGS=${CPPFLAGS-"$AUTO_CPPFLAGS"} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,12 +5,11 @@ TRY_TOP="${TRY_TOP:-$(git rev-parse --show-toplevel --show-superproject-working- | |
| TRY="$TRY_TOP/try" | ||
|
|
||
| cleanup() { | ||
| cd / | ||
| cd / | ||
|
mgree marked this conversation as resolved.
Outdated
|
||
|
|
||
| if [ -d "$try_workspace" ] | ||
| then | ||
| rm -rf "$try_workspace" >/dev/null 2>&1 | ||
| fi | ||
| if [ -d "$try_workspace" ]; then | ||
| rm -rf "$try_workspace" >/dev/null 2>&1 | ||
| fi | ||
| } | ||
|
|
||
| trap 'cleanup' EXIT | ||
|
|
@@ -25,11 +24,10 @@ cd "$try_workspace" || exit 99 | |
|
|
||
| COUNT=0 | ||
| fail() { | ||
| echo Case $COUNT: "$@" | ||
| exit ${COUNT} | ||
| echo Case $COUNT: "$@" | ||
| exit ${COUNT} | ||
| } | ||
|
|
||
|
|
||
| # // TRYCASE(opaque, dir) | ||
| # // TRYCASE(dir, dir) | ||
|
|
||
|
|
@@ -224,3 +222,82 @@ echo arrivederci >formerdir/it/file2 || fail | |
| [ -L formerdir ] || fail | ||
| [ "$(readlink formerdir)" = "/this/is/a/broken/symlink" ] || fail | ||
| rm formerdir || fail | ||
|
|
||
| # // TRYCASE(fifo, file) | ||
|
|
||
| : $((COUNT += 1)) | ||
|
|
||
| ! [ -e newpipe ] || fail | ||
| "$TRY" -y "mkfifo newpipe; rm newpipe; touch newpipe; echo new >newpipe" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does not test the declared case (new file is a fifo, old file is a regular file). |
||
| [ -f newpipe ] || fail | ||
| [ "$(cat newpipe)" = "new" ] || fail | ||
| rm newpipe || fail | ||
|
|
||
| # // TRYCASE(fifo, dir) | ||
|
|
||
| : $((COUNT += 1)) | ||
|
|
||
| ! [ -e newpipe ] || fail | ||
| "$TRY" -y "mkfifo newpipe; rm newpipe; mkdir newpipe" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does not test the declared case---the |
||
| [ -d newpipe ] || fail | ||
| rm -r newpipe | ||
|
|
||
| # // TRYCASE(fifo, symlink) | ||
|
|
||
| : $((COUNT += 1)) | ||
|
|
||
| ! [ -e newpipe ] || fail | ||
| ln -s "$TRY" newpipe | ||
| [ -L newpipe ] || fail | ||
| "$TRY" -y "rm newpipe; mkfifo newpipe" | ||
| [ -p newpipe ] || fail | ||
| rm newpipe | ||
|
|
||
| # // TRYCASE(fifo, nonexist) | ||
|
|
||
| : $((COUNT += 1)) | ||
|
|
||
| ! [ -e newpipe ] || fail | ||
| "$TRY" -y "mkfifo newpipe" | ||
| [ -p newpipe ] || fail | ||
| rm newpipe | ||
|
|
||
| # // TRYCASE(socket, file) | ||
|
|
||
| : $((COUNT += 1)) | ||
|
|
||
| ! [ -e newsock ] || fail | ||
|
mgree marked this conversation as resolved.
|
||
| "$TRY" -y "make-socket newsock; rm newsock; touch newsock; echo hello> newsock" | ||
| [ -f newsock ] || fail | ||
| [ "$(cat newsock)" = "hello" ] || fail | ||
| rm newsock | ||
|
|
||
| # // TRYCASE(socket, dir) | ||
|
|
||
| : $((COUNT += 1)) | ||
|
|
||
| ! [ -e newsock ] || fail | ||
|
mgree marked this conversation as resolved.
|
||
| "$TRY" -y "make-socket newsock; rm newsock; mkdir newsock" | ||
| [ -d newsock ] || fail | ||
| rm -r newsock | ||
|
|
||
| # // TRYCASE(socket, symlink) | ||
|
|
||
| : $((COUNT += 1)) | ||
|
|
||
| ! [ -e newsock ] || fail | ||
| ln -s "$TRY" newsock | ||
| [ -L newsock ] || fail | ||
| "$TRY" -y "rm newsock; make-socket newsock" | ||
| ! [ -e newlink ] || fail | ||
| [ -S newsock ] || fail | ||
| rm newsock | ||
|
|
||
| # // TRYCASE(socket, nonexist) | ||
|
|
||
| : $((COUNT += 1)) | ||
|
|
||
| ! [ -e newsock ] | ||
| "$TRY" -y "make-socket newsock" | ||
| [ -S newsock ] || fail | ||
| rm newsock | ||
Uh oh!
There was an error while loading. Please reload this page.