OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Thomas Lotterer
  Root:   /v/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-registry                 Date:   29-Nov-2005 18:01:46
  Branch: HEAD                             Handle: 2005112917014600

  Modified files:
    openpkg-registry        register.sh

  Log:
    handle --conf as much like the other advanced options as possible

  Summary:
    Revision    Changes     Path
    1.15        +16 -15     openpkg-registry/register.sh
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-registry/register.sh
  ============================================================================
  $ cvs diff -u -r1.14 -r1.15 register.sh
  --- openpkg-registry/register.sh      29 Nov 2005 16:37:55 -0000      1.14
  +++ openpkg-registry/register.sh      29 Nov 2005 17:01:46 -0000      1.15
  @@ -66,9 +66,9 @@
   
   readconf()
   {
  -    [ ".$conf" = . ] && return
  -    if [ -r "$conf" ]; then
  -      sanitycheck "$conf" && . "$conf"
  +    [ ".$REGISTRY_CONF" = . ] && return
  +    if [ -r "$REGISTRY_CONF" ]; then
  +      sanitycheck "$REGISTRY_CONF" && . "$REGISTRY_CONF"
       fi
   }
   
  @@ -107,12 +107,13 @@
   REGISTRY_PLAT="`$PREFIX/bin/openpkg rpm --eval '%{l_platform -p}'`"
   REGISTRY_OREL="`$PREFIX/bin/openpkg rpm --eval '%{l_openpkg_release}'`"
   REGISTRY_UUID="$PREFIX/etc/openpkg/uuid"
  +REGISTRY_CONF="$PREFIX/etc/openpkg/register.conf"
   REGISTRY_PREP="$PREFIX/etc/openpkg/register.prep"
   REGISTRY_TRAN="$PREFIX/etc/openpkg/register.tran"
   REGISTRY_UTIL="$PREFIX/etc/openpkg/register.util"
   
  -# Configuration file default and read attempt
  -conf="$PREFIX/etc/openpkg/register.conf"; readconf
  +# Read baseline config early and allow options to override contents
  +readconf
   
   # Debug options
   verbose="no"
  @@ -145,7 +146,7 @@
           -c|--conf )
             if [ ".$arg" = . ]; then shift; arg="$1"; fi
             if [ ".$arg" = . ]; then help="Missing argument to \"$opt\""; 
break; fi
  -          conf="$arg"; readconf
  +          REGISTRY_CONF="$arg"; readconf
             ;;
           -m|--mode )
             if [ ".$arg" = . ]; then shift; arg="$1"; fi
  @@ -404,7 +405,7 @@
   interaction()
   {
       if [ ".$REGISTRY_MODE" = .wipe ]; then
  -        [ ".$conf" != . -a -w $conf ] && cat </dev/null >$conf
  +        [ ".$REGISTRY_CONF" != . -a -w $REGISTRY_CONF ] && cat </dev/null 
>$REGISTRY_CONF
           return
       fi
   
  @@ -424,8 +425,8 @@
       echo ""
   
       read -p "==== Preparation ==== [press RETURN to continue]"
  -    echo "Attempting to write to the configuration file \"$conf\""
  -    echo "#`TZ= date '+%Y-%m-%d %H:%M:%S'`" | tee -a "$conf" 2>/dev/null \
  +    echo "Attempting to write to the configuration file \"$REGISTRY_CONF\""
  +    echo "#`TZ= date '+%Y-%m-%d %H:%M:%S'`" | tee -a "$REGISTRY_CONF" 
2>/dev/null \
       || error "Configuration file not writable. Get more permissions and try 
again"
   
       read -p "[REGISTRY_USER=\"$REGISTRY_USER\"] username ";          [ 
".$REPLY" != . ] && REGISTRY_USER="$REPLY"
  @@ -449,7 +450,7 @@
       [ ".$UUID_INSTANCE" = . ] && error "missing information UUID_INSTANCE"
       [ ".$UUID_PLATFORM" = . ] && error "missing information UUID_PLATFORM"
   
  -    echo "Appending to configuration file \"$conf\""
  +    echo "Appending to configuration file \"$REGISTRY_CONF\""
       (
           echo "REGISTRY_USER=\"$REGISTRY_USER\""
           echo "REGISTRY_DESC=\"$REGISTRY_DESC\""
  @@ -457,7 +458,7 @@
           echo "REGISTRY_OREL=\"$REGISTRY_OREL\""
           echo "REGISTRY_UUID=\"$REGISTRY_UUID\""
           echo "REGISTRY_PREP=\"$REGISTRY_PREP\""
  -    ) | tee -a "$conf"
  +    ) | tee -a "$REGISTRY_CONF"
   
       preparation
   
  @@ -470,12 +471,12 @@
       [ ".$REGISTRY_ARGS" = . ] && error "missing information REGISTRY_ARGS"
       [ ".$REGISTRY_TRAN" = . ] && error "missing information REGISTRY_TRAN"
   
  -    echo "Appending to configuration file \"$conf\""
  +    echo "Appending to configuration file \"$REGISTRY_CONF\""
       (
           echo "REGISTRY_MODE=\"$REGISTRY_MODE\""
           echo "REGISTRY_ARGS=\"$REGISTRY_ARGS\""
           echo "REGISTRY_TRAN=\"$REGISTRY_TRAN\""
  -    ) | tee -a "$conf"
  +    ) | tee -a "$REGISTRY_CONF"
   
       transaction <$REGISTRY_PREP
   
  @@ -485,10 +486,10 @@
   
       [ ".$REGISTRY_UTIL" = . ] && error "missing information REGISTRY_UTIL"
   
  -    echo "Appending to configuration file \"$conf\""
  +    echo "Appending to configuration file \"$REGISTRY_CONF\""
       (
           echo "REGISTRY_UTIL=\"$REGISTRY_UTIL\""
  -    ) | tee -a "$conf"
  +    ) | tee -a "$REGISTRY_CONF"
   
       utilization <$REGISTRY_TRAN
   }
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     openpkg-cvs@openpkg.org

Reply via email to