From 66c3162f152c9befa0b2ee032300b526a3240d23 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Fri, 03 Jul 2020 01:54:58 -0400 Subject: time(): Rename to unixtime() In GNU Bash, time is not simply a built-in utility, but actually a reserved word. Naming a function "time" results in a rather unhelpful syntax error message. --- diff --git a/NEWS b/NEWS index c271c06..81c1b9f 100644 --- a/NEWS +++ b/NEWS @@ -17,7 +17,7 @@ New features: to install a new system of the same architecture and platform and copy its opkg configuration into the old system. -Error handling: +Error handling and bug fixes: * "prokit shell", "prokit opkg", and "prokit build" now pass through relevant exit statuses. "prokit build" also no longer tries to run @@ -25,6 +25,9 @@ Error handling: * If prokit received a signal while running a command under chroot, it could have failed to unmount a file system on a block device. This has been improved. + * An incompatibility with GNU Bash, Z shell, KornShell, MirBSD Korn + Shell, and possibly others (except Almquist shell derivatives DASH + and BusyBox ash) present since prokit version 2.0.0 has been fixed. ProteanOS Development Kit version 2.0.1 --------------------------------------- diff --git a/src/install.sh b/src/install.sh index 41c217f..ab2977b 100644 --- a/src/install.sh +++ b/src/install.sh @@ -294,7 +294,7 @@ install_get_pkgs() done <"${root}/$(profile_opkg_state_dir \ )/info/${pkg}.conffiles" fi - printf 'Installed-Time: %d\n\n' $(time) >&${status_fd} + printf 'Installed-Time: %d\n\n' $(unixtime) >&${status_fd} rm -f -- "${root}/${fname}" done diff --git a/src/main.sh b/src/main.sh index 0f850e0..aa9b3d4 100644 --- a/src/main.sh +++ b/src/main.sh @@ -34,7 +34,7 @@ else builddir='' fi -time() +unixtime() { # Based on code from by Rich # Felker, with whitespace added for readability. @@ -79,7 +79,7 @@ main() shift 1 fi - srand $((${$} + $(time))) + srand $((${$} + $(unixtime))) if ! init_vardata; then return 2 fi -- cgit v0.9.1