Upload: bash-3.0-4 [test]

Corinna Vinschen corinna-cygwin@cygwin.com
Tue Jul 5 16:23:00 GMT 2005


On Jul  5 16:05, Eric Blake wrote:
> At any rate, you are probably right that a postinstall script may be
> all that is needed (no preremove script) if it ensures that /bin/sh
> always exists, and that if it is missing, is ash, or is an older version
> of bash, that it gets upgraded.  But I would still like to leave it alone
> if it does not fit those three categories.  How about this for the
> postinstalls?
> 
> 00ash.sh:
> 
> #!/bin/ash
> # If /bin/sh is missing or is ash, upgrade to bash.  If that fails, set
> # it to the latest ash (so that /bin/sh always exists after this script).
> case `(/bin/sh.exe --version) 2>&1` in
>     *not\ found* | GNU\ bash* | Illegal\ option\ --*)
>         ln -f /bin/bash.exe /bin/sh.exe || ln -f /bin/ash.exe /bin/sh.exe ;;
>     *) # User must have modified /bin/sh; leave it alone
>         ;;
> esac
> 
> #!/bin/bash
> # If /bin/sh is missing, ash, or bash, upgrade it to the current bash.
> case `/bin/sh.exe --version 2>&1
>     *No\ such\ file* | GNU\ bash* | Illegal\ option\ --*)
>         ln -f /bin/bash.exe /bin/sh.exe ;;
>     *) # User must have modified /bin/sh; leave it alone
>         ;;
> esac
> 
> Note that the two postinstalls are not quite interchangeable - missing
> files have different behaviors (in ash, you must run the check in a
> subshell to capture the "not found" error for parsing in the case
> statement, while in bash, running in the current shell captures the
> "No such file" error).  Furthermore, bash doesn't need a fallback,
> since /bin/bash must exist for the script to even be running.

Cool with me (and thanks for preparing the ash script).  If you want to
release another test release using the above 00bash.sh script, please do.

If you want to move bash out of test (this week or in August), just ping
me and I'll release a new ash package.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          mailto:cygwin@cygwin.com
Red Hat, Inc.



More information about the Cygwin-apps mailing list