Re: [Bashburn-info] Install.sh options
Brought to you by:
bashburn
From: Nick W. <ni...@li...> - 2008-09-29 16:54:27
|
On Mon, 29 Sep 2008 11:21:52 -0400 (EDT) "Steven W. Orr" <st...@sy...> wrote: > On Monday, Sep 29th 2008 at 09:18 -0000, quoth Steven W. Orr: > > =>On Monday, Sep 29th 2008 at 06:37 -0000, quoth Nick Warne: > => > =>=> > =>=>I have hardened the Install file options, after I noticed some > strange =>=>behaviour with silly options (i.e. -uninstall ). > =>=> > =>=>There is still a big issue if you use: > =>=> > =>=>-prefix=/usr > =>=> > =>=>The install script will install into a directory called 'refix' > in the =>=>current directory. > =>=> > =>=>Nick > => > =>That should not happen. I'll look at it. :-( (after svn comes back > up) > > Nick, I haven't seen the change you made, but let me explain what's > happening. > > The getopt/getopts calls are SVR4 compliant. That means that if you > have a bunch of legal options, like a, b and c, then > > foo -abc > is the same as > > foo -a -b -c > > In this case, we have long options. Every longopt has to have a > corresponding single letter option (to be SVR4 complient). In this > case, we have -p and -u and -h. They have --prefix, --uninstall, and > --help as long version. > > The -p takes an argument, so if you say > > Install.sh -prefix > > then you get what the doctor ordered. You get -p with an option arg > of refix. We probably should not be coding defensively around that. > If the user was going to use the long option correctly then he would > say > > Install.sh --prefix dirname > or > Install.sh --prefix=dirname > > But to just say -prefix is just wrong as the basis for something we > should worry about. > > Also note, if you say -p with no arg then that is caught as an error. > > Does this help? > Well, I find it a bit brain dead if a user mistypes '--prefix' as '-prefix' and it installs into a directory called 'refix'. BTW, SVN is back up Nick -- Free Software Foundation Associate Member 5508 |