[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [SpeechIO-86] Some suggestions regarding speechd directories



On Wed, 11 Aug 1999, you wrote:
> On Wed, 11 Aug 1999, Tuomas Jormola wrote:
> 
> > > > Red Hat has a file called /etc/redhat-release, which contains the version
> > > > as well.
> > > 
> > > Good call.  Debian's got /etc/debian_version -- same deal.
> > Or then we could use INITDIR variable in Makefile like this:
> 
> Nah, test for the files Michale & I mentioned.  I dunno if this'll work
> (really not familiar w/ Makefiles & how their syntax overlaps w/, say,
> bash)
> 
> if (test -x /etc/redhat-release); then
>   echo "This is a RedHat distribution."
>   INITDIR=/etc/rc.d/init.d   
> elif (test -x /etc/debian_version); then
>   echo "This is a Debian distribution."
>   INITDIR=/etc/init.d
> else 
>   echo "I don't know what this distribution is, you'll have to deal manually."
>   INITDIR=""
> fi                            
> 

Just thinking.... there should probably be a way to escape that even if one did
have the redhat-release file present.... like (also in shell scripting like
way.... sorry):

 if (test -x /etc/redhat-release); then
   echo "This looks like a RedHat distribution."
   echo "Use /etc/rc.d/init.d for the init scripts? [ Y | N ]"
   read
   if ( $REPLY );   then
     if ( $REPLY = Y );     then
       DIST=RH
     fi
     if ( $REPLY = N );     then
       DIST=Other
     fi
   fi
 elif (test -x /etc/debian_version); then
   echo "This looks like a Debian distribution."
   echo "Use /etc/init.d for the init scripts? [ Y | N ]"
   read
   if ( $REPLY );   then
     if ( $REPLY = Y );     then
       DIST=DEB
     fi
     if ( $REPLY = N );     then
       DIST=Other
     fi
   fi
 else 
   DIST=Other
 fi            
if ( $DIST = RH ); then
  INITDIR="/etc/rc.d/init.d"
elif ( $DIST = DEB ); then
  INITDIR="/etc/init.d"
else
  echo "Please specify the directory holding your init scripts:"
  read
  if ( $REPLY ); then
    INITDIR="$REPLY"
    if (test -x $INITDIR); then
      echo "using $INITDIR"
    else
       mkdir $INITDIR
    fi
  else
    echo "Sorry... can't continue without an init direcotry,"
    echo "you'll have to re-run this script and set the init directory"
    exit
  fi
fi


This could probably be cleaned up a whole lot... but I think that'd work.

> This could be quite broken, it should be tested -- and something needs to
> be done with that "else" to keep it from installing that bit when it
> doesn't know where it goes.  At some point I want to look at some of these
> directory structures & see if we can intellegently guess what's necessary.
> 
> BTW, what about the simlinks in like /etc/rc3.d ?  Are they all the same
> in systems that use this basic structure ?  (what'd somebody call it ?
> SysV ?  I knew that once...)
> 
> __________________________________________________________________
> PGP fingerprint = 03 5B 9B A0 16 33 91 2F  A5 77 BC EE 43 71 98 D4
>             darxus@op.net / http://www.op.net/~darxus
>                          Far Beyond Reason
--

Josh I.