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

  Server: cvs.openpkg.org                  Name:   Thomas Lotterer
  Root:   /v/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-tools                    Date:   24-Oct-2006 12:23:11
  Branch: HEAD                             Handle: 2006102411231100

  Modified files:
    openpkg-tools/cmd       dev.sh

  Log:
    support distribution release prefix

  Summary:
    Revision    Changes     Path
    1.87        +26 -13     openpkg-tools/cmd/dev.sh
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-tools/cmd/dev.sh
  ============================================================================
  $ cvs diff -u -r1.86 -r1.87 dev.sh
  --- openpkg-tools/cmd/dev.sh  24 Oct 2006 10:22:00 -0000      1.86
  +++ openpkg-tools/cmd/dev.sh  24 Oct 2006 10:23:11 -0000      1.87
  @@ -129,6 +129,7 @@
       [EMAIL PROTECTED]:/v/openpkg/cvs
       OPENPKG_RMOD=openpkg-src
       [EMAIL PROTECTED]:/
  +    OPENPKG_DIST=""
       OPENPKG_NAME="$realname"
       OPENPKG_MAIL="[EMAIL PROTECTED]"
       ;;
  @@ -137,11 +138,12 @@
       OPENPKG_REPO=:pserver:[EMAIL PROTECTED]:/v/openpkg/cvs
       OPENPKG_RMOD=openpkg-src
       OPENPKG_SAVE=ftp://ftp.openpkg.org/contrib/00UPLOAD
  +    OPENPKG_DIST=""
       OPENPKG_NAME="$realname"
       OPENPKG_MAIL="[EMAIL PROTECTED]"
       ;;
   esac
  -export OPENPKG_INST OPENPKG_WORK OPENPKG_TEMP OPENPKG_MODE OPENPKG_REPO 
OPENPKG_RMOD OPENPKG_SAVE
  +export OPENPKG_INST OPENPKG_WORK OPENPKG_TEMP OPENPKG_MODE OPENPKG_REPO 
OPENPKG_RMOD OPENPKG_SAVE OPENPKG_DIST
   
   #   enforced and user controlled (through package/branch/execute) variables
   OPENPKG_SPEC="${OPENPKG_SPEC}"; P="$P" # package, spec file without .spec 
suffix
  @@ -208,6 +210,7 @@
           --repo=*     ) OPENPKG_REPO=${arg} 
OPENPKG_ARGS="$OPENPKG_ARGS${OPENPKG_ARGS:+ }--repo=${arg}";;
           --rmod=*     ) OPENPKG_RMOD=${arg} 
OPENPKG_ARGS="$OPENPKG_ARGS${OPENPKG_ARGS:+ }--rmod=${arg}";;
           --save=*     ) OPENPKG_SAVE=${arg} 
OPENPKG_ARGS="$OPENPKG_ARGS${OPENPKG_ARGS:+ }--save=${arg}";;
  +        --dist=*     ) OPENPKG_DIST=${arg} 
OPENPKG_ARGS="$OPENPKG_ARGS${OPENPKG_ARGS:+ }--dist=${arg}";;
           --spec=*     ) OPENPKG_SPEC=${arg} 
OPENPKG_ARGS="$OPENPKG_ARGS${OPENPKG_ARGS:+ }--spec=${arg}";;
           --ctag=*     ) OPENPKG_CTAG=${arg} 
OPENPKG_ARGS="$OPENPKG_ARGS${OPENPKG_ARGS:+ }--ctag=${arg}";;
           --exec=*     ) OPENPKG_EXEC=${arg} 
OPENPKG_ARGS="$OPENPKG_ARGS${OPENPKG_ARGS:+ }--exec=${arg}";;
  @@ -696,7 +699,7 @@
       if [ ".$B" = .HEAD ]; then
           BRANCH="HEAD"
       else
  -        BRANCH=`echo "$B" | sed -e 's;^OPENPKG_;;' -e 's;_STABLE$;;' -e 
's;SOLID$;;' -e 's;^HEAD$;;' -e 's;_;;g'`
  +        BRANCH=`echo "$B" | sed -e 's;^OPENPKG_;;' -e "s;^${OPENPKG_DIST};;" 
-e 's;_STABLE$;;' -e 's;SOLID$;;' -e 's;^HEAD$;;' -e 's;_;;g'`
           OPMAJORV=`echo ${BRANCH} | cut -c 1`
           OPMINORV=`echo ${BRANCH} | cut -c 2`
           if [ ".${OPMINORV}" != . ]; then
  @@ -711,11 +714,11 @@
       upload=""
       rpmwipe=""
       if [ ".${BRANCH}" = .HEAD ]; then
  -        rpm_release_req=`date '+%Y%m%d'`
  +        rpm_release_req="${OPENPKG_DIST}`date '+%Y%m%d'`"
           upload="current/SRC/00UPLOAD"
       fi
       if [ ".${BRANCH}" = .STABLE ]; then
  -        rpm_release_req="${OPMAJORV}.`date '+%Y%m%d'`"
  +        rpm_release_req="${OPENPKG_DIST}${OPMAJORV}.`date '+%Y%m%d'`"
           upload="stable/${OPMAJORV}/SRC/00UPLOAD"
       fi
       if [ ".${BRANCH}" = .SOLID ]; then
  @@ -725,24 +728,24 @@
               cvs_release=`builtin cd ${OPENPKG_WORK}/$S/${name} && cvs log 
-r${cvs_rev} ${name}.spec 2>/dev/null | fgrep $RELEASE`
               if [ ".${cvs_release}" = . ]; then
                   echo "++ detected post-branch pre-release engineering phase 
