pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Update ksh93&co to v1.0.9+PS1 update+misc, 2024-07-06
Posted by Anonymous on Sat 6th Jul 2024 14:54
raw | new post

  1. From 08876e9a9057f79c27eeaad107772798b2a1f609 Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Sat, 6 Jul 2024 11:32:29 +0200
  4. Subject: [PATCH 1/3] cygwin,tests: Update ksh93 to V1.0.9
  5.  
  6. Update ksh93 to V1.0.9, and update recommended list of packages.
  7.  
  8. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  9. ---
  10. cygwin/README.bintarball.txt                  |  3 ++
  11.  cygwin/cygwin_ksh93/ksh93.cygport             | 42 +++++++++++--------
  12.  ...t_PATH_LEADING_SLASHES_for_UNC_paths.patch | 12 +++---
  13.  tests/manual_testing.txt                      |  4 +-
  14.  4 files changed, 37 insertions(+), 24 deletions(-)
  15.  
  16. diff --git a/cygwin/README.bintarball.txt b/cygwin/README.bintarball.txt
  17. index 5a366bc..edd1c55 100644
  18. --- a/cygwin/README.bintarball.txt
  19. +++ b/cygwin/README.bintarball.txt
  20. @@ -117,6 +117,9 @@ NFSv4.1 client and filesystem driver for Windows 10/11
  21.          mingw64-x86_64-clang
  22.          dos2unix
  23.          unzip
  24. +        bison
  25. +        cygport
  26. +        libiconv-devel
  27.  
  28.  #
  29.  # 4. Download and install Cygwin (if not installed yet):
  30. diff --git a/cygwin/cygwin_ksh93/ksh93.cygport b/cygwin/cygwin_ksh93/ksh93.cygport
  31. index b8d13fe..cffc02e 100644
  32. --- a/cygwin/cygwin_ksh93/ksh93.cygport
  33. +++ b/cygwin/cygwin_ksh93/ksh93.cygport
  34. @@ -11,7 +11,7 @@
  35.  NAME=astksh
  36.  LICENSE="Eclipse Public License - v 2.0"
  37.  HOMEPAGE="https://github.com/ksh93/ksh"
  38. -VERSION=1.0.8
  39. +VERSION=1.0.9
  40.  RELEASE=0
  41.  
  42.  PKG_NAMES="astksh astksh_devel"
  43. @@ -36,21 +36,23 @@ astksh_devel_CONTENTS="usr/share/ksh \
  44.         bin/shcomp.exe \
  45.  "
  46.  
  47. -SRC_URI="https://github.com/ksh93/ksh/archive/refs/tags/v1.0.8.zip"
  48. -SRC_DIR='./ksh-1.0.8/'
  49. -PATCH_URI="ksh_1_0_8_libast_Cygwin_set_PATH_LEADING_SLASHES_for_UNC_paths.patch"
  50. +SRC_URI="https://github.com/ksh93/ksh/archive/refs/tags/v1.0.9.zip"
  51. +SRC_DIR='./ksh-1.0.9/'
  52. +PATCH_URI=""
  53. +#PATCH_URI+=" ksh_1_0_8_libast_Cygwin_set_PATH_LEADING_SLASHES_for_UNC_paths.patch"
  54. +PATCH_URI+=" ksh_1_0_9_mamake_bootstrap.patch"
  55.  
  56.  BUILD_REQUIRES=" \
  57. -    bash \
  58. -    coreutils \
  59. -    bison \
  60. -    gcc-g++ \
  61. -    libiconv-devel \
  62. -    libintl-devel \
  63. -    libncurses-devel \
  64. -    make \
  65. -    sed \
  66. -    texinfo \
  67. +       bash \
  68. +       coreutils \
  69. +       bison \
  70. +       gcc-g++ \
  71. +       libiconv-devel \
  72. +       libintl-devel \
  73. +       libncurses-devel \
  74. +       make \
  75. +       sed \
  76. +       texinfo \
  77.  "
  78.  
  79.  CPPFLAGS=
  80. @@ -64,7 +66,7 @@ function print_gnulinux_builtin_header
  81.  cat <<ENDOFTEXT
  82.  
  83.  #ifndef _GNULINUX_KSH_CMDLIST_H
  84. -#define        _GNULINUX_KSH_CMDLIST_H
  85. +#define _GNULINUX_KSH_CMDLIST_H
  86.  
  87.  #ifdef __cplusplus
  88.  extern "C" {
  89. @@ -233,14 +235,20 @@ src_compile()
  90.         #export IFFEFLAGS=-d1
  91.  
  92.         # fix build issues with mkfifo
  93. -       sed -i -r 's/mkfifo.+?(-m [[:digit:]]+)/mkfifo /g' ./src/cmd/INIT/package.sh ./bin/package
  94. +       if false ; then
  95. +               # ksh93 v1.0.8
  96. +               sed -i -r 's/mkfifo.+?(-m [[:digit:]]+)/mkfifo /g' ./src/cmd/INIT/package.sh ./bin/package
  97. +       else
  98. +               # ksh93 >= v1.0.9
  99. +               sed -i -r 's/mkfifo.+?(-m [[:digit:]]+)/mkfifo /g' ./bin/package
  100. +       fi
  101.  
  102.  
  103.         #
  104.         # build AT&T AST ksh
  105.         #
  106.         if [[ "$ARCH" == 'i686' ]] ; then
  107. -                    export SHELL=/bin/bash HOSTTYPE="${ast_hosttype}"; \
  108. +               export SHELL=/bin/bash HOSTTYPE="${ast_hosttype}"; \
  109.                         /bin/bash ./bin/package make \
  110.                                 CC="/usr/bin/gcc -m32 -std=gnu17" CCFLAGS="-Os -g ${bast_flags}" SHELL="$SHELL" HOSTTYPE="$HOSTTYPE"
  111.         elif [[ "$ARCH" == 'x86_64' ]] ; then
  112. diff --git a/cygwin/cygwin_ksh93/ksh_1_0_8_libast_Cygwin_set_PATH_LEADING_SLASHES_for_UNC_paths.patch b/cygwin/cygwin_ksh93/ksh_1_0_8_libast_Cygwin_set_PATH_LEADING_SLASHES_for_UNC_paths.patch
  113. index 6128fe9..bdadb8d 100644
  114. --- a/cygwin/cygwin_ksh93/ksh_1_0_8_libast_Cygwin_set_PATH_LEADING_SLASHES_for_UNC_paths.patch
  115. +++ b/cygwin/cygwin_ksh93/ksh_1_0_8_libast_Cygwin_set_PATH_LEADING_SLASHES_for_UNC_paths.patch
  116. @@ -3,9 +3,9 @@ index b6b58027..396cd46d 100644
  117.  --- a/src/lib/libast/port/astconf.c
  118.  +++ b/src/lib/libast/port/astconf.c
  119.  @@ -1355,6 +1355,24 @@ astgetconf(const char* name, const char* path, const char* value, int flags, Err
  120. -       Lookup_t        look;
  121. -       Sfio_t*         tmp;
  122. -
  123. +       Lookup_t        look;
  124. +       Sfio_t*         tmp;
  125. +
  126.  +#ifdef __CYGWIN__
  127.  +      /*
  128.  +       * hack for Cygwin to make Cygwin UNC paths (with leading
  129. @@ -24,6 +24,6 @@ index b6b58027..396cd46d 100644
  130.  +              return "1";
  131.  +      }
  132.  +#endif /* __CYGWIN__ */
  133. -       if (!name)
  134. -       {
  135. -               if (path)
  136. +       if (!name)
  137. +       {
  138. +               if (path)
  139. diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
  140. index 2ab20f2..9a66289 100644
  141. --- a/tests/manual_testing.txt
  142. +++ b/tests/manual_testing.txt
  143. @@ -1,5 +1,5 @@
  144.  #
  145. -# ms-nfs41-client manual testing sequence, 2024-06-26
  146. +# ms-nfs41-client manual testing sequence, 2024-07-04
  147.  #
  148.  # Draft version, needs to be turned into automated tests
  149.  # if possible
  150. @@ -21,6 +21,7 @@
  151.  #   subversion
  152.  #   cygport
  153.  #   dos2unix
  154. +#   libiconv-devel
  155.  #   libncurses-devel
  156.  #   libgmp-devel
  157.  #   libmpfr-devel
  158. @@ -35,6 +36,7 @@
  159.  #   konsole
  160.  #   nedit
  161.  #   emacs
  162. +#   cygport
  163.  #   ---- snip ----
  164.  #
  165.  # - Benchmarking/profiling should be done with the realtime virus checker
  166. --
  167. 2.45.1
  168.  
  169. From ff689516439a1b14afa390424e8ca6bc53d48dc2 Mon Sep 17 00:00:00 2001
  170. From: Roland Mainz <roland.mainz@nrubsig.org>
  171. Date: Sat, 6 Jul 2024 12:10:35 +0200
  172. Subject: [PATCH 2/3] cygwin,tests: Update ksh93 to V1.0.9 [refix]
  173.  
  174. Refix "Update ksh93 to V1.0.9", add missing patch file.
  175.  
  176. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  177. ---
  178. .../cygwin_ksh93/ksh_1_0_9_mamake_bootstrap.patch | 15 +++++++++++++++
  179.  1 file changed, 15 insertions(+)
  180.  create mode 100644 cygwin/cygwin_ksh93/ksh_1_0_9_mamake_bootstrap.patch
  181.  
  182. diff --git a/cygwin/cygwin_ksh93/ksh_1_0_9_mamake_bootstrap.patch b/cygwin/cygwin_ksh93/ksh_1_0_9_mamake_bootstrap.patch
  183. new file mode 100644
  184. index 0000000..b654a27
  185. --- /dev/null
  186. +++ b/cygwin/cygwin_ksh93/ksh_1_0_9_mamake_bootstrap.patch
  187. @@ -0,0 +1,15 @@
  188. +# Patch to avoid ETXTBUSY when trying to replace mamake.exe
  189. +diff --git a/bin/package b/bin/package
  190. +index 8d969c8b..f9ba6ab6 100755
  191. +--- a/bin/package
  192. ++++ b/bin/package
  193. +@@ -2515,7 +2515,8 @@ checkaout()      # cmd ...
  194. +                               done
  195. +                       fi
  196. +                       rm -f "$INSTALLROOT/dyn/bin/$i" "$INSTALLROOT/src/lib/libast/$i" &
  197. +-                      $exec $CC -O $CCFLAGS $LDFLAGS -o $INSTALLROOT/bin/$i $INITROOT/$i.c || return
  198. ++                      $exec $CC -O $CCFLAGS $LDFLAGS -o $INSTALLROOT/bin/${i}_bootstrap $INITROOT/$i.c || return
  199. ++                      $exec ln -s ${i}_bootstrap $INSTALLROOT/bin/$i
  200. +                       test -f $i.o && $exec rm -f $i.o
  201. +                       hash -r
  202. +                       ;;
  203. --
  204. 2.45.1
  205.  
  206. From a371dcc8188db1e22509d4aaee5e095a5fe93d2e Mon Sep 17 00:00:00 2001
  207. From: Roland Mainz <roland.mainz@nrubsig.org>
  208. Date: Sat, 6 Jul 2024 13:05:29 +0200
  209. Subject: [PATCH 3/3] cygwin: ksh93 ksh.ksh93 PS1 should use RED colour for
  210.  admins
  211.  
  212. ksh93 /etc/ksh.ksh93 PS1 should use RED colour for users
  213. with Admin group membership.
  214.  
  215. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  216. ---
  217. cygwin/cygwin_ksh93/ksh.kshrc     | 25 ++++++++++++++++++++++++-
  218.  cygwin/cygwin_ksh93/ksh93.cygport | 30 ++++++++++++++++++++++++++++--
  219.  2 files changed, 52 insertions(+), 3 deletions(-)
  220.  
  221. diff --git a/cygwin/cygwin_ksh93/ksh.kshrc b/cygwin/cygwin_ksh93/ksh.kshrc
  222. index 5e12602..f3d0382 100644
  223. --- a/cygwin/cygwin_ksh93/ksh.kshrc
  224. +++ b/cygwin/cygwin_ksh93/ksh.kshrc
  225. @@ -2,7 +2,30 @@
  226.  # /etc/ksh.kshrc+~/.kshrc are sourced only for interactive shells
  227.  #
  228.  
  229. +function _ksh_kshrc_is_windows_admin_account
  230. +{
  231. +       #
  232. +       # Test whether we have the Windows permissions to install DLLs
  233. +       # and the kernel module
  234. +       #
  235. +       # Usually Windows Adminstrator rights are indicated by the
  236. +       # membership in group "544(Administratoren)" (Cygwin maps
  237. +       # "SID S-1-5-32-544" to GID 544)
  238. +       #
  239. +       if [[ "$(/usr/bin/id -G)" =~ (^|[[:space:]]+)544([[:space:]]+|$) ]] ; then
  240. +               return 0
  241. +       fi
  242. +       return 1
  243. +}
  244. +
  245.  # default prompt
  246. -PS1=$'\E[1;32m$(/usr/bin/logname)@$(/usr/bin/hostname) \E[1;33m${PWD/~(Sl-r)$HOME/"~"}\E[0m\n$ '
  247. +if _ksh_kshrc_is_windows_admin_account ; then
  248. +       PS1=$'\E[1;91m$(/usr/bin/logname)@$(/usr/bin/hostname) \E[1;33m${PWD/~(Sl-r)$HOME/"~"}\E[0m\n$ '
  249. +else
  250. +       PS1=$'\E[1;32m$(/usr/bin/logname)@$(/usr/bin/hostname) \E[1;33m${PWD/~(Sl-r)$HOME/"~"}\E[0m\n$ '
  251. +fi
  252. +
  253.  # default editor mode
  254.  set -o gmacs
  255. +
  256. +# EOF.
  257. diff --git a/cygwin/cygwin_ksh93/ksh93.cygport b/cygwin/cygwin_ksh93/ksh93.cygport
  258. index cffc02e..b0cf88e 100644
  259. --- a/cygwin/cygwin_ksh93/ksh93.cygport
  260. +++ b/cygwin/cygwin_ksh93/ksh93.cygport
  261. @@ -265,11 +265,37 @@ src_compile()
  262.         # create ksh.kshrc
  263.         #
  264.         {
  265. -               printf '#\n# /etc/ksh.kshrc+~/.kshrc are sourced only for interactive shells\n#\n\n'
  266. +               printf '#\n'
  267. +               printf '# /etc/ksh.kshrc+~/.kshrc are sourced only for interactive shells\n'
  268. +               printf '#\n'
  269. +               printf '\n'
  270. +               printf 'function _ksh_kshrc_is_windows_admin_account\n'
  271. +               printf '{\n'
  272. +               printf '        #\n'
  273. +               printf '        # Test whether we have the Windows permissions to install DLLs\n'
  274. +               printf '        # and the kernel module\n'
  275. +               printf '        #\n'
  276. +               printf '        # Usually Windows Adminstrator rights are indicated by the\n'
  277. +               printf '        # membership in group "544(Administratoren)" (Cygwin maps\n'
  278. +               printf '        # "SID S-1-5-32-544" to GID 544)\n'
  279. +               printf '        #\n'
  280. +               printf '        if [[ "$(/usr/bin/id -G)" =~ (^|[[:space:]]+)544([[:space:]]+|$) ]] ; then\n'
  281. +               printf '                return 0\n'
  282. +               printf '        fi\n'
  283. +               printf '        return 1\n'
  284. +               printf '}\n'
  285. +               printf '\n'
  286.                 printf '# default prompt\n'
  287. -               printf 'PS1=%q\n' $'\E[1;32m$(/usr/bin/logname)@$(/usr/bin/hostname) \E[1;33m${PWD/~(Sl-r)$HOME/"~"}\E[0m\n$ '
  288. +               printf 'if _ksh_kshrc_is_windows_admin_account ; then\n'
  289. +               printf '        PS1=$'\''\\E[1;91m$(/usr/bin/logname)@$(/usr/bin/hostname) \\E[1;33m${PWD/~(Sl-r)$HOME/"~"}\\E[0m\\n$ '\''\n'
  290. +               printf 'else\n'
  291. +               printf '        PS1=$'\''\\E[1;32m$(/usr/bin/logname)@$(/usr/bin/hostname) \\E[1;33m${PWD/~(Sl-r)$HOME/"~"}\\E[0m\\n$ '\''\n'
  292. +               printf 'fi\n'
  293. +               printf '\n'
  294.                 printf '# default editor mode\n'
  295.                 printf 'set -o gmacs\n'
  296. +               printf '\n'
  297. +               printf '# EOF.\n'
  298.         } >${S}/etc_ksh_kshrc
  299.  }
  300.  
  301. --
  302. 2.45.1

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at