mirror of
https://github.com/Interlisp/maiko.git
synced 2026-04-03 20:12:58 +00:00
Compare commits
7 Commits
maiko-2202
...
maiko-2206
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5f51d58f1 | ||
|
|
60af445afa | ||
|
|
a18f09d788 | ||
|
|
2bf7047709 | ||
|
|
90b967c8d3 | ||
|
|
b005501427 | ||
|
|
20046b265b |
71
.github/workflows/buildReleaseInclDocker.yml
vendored
71
.github/workflows/buildReleaseInclDocker.yml
vendored
@@ -8,7 +8,8 @@
|
||||
# For macOS: release assets are built/pushed for X86_64. (No aarch64 as yet.)
|
||||
# For Windows: not supported
|
||||
#
|
||||
# Note release pushed to github also includes source code assets in tar and zip formats.
|
||||
# Note release pushed to github automatically includes source code assets
|
||||
# in tar and zip formats.
|
||||
#
|
||||
# 2022-01-16 by Frank Halasz based on earlier workflow called buildDocker.yml
|
||||
#
|
||||
@@ -54,15 +55,13 @@ defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
# 3 separate jobs here that can run in parallel
|
||||
# 2 separate jobs here that can run in parallel
|
||||
#
|
||||
# 1. Linux: Build/push a multiplatform Linux Docker image and use results to
|
||||
# build/push Linux release assets.
|
||||
#
|
||||
# 2. MacOs_x86_64: Build maiko for MacOS on X86_64 then create and push release assets.
|
||||
#
|
||||
# 3. Sources: create/push sources assets for this release.
|
||||
#
|
||||
|
||||
jobs:
|
||||
|
||||
@@ -149,9 +148,9 @@ jobs:
|
||||
- name: Setup Docker Environment Variables
|
||||
id: docker_env
|
||||
run: |
|
||||
DOCKER_OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
|
||||
echo "DOCKER_OWNER=${DOCKER_OWNER}" >> ${GITHUB_ENV}
|
||||
DOCKER_IMAGE=${DOCKER_OWNER}/${{ steps.tag.outputs.repo_name }}
|
||||
DOCKER_NAMESPACE=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
|
||||
echo "DOCKER_NAMESPACE=${DOCKER_NAMESPACE}" >> ${GITHUB_ENV}
|
||||
DOCKER_IMAGE=${DOCKER_NAMESPACE}/${{ steps.tag.outputs.repo_name }}
|
||||
DOCKER_TAGS="${DOCKER_IMAGE}:latest,${DOCKER_IMAGE}:${RELEASE_TAG#*-}"
|
||||
echo ::set-output name=build_time::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
|
||||
echo ::set-output name=docker_tags::${DOCKER_TAGS}
|
||||
@@ -319,62 +318,6 @@ jobs:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
||||
######################################################################################
|
||||
|
||||
# Sources: create and push release assets containing sources to github
|
||||
sources:
|
||||
|
||||
needs: [inputs, sentry]
|
||||
if: |
|
||||
needs.sentry.outputs.release_not_built == 'true'
|
||||
|| needs.inputs.outputs.force == 'true'
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
|
||||
# Checkout the branch
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# Checkout the actions for this repo owner
|
||||
- name: Checkout Actions
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: ${{ github.repository_owner }}/.github
|
||||
path: ./Actions_${{ github.sha }}
|
||||
- run: mv ./Actions_${{ github.sha }}/actions ../actions && rm -rf ./Actions_${{ github.sha }}
|
||||
|
||||
# Setup release tag
|
||||
- name: Setup Release Tag
|
||||
id: tag
|
||||
uses: ./../actions/release-tag-action
|
||||
|
||||
# Create source tars for the release
|
||||
- name: Make source tars
|
||||
env:
|
||||
RELEASE_TAG: ${{ steps.tag.outputs.release_tag }}
|
||||
run: |
|
||||
mkdir -p /tmp/release_tars
|
||||
pushd ${GITHUB_WORKSPACE}/../ >/dev/null
|
||||
mv maiko ${RELEASE_TAG}
|
||||
/usr/bin/tar -c -z -f /tmp/release_tars/${RELEASE_TAG}-source.tgz --exclude=.git ${RELEASE_TAG}
|
||||
/usr/bin/find ${RELEASE_TAG} -name .git -prune -o -print |\
|
||||
/usr/bin/zip -@ /tmp/release_tars/${RELEASE_TAG}-source.zip
|
||||
mv ${RELEASE_TAG} maiko
|
||||
popd >/dev/null
|
||||
|
||||
# Push Release
|
||||
- name: Push the release
|
||||
uses: ncipollo/release-action@v1.8.10
|
||||
with:
|
||||
allowUpdates: true
|
||||
artifacts:
|
||||
/tmp/release_tars/${{ steps.tag.outputs.release_tag }}-source.tgz,
|
||||
/tmp/release_tars/${{ steps.tag.outputs.release_tag }}-source.zip
|
||||
tag: ${{ steps.tag.outputs.release_tag }}
|
||||
draft: true
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
######################################################################################
|
||||
|
||||
@@ -388,7 +331,7 @@ jobs:
|
||||
outputs:
|
||||
build_successful: ${{ steps.output.outputs.build_successful }}
|
||||
|
||||
needs: [inputs, sentry, linux, macos_x86_64, sources]
|
||||
needs: [inputs, sentry, linux, macos_x86_64]
|
||||
|
||||
steps:
|
||||
# Checkout the actions for this repo owner
|
||||
|
||||
16
src/dir.c
16
src/dir.c
@@ -522,7 +522,7 @@ static int enum_dsk_prop(char *dir, char *name, char *ver, FINFO **finfo_buf)
|
||||
}
|
||||
|
||||
strcpy(namebuf, dirp.name);
|
||||
if (sbuf.st_mode & S_IFDIR) {
|
||||
if (S_ISDIR(sbuf.st_mode)) {
|
||||
nextp->dirp = 1;
|
||||
quote_dname(namebuf);
|
||||
strcpy(nextp->lname, namebuf);
|
||||
@@ -659,7 +659,7 @@ static int enum_dsk_prop(char *dir, char *name, char *ver, FINFO **finfo_buf)
|
||||
}
|
||||
|
||||
strcpy(namebuf, dp->d_name);
|
||||
if (sbuf.st_mode & S_IFDIR) {
|
||||
if (S_ISDIR(sbuf.st_mode)) {
|
||||
nextp->dirp = 1;
|
||||
quote_dname(namebuf);
|
||||
strcpy(nextp->lname, namebuf);
|
||||
@@ -800,7 +800,7 @@ static int enum_dsk(char *dir, char *name, char *ver, FINFO **finfo_buf)
|
||||
}
|
||||
|
||||
strcpy(namebuf, dirp.name); /* moved from below 2/26/93 */
|
||||
if (sbuf.st_mode & S_IFDIR) {
|
||||
if (S_ISDIR(sbuf.st_mode)) {
|
||||
nextp->dirp = 1;
|
||||
quote_dname(namebuf);
|
||||
strcpy(nextp->lname, namebuf);
|
||||
@@ -922,7 +922,7 @@ static int enum_dsk(char *dir, char *name, char *ver, FINFO **finfo_buf)
|
||||
}
|
||||
|
||||
strcpy(namebuf, dp->d_name);
|
||||
if (sbuf.st_mode & S_IFDIR) {
|
||||
if (S_ISDIR(sbuf.st_mode)) {
|
||||
nextp->dirp = 1;
|
||||
quote_dname(namebuf);
|
||||
strcpy(nextp->lname, namebuf);
|
||||
@@ -1025,7 +1025,7 @@ static int enum_ufs_prop(char *dir, char *name, char *ver, FINFO **finfo_buf)
|
||||
}
|
||||
|
||||
strcpy(namebuf, dirp.name);
|
||||
if (sbuf.st_mode & S_IFDIR) {
|
||||
if (S_ISDIR(sbuf.st_mode)) {
|
||||
nextp->dirp = 1;
|
||||
quote_dname(namebuf);
|
||||
strcpy(nextp->lname, namebuf);
|
||||
@@ -1117,7 +1117,7 @@ static int enum_ufs_prop(char *dir, char *name, char *ver, FINFO **finfo_buf)
|
||||
}
|
||||
|
||||
strcpy(namebuf, dp->d_name);
|
||||
if (sbuf.st_mode & S_IFDIR) {
|
||||
if (S_ISDIR(sbuf.st_mode)) {
|
||||
nextp->dirp = 1;
|
||||
quote_dname(namebuf);
|
||||
strcpy(nextp->lname, namebuf);
|
||||
@@ -1224,7 +1224,7 @@ static int enum_ufs(char *dir, char *name, char *ver, FINFO **finfo_buf)
|
||||
}
|
||||
|
||||
strcpy(namebuf, dirp.name);
|
||||
if (sbuf.st_mode & S_IFDIR) {
|
||||
if (S_ISDIR(sbuf.st_mode)) {
|
||||
nextp->dirp = 1;
|
||||
quote_dname(namebuf);
|
||||
strcpy(nextp->lname, namebuf);
|
||||
@@ -1300,7 +1300,7 @@ static int enum_ufs(char *dir, char *name, char *ver, FINFO **finfo_buf)
|
||||
}
|
||||
|
||||
strcpy(namebuf, dp->d_name);
|
||||
if (sbuf.st_mode & S_IFDIR) {
|
||||
if (S_ISDIR(sbuf.st_mode)) {
|
||||
nextp->dirp = 1;
|
||||
quote_dname(namebuf);
|
||||
strcpy(nextp->lname, namebuf);
|
||||
|
||||
36
src/dsk.c
36
src/dsk.c
@@ -327,29 +327,23 @@ LispPTR COM_openfile(register LispPTR *args)
|
||||
|
||||
case ACCESS_OUTPUT:
|
||||
flags = O_RDWR | O_TRUNC | O_CREAT;
|
||||
if (dskp) {
|
||||
unpack_filename(file, dir, name, ver, 1);
|
||||
if (make_directory(dir) == 0) return (NIL);
|
||||
link_check_flg = 1;
|
||||
}
|
||||
unpack_filename(file, dir, name, ver, 1);
|
||||
if (make_directory(dir) == 0) return (NIL);
|
||||
if (dskp) link_check_flg = 1;
|
||||
break;
|
||||
|
||||
case ACCESS_BOTH:
|
||||
flags = O_RDWR | O_CREAT;
|
||||
if (dskp) {
|
||||
unpack_filename(file, dir, name, ver, 1);
|
||||
if (make_directory(dir) == 0) return (NIL);
|
||||
link_check_flg = 1;
|
||||
}
|
||||
unpack_filename(file, dir, name, ver, 1);
|
||||
if (make_directory(dir) == 0) return (NIL);
|
||||
if (dskp) link_check_flg = 1;
|
||||
break;
|
||||
|
||||
case ACCESS_APPEND:
|
||||
flags = O_RDWR | O_CREAT;
|
||||
if (dskp) {
|
||||
unpack_filename(file, dir, name, ver, 1);
|
||||
if (make_directory(dir) == 0) return (NIL);
|
||||
link_check_flg = 1;
|
||||
}
|
||||
unpack_filename(file, dir, name, ver, 1);
|
||||
if (make_directory(dir) == 0) return (NIL);
|
||||
if (dskp) link_check_flg = 1;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -407,7 +401,7 @@ LispPTR COM_openfile(register LispPTR *args)
|
||||
if (dskp) {
|
||||
TIMEOUT(rval = stat(file, &sbuf));
|
||||
if (rval == 0) {
|
||||
if ((sbuf.st_mode & S_IFMT) != S_IFREG) {
|
||||
if (!S_ISREG(sbuf.st_mode)) {
|
||||
/*
|
||||
* The Lisp code handles this case as same as "file table
|
||||
* overflow" error. Final error message is "File won't
|
||||
@@ -513,7 +507,7 @@ LispPTR COM_openfile(register LispPTR *args)
|
||||
*bufp = ToLispTime(sbuf.st_mtime);
|
||||
|
||||
bufp = (int *)(Addr68k_from_LADDR(args[4]));
|
||||
if (!dskp && ((sbuf.st_mode & S_IFMT) != S_IFREG) && ((sbuf.st_mode & S_IFMT) != S_IFDIR)) {
|
||||
if (!dskp && (!S_ISREG(sbuf.st_mode)) && (!S_ISDIR(sbuf.st_mode))) {
|
||||
/*
|
||||
* Not a regular file or directory file. Put on a marker.
|
||||
*/
|
||||
@@ -617,7 +611,7 @@ LispPTR COM_closefile(register LispPTR *args)
|
||||
/* Just close. */
|
||||
TIMEOUT(rval = close(fd));
|
||||
if (rval == -1) {
|
||||
if (!dskp && errno == EPERM && (sbuf.st_mode & S_IFREG) == 0) {
|
||||
if (!dskp && errno == EPERM && !S_ISREG(sbuf.st_mode)) {
|
||||
/*
|
||||
* On {UNIX} device, closing a special file we are not
|
||||
* the owner of it. Although I don't think close fails
|
||||
@@ -745,7 +739,7 @@ LispPTR COM_closefile(register LispPTR *args)
|
||||
/* Just close. */
|
||||
TIMEOUT(rval = close(fd));
|
||||
if (rval == -1) {
|
||||
if (!dskp && errno == EPERM && (sbuf.st_mode & S_IFREG) == 0) {
|
||||
if (!dskp && errno == EPERM && !S_ISREG(sbuf.st_mode)) {
|
||||
/*
|
||||
* On {UNIX} device, closing a special file we are not
|
||||
* the owner of it. Although I don't think close fails
|
||||
@@ -1945,7 +1939,7 @@ LispPTR COM_readpage(register LispPTR *args)
|
||||
return (NIL);
|
||||
}
|
||||
|
||||
if ((sbuf.st_mode & S_IFREG) != 0) {
|
||||
if (S_ISREG(sbuf.st_mode)) {
|
||||
/*
|
||||
* The request file is a regular file. We have to make sure that
|
||||
* next byte read is at the beginning of the requested page of the
|
||||
@@ -2096,7 +2090,7 @@ LispPTR COM_truncatefile(register LispPTR *args)
|
||||
return (NIL);
|
||||
}
|
||||
|
||||
if ((sbuf.st_mode & S_IFREG) == 0) {
|
||||
if (!S_ISREG(sbuf.st_mode)) {
|
||||
/*
|
||||
* The request file is not a regular file. We don't need to
|
||||
* truncate such file.
|
||||
|
||||
@@ -127,7 +127,7 @@ LispPTR subr_TCP_ops(int op, LispPTR nameConn, LispPTR proto, LispPTR length, Li
|
||||
sock = LispNumToCInt(proto);
|
||||
result = socket(AF_INET, SOCK_STREAM, 0);
|
||||
farend.sin_family = AF_INET;
|
||||
farend.sin_port = sock;
|
||||
farend.sin_port = htons(sock);
|
||||
if (connect(result, (struct sockaddr *)&farend, sizeof farend) < 0) {
|
||||
perror("TCP connect");
|
||||
return (NIL);
|
||||
|
||||
19
src/ufs.c
19
src/ufs.c
@@ -244,6 +244,7 @@ LispPTR UFS_getfilename(LispPTR *args)
|
||||
LispPTR UFS_deletefile(LispPTR *args)
|
||||
{
|
||||
char file[MAXPATHLEN], fbuf[MAXPATHLEN];
|
||||
struct stat sbuf;
|
||||
register int len, rval;
|
||||
|
||||
ERRSETJMP(NIL);
|
||||
@@ -260,11 +261,21 @@ LispPTR UFS_deletefile(LispPTR *args)
|
||||
#else
|
||||
if (unixpathname(fbuf, file, 0, 0) == 0) return (NIL);
|
||||
#endif /* DOS */
|
||||
|
||||
/* check if we're operating on directory or file */
|
||||
TIMEOUT(rval = stat(file, &sbuf));
|
||||
if (rval == -1) {
|
||||
*Lisp_errno = errno;
|
||||
return (NIL);
|
||||
}
|
||||
/*
|
||||
* On UNIX device, all we have to do is just to unlink the file.
|
||||
* On UNIX device, all we have to do is just to unlink the file
|
||||
* or directory
|
||||
*/
|
||||
TIMEOUT(rval = unlink(file));
|
||||
if (S_ISDIR(sbuf.st_mode)) {
|
||||
TIMEOUT(rval = rmdir(file));
|
||||
} else {
|
||||
TIMEOUT(rval = unlink(file));
|
||||
}
|
||||
if (rval == -1) {
|
||||
*Lisp_errno = errno;
|
||||
return (NIL);
|
||||
@@ -398,7 +409,7 @@ LispPTR UFS_directorynamep(LispPTR *args)
|
||||
return (NIL);
|
||||
}
|
||||
|
||||
if ((sbuf.st_mode & S_IFMT) != S_IFDIR) return (NIL);
|
||||
if (!S_ISDIR(sbuf.st_mode)) return (NIL);
|
||||
|
||||
/* Convert Unix file naming convention to Xerox Lisp one. */
|
||||
if (lisppathname(fullname, dirname, 1, 0) == 0) return (NIL);
|
||||
|
||||
@@ -129,6 +129,8 @@ static int ForkUnixShell(int slot, char *PtySlave, char *termtype, char *shellar
|
||||
}
|
||||
/* Start up shell -- use SHELL environment variable as long as it's in /etc/shells */
|
||||
shell = getenv("SHELL");
|
||||
if (shell == NULL) /* shell of last resort */
|
||||
shell = "/bin/sh";
|
||||
for (userShell = getusershell(); userShell != NULL && strcmp(shell, userShell) != 0; userShell = getusershell());
|
||||
if (userShell == NULL) {
|
||||
perror("$(SHELL) not found in /etc/shells");
|
||||
|
||||
Reference in New Issue
Block a user