Project

General

Profile

Actions

Bug #13640

open

brand uninstall scripts need ksh fixes

Added by Andy Fiddaman about 2 months ago. Updated about 2 months ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
zones
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

usr/src/lib/brand/solaris10/zone/uninstall.ksh and usr/src/lib/brand/shared/zone/uninstall.ksh use ksh patterns of the form:

~()(pattern)

These don't appear to be valid ksh pattern syntax, although they were accepted by the previous ksh in gate. The new version takes the brackets around the pattern as literal (which matches my interpretation of the man page).

I wrote this script to compare the old and new ksh versions:

#!/bin/ksh

function x {
        printf "%30s" "$1  - " 
        [[ test/foo/bar == $1 ]] && print yes || print no
}

echo ${.sh.version}
x 'test/foo/+([^/])'
x '~(K:test/foo/+([^/]))'
x '~(:test/foo/+([^/]))'
x '~(K)test/foo/+([^/])'
x '~()test/foo/+([^/])'
x '~()(test/foo/+([^/]))'
x '~(){1}(test/foo/+([^/]))'
x '~()@(test/foo/+([^/]))'

[[ "(test/foo/bar)" == ~()(test/foo/+([^/])) ]] && echo oh yes || echo oh no

The results are:

Version jM 93u+ 2012-08-01
          test/foo/+([^/])  - yes
     ~(K:test/foo/+([^/]))  - yes
      ~(:test/foo/+([^/]))  - yes
      ~(K)test/foo/+([^/])  - yes
       ~()test/foo/+([^/])  - yes
     ~()(test/foo/+([^/]))  - no
  ~(){1}(test/foo/+([^/]))  - yes
    ~()@(test/foo/+([^/]))  - yes
oh yes
Version JM 93t+ 2010-03-05
          test/foo/+([^/])  - yes
     ~(K:test/foo/+([^/]))  - yes
      ~(:test/foo/+([^/]))  - yes
      ~(K)test/foo/+([^/])  - yes
       ~()test/foo/+([^/])  - yes
     ~()(test/foo/+([^/]))  - yes
  ~(){1}(test/foo/+([^/]))  - yes
    ~()@(test/foo/+([^/]))  - yes
oh no
Actions #1

Updated by Andy Fiddaman about 2 months ago

  • Description updated (diff)
Actions #2

Updated by Andy Fiddaman about 2 months ago

  • Description updated (diff)
Actions

Also available in: Atom PDF