/[smecontribs]/common/cvs-import.sh
ViewVC logotype

Diff of /common/cvs-import.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

Revision 1.5 by slords, Wed Jul 30 18:02:28 2008 UTC Revision 1.9 by slords, Wed Mar 14 15:25:11 2012 UTC
# Line 5  Line 5 
5  # Copyright (C) 2004-2005 Red Hat, Inc.  # Copyright (C) 2004-2005 Red Hat, Inc.
6  # Copyright (C) 2005 Fedora Foundation  # Copyright (C) 2005 Fedora Foundation
7  #  #
8  # $Id: cvs-import.sh,v 1.7 2008/02/08 18:52:15 slords Exp $  # $Id: cvs-import.sh,v 1.8 2011/11/03 22:47:20 slords Exp $
9    
10  shopt -s nocasematch  shopt -s nocasematch
11    
# Line 23  fi Line 23  fi
23  # use the CVSROOT from the checkout  # use the CVSROOT from the checkout
24  CVSROOT=$(cat ${MYDIR}/CVS/Root)  CVSROOT=$(cat ${MYDIR}/CVS/Root)
25    
26    # use the TAG from the checkout
27    TAG=$(sed -n 's@^T@@p' $(pwd)/CVS/Tag 2> /dev/null)
28    
29  # We need a writable directory for temporary checkouts and CVS work  # We need a writable directory for temporary checkouts and CVS work
30  WORKDIR="/tmp"  WORKDIR="/tmp"
31  if test -w $(pwd) ; then  if test -w $(pwd) ; then
# Line 36  Usage() { Line 39  Usage() {
39      cat <<EOF      cat <<EOF
40  Usage:  Usage:
41    
42      $0 [-b <branch>] [-m <message>] <package>      $0 [-b <branch>] [-t <cvs tag/branch>] [-m <message>] <package>
43    
44  Imports a package into the cvs repository. Will use the following defaults:  Imports a package into the cvs repository. Will use the following defaults:
45  CVSROOT    = $CVSROOT  CVSROOT    = $CVSROOT
46  BRANCH     = ${BRANCH:-devel}  BRANCH     = ${BRANCH:-devel}
47    TAG        = ${TAG}
48    
49  The package can also be imported on a PRE-EXISTING branch using the  The package can also be imported on a PRE-EXISTING branch using the
50  "-b BRANCH" flag. This script can not create new branches for you.  "-b BRANCH" flag. This script can not create new branches for you.
# Line 55  while [ -n "$1" ] ; do Line 59  while [ -n "$1" ] ; do
59          # import the package on the given branch. If the branch does          # import the package on the given branch. If the branch does
60          # not exist, we will branch the HEAD and then we will perform          # not exist, we will branch the HEAD and then we will perform
61          # the import          # the import
62            -t | --tag )
63                shift
64                TAG="$1"
65                if [ -z "$TAG" ] ; then
66                    echo "ERROR: --tag requires an argument"
67                    Usage
68                    exit -1
69                fi
70                ;;
71    
72          -b | --branch )          -b | --branch )
73              shift              shift
74              BRANCH="$1"              BRANCH="$1"
# Line 166  EOF Line 180  EOF
180  # Check out the existing module  # Check out the existing module
181  cd $TMPDIR  cd $TMPDIR
182  echo "Checking out module: '$NAME'"  echo "Checking out module: '$NAME'"
183  $CVS -Q checkout $TOPLEVEL/$NAME || { echo "ERROR: \"$NAME\" module does not exist in cvs."; exit 1; }  $CVS -Q checkout ${TAG:+-r $TAG} $TOPLEVEL/$NAME || { echo "ERROR: \"$NAME\" module does not exist in cvs."; exit 1; }
184    
185  # this is our working directory  # this is our working directory
186  cd $TOPLEVEL/$NAME  cd $TOPLEVEL/$NAME
# Line 306  read Line 320  read
320  cvs -Q update && \  cvs -Q update && \
321      echo "cvs commit..." && \      echo "cvs commit..." && \
322      cvs -Q commit ${MESSAGE:+-m "$MESSAGE"} && echo "Commit Complete" && \      cvs -Q commit ${MESSAGE:+-m "$MESSAGE"} && echo "Commit Complete" && \
323      cd ${BRANCH} && make tag && echo "Tagging '${TAG}' complete."      cd ${BRANCH} && cvs tag ${TAG} && echo "Tagging '${TAG}' complete."
324    
325  # Clean up  # Clean up
326  CleanUp  CleanUp


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed