[PATCH] Re: missing sh.exe in coreutils

Eric Blake ebb9@byu.net
Mon Aug 15 12:11:00 GMT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Brian Dessent on 8/15/2005 2:45 AM:
> 
>>Is sh.exe missing from coreutils?
>>
>>I am not able to use sh after a upgrade - and sh-utils is listed as _obsolete
> 
> 
> First, sh is not a part of coreutils nor its predecessor sh-utils. 
> Until recently, /bin/sh has been ash, in the package 'ash'.  Now it is a
> copy of /bin/bash, from the package 'bash'.  The new bash postinstall
> script is supposed to make this change for you when upgrading, but
> because the shell itself is used to run the script it does not always
> work.  You can just manually run /etc/postinstall/00bash.sh.done and it
> should fix things.  Or re-run setup and set 'bash' to reinstall.

I'm considering adding /etc/profile.d/00bash.sh to my next release of
bash, which checks whether /bin/sh exists as part of every non-sh login
shell, and if it is missing or an old version of bash, performs the
upgrade.  This should help reduce the complaints of missing /bin/sh we've
been getting.

Also, the following patch to setup.exe will solve the problem of bash
upgrades.  Since bash is guaranteed to exist if the user didn't unselect
Base packages, but sh is not, we might as well always use /bin/bash as the
shell to spawn postinstall scripts.  Since it is used as "bash -c script",
it will obey #! and use the actual shell desired; it is really only bash
that needs this patch, since bash is the only one that must not be spawned
by /bin/sh if it is to update /bin/sh.

2005-08-15  Eric Blake  <ebb9@byu.net>

	* script.cc (shells): Use /bin/bash, not sh, to allow upgrades to
	/bin/sh.

Index: script.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/script.cc,v
retrieving revision 2.19
diff -u -p -r2.19 script.cc
- --- script.cc   5 May 2005 22:48:36 -0000       2.19
+++ script.cc   15 Aug 2005 12:08:16 -0000
@@ -38,8 +38,8 @@ static const char *cmd = 0;
 static OSVERSIONINFO verinfo;

 static const char *shells[] = {
- -  "/bin/sh.exe",
- -  "/usr/bin/sh.exe",
+  // Bash is guaranteed to exist, /bin/sh is not.  Besides,
+  // upgrading /bin/sh requires that /bin/sh not be used.
   "/bin/bash.exe",
   "/usr/bin/bash.exe",
   0

- --
Life is short - so eat dessert first!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDAIZo84KuGfSFAYARAqcYAJ4uoBPHlcv10ReCOTmo/4lk4PjYYgCfX/qz
W/Z47eoZK7DOP4K9Ibk6W48=
=bIx3
-----END PGP SIGNATURE-----



More information about the Cygwin-apps mailing list