- keep zero update number"
  -                rpm_release_req="${OPMAJORV}.${OPMINORV}.0"
  +                rpm_release_req="${OPENPKG_DIST}${OPMAJORV}.${OPMINORV}.0"
                   upload="release/${OPMAJORV}.${OPMINORV}/SRC"
                   rpmwipe="${name}-${rpm_version_old}-${rpm_release_old}"
                   [ ".${rpmfile}" = ".${rpmwipe}" ] && rpmwipe=""
               else
                   update=`expr ${update} + 1`
  -                rpm_release_req="${OPMAJORV}.${OPMINORV}.${update}"
  +                
rpm_release_req="${OPENPKG_DIST}${OPMAJORV}.${OPMINORV}.${update}"
                   upload="release/${OPMAJORV}.${OPMINORV}/UPD/00UPLOAD"
               fi
           else
               echo "${update}" | ${EGREP} "^[0-9]{8}$" >/dev/null
               if [ $? != 0 ]; then
                   update=`expr ${update} + 1`
  -                rpm_release_req="${OPMAJORV}.${OPMINORV}.${update}"
  +                
rpm_release_req="${OPENPKG_DIST}${OPMAJORV}.${OPMINORV}.${update}"
                   upload="release/${OPMAJORV}.${OPMINORV}/UPD/00UPLOAD"
               else
                   update=`date '+%Y%m%d'`
  -                rpm_release_req="${OPMAJORV}.${OPMINORV}.${update}"
  +                
rpm_release_req="${OPENPKG_DIST}${OPMAJORV}.${OPMINORV}.${update}"
                   upload="solid/${OPMAJORV}.${OPMINORV}/UPD/00UPLOAD"
               fi
           fi
  @@ -1134,8 +1137,11 @@
       #   empty in, empty return (mapping emtpy to HEAD is the task of the 
caller)
       [ ".${RV}" = . ] && return
   
  -    #   strip off any abbreviated form of a leading OPENPKG_
  -    RV=`echo "${RV}" | sed -e 
's;^O\{0,1\}P\{0,1\}E\{0,1\}N\{0,1\}P\{0,1\}K\{0,1\}G\{0,1\}_\{0,1\};;'`
  +    #   leading dash looks like an option (-A)
  +    echo "${RV}" | egrep ^- >/dev/null && return
  +
  +    #   strip off anything before first underscore (OPENPKG_)
  +    RV=`echo "${RV}" | sed -e 's;^[^_]*_;;'`
   
       #   transform instance into branch
       RV=`echo "${RV}" | sed -e 's;^/[A-Z]\{1,\}$;HEAD;' -e 
's;^/[A-Z]\{1,\}\([1-9]\);\1_;'`
  @@ -1159,9 +1165,9 @@
           #   select direction, check optional direction
           echo ${BRANBP} | grep '_' >/dev/null
           if [ $? -eq 0 ]; then
  -            RV="OPENPKG_${BRANBP}_SOLID"
  +            RV="OPENPKG_${OPENPKG_DIST}${BRANBP}_SOLID"
           else
  -            RV="OPENPKG_${BRANBP}_STABLE"
  +            RV="OPENPKG_${OPENPKG_DIST}${BRANBP}_STABLE"
           fi
   
           unset BRANBP
  @@ -2300,7 +2306,7 @@
   
           if [ $force -eq 0 ]; then
               echo "++ checking release header having format suitable for 
automatic modification"
  -            ${EGREP} '^Release:  
*((([0-9]\.)?[0-9]{8})|[0-9]+\.[0-9]+\.[0-9])$' 
<${OPENPKG_WORK}/$S/${name}/${name}.spec >/dev/null
  +            ${EGREP} '^Release:  
*'${OPENPKG_DIST}'((([0-9]\.)?[0-9]{8})|[0-9]+\.[0-9]+\.[0-9])$' 
<${OPENPKG_WORK}/$S/${name}/${name}.spec >/dev/null
               if [ $? -eq 0 -a -d CVS ]; then
                   echo "++ checking whether release header was already 
modified"
                   (builtin cd ${OPENPKG_WORK}/$S/${name} && command cvs 2>&1 
diff -u0 ${name}.spec) \
  @@ -2889,6 +2895,7 @@
           --mode=... equal to setting OPENPKG_MODE
           --repo=... equal to setting OPENPKG_REPO
           --save=... equal to setting OPENPKG_SAVE
  +        --dist=... equal to setting OPENPKG_DIST
           --spec=... equal to setting OPENPKG_SPEC or running cmd "package"
           --ctag=... equal to setting OPENPKG_CTAG or running cmd "branch"
           --exec=... equal to setting OPENPKG_EXEC or running cmd "execute"
  @@ -3089,6 +3096,12 @@
   variable C<OPENPKG_SAVE> is read from F<~/openpkg/dev.rc>, read from
   environment or defaults to the contributor setting.
   
  +=item B<--dist=>I<name>
  +
  +Specify distribution release prefix. If omitted the
  +variable C<OPENPKG_DIST> is read from F<~/openpkg/dev.rc>, read from
  +environment or defaults to the empty string.
  +
   =item B<--spec=>I<name>
   
   Specify the name of the package to work with. This also sets the C<$P>
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     openpkg-cvs@openpkg.org

Reply via email to