Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Sobota, 17. október 2026

Rozdiely pre scripts/shell/cvs-switch/cvs-switch.sh medzi verziami 1.1 a 1.2

verzia 1.1, 2004/04/14 18:48:49 verzia 1.2, 2004/04/16 20:52:44
Riadok 3 
Riadok 3 
 #  #
 # cvs-switch.sh - easily switch between multiple CVS Repositories  # cvs-switch.sh - easily switch between multiple CVS Repositories
 #  #
   
   #
   # Usage: add next line to your ~/.bashrc, ~/.zshrc or etc.:
   #
   # alias cvs-switch='eval `$HOME/prog/cvs/scripts/shell/cvs-switch/cvs-switch.sh`'
   #
   # Then you can easily switch between CVS Repositories with alias 'cvs-switch'
   # Available CVS Repositories are configured in your ~/.cvs-repositories.conf,
   # see cvs-repositories.conf example
   #
   
   #
 # Developed by Lubomir Host 'rajo' <rajo AT platon.sk>  # Developed by Lubomir Host 'rajo' <rajo AT platon.sk>
 # Copyright (c) 2004 Platon SDG, http://platon.sk/  # Copyright (c) 2004 Platon SDG, http://platon.sk/
 # Licensed under terms of GNU General Public License.  # Licensed under terms of GNU General Public License.
Riadok 12 
Riadok 24 
 # 2004-04-13 - created  # 2004-04-13 - created
 #  #
   
 # $Platon$  # $Platon: scripts/shell/cvs-switch/cvs-switch.sh,v 1.1 2004/04/14 18:48:49 rajo Exp $
   
 #  #
 # This code is tested on Linux, FreeBSD and Solaris  # This code is tested on Linux, FreeBSD and Solaris
 #  #
   
   print_message()
   { # {{{
           echo $*" " > /dev/stderr
   } # }}}
   
 print_if_not_empty()  print_if_not_empty()
 { # {{{  { # {{{
         name=$1          name=$1
         value=$2          value=$2
         if [ ! -z "$value" ]; then          if [ ! -z "$value" ]; then
                 echo "  $name = $value"                  print_message " $name = $value"
         fi          fi
 } # }}}  } # }}}
   
Riadok 34  print_exported()
Riadok 51  print_exported()
         echo "export $name=\"$value\""          echo "export $name=\"$value\""
 } # }}}  } # }}}
   
 #cvs-switch()  #
   # This can't be function loaded by the shell, because error message appears:
   # ...
   # switch-cvs:50: bad substitution
   # ...
   
   #switch-cvs()
 #{ # {{{  #{ # {{{
   
         CVS_SWITCH_CONFIG="$HOME/.cvs-repositories.conf"          CVS_SWITCH_CONFIG="$HOME/.cvs-repositories.conf"
Riadok 61  print_exported()
Riadok 84  print_exported()
                         DOMAINNAME="`domainname`"                          DOMAINNAME="`domainname`"
                         ;;                          ;;
                 *)                  *)
                         echo "Unsupported operating system, sorry...";                          print_message "Unsupported operating system, sorry...";
                         exit 1;                          exit 1;
                         ;;                          ;;
         esac          esac
Riadok 83  print_exported()
Riadok 106  print_exported()
   
         i=1          i=1
         for rep in ${!REPOSITORIES}; do          for rep in ${!REPOSITORIES}; do
                 eval rep_$i="$rep"                  eval rep_$i="$rep";
                 eval "$SET_VARIABLES";                  eval "$SET_VARIABLES";
   
                 echo "$i - ${!title}";                  print_message
                   print_message "$i - ${!title}";
                 print_if_not_empty "CVSROOT" "${!cvsroot}"                  print_if_not_empty "CVSROOT" "${!cvsroot}"
                 print_if_not_empty "CVS_RSH" "${!cvs_rsh}"                  print_if_not_empty "CVS_RSH" "${!cvs_rsh}"
   
                 i=$((i + 1))                  i=$((i + 1))
         done          done
   
         echo -en "Your choice: [1] "          print_message
           print_message -en "Your choice: [1]:"
         read x          read x
         if [ -z "$x" ]; then          if [ -z "$x" ]; then
                 i=1;                  i=1;

Legend:
Odstranené z verzie1.1  
zmenené riadky
  Pridané vo verzii1.2

Platon Group <platon@platon.sk> http://platon.sk/
Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok