Changeset a879868 in rtems-testing


Ignore:
Timestamp:
May 14, 2015, 7:55:42 PM (4 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, 8895273c193787f84c4585a10f6d6aceb3b25dc4
Children:
c4ebcc1
Parents:
8a18d25
Message:

release.sh: Add structure for repository specific actions

This should make it straightforward to update version.py in
the rtems-source-builder or odd actions required as part of
release by other repositories.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release-helpers/release.sh

    r8a18d25 ra879868  
    187187##### END OF ERROR CHECKING
    188188
    189 ACLOCAL_VERSION_M4=" \
    190 testsuites/aclocal/version.m4 \
    191 aclocal/version.m4 \
    192 cpukit/aclocal/version.m4 \
    193 c/src/aclocal/version.m4"
    194 
     189# Determine the repository. This is used to trip special actions
     190repo=`git rev-parse --show-toplevel`
     191repo=`basename ${repo}`
     192
     193# For the RTEMS repository, update the aclocal.m4 and VERSION file
    195194update_aclocal_version_for_version()
    196195{
     196  ACLOCAL_VERSION_M4=" testsuites/aclocal/version.m4 \
     197    aclocal/version.m4 cpukit/aclocal/version.m4 c/src/aclocal/version.m4"
     198
    197199  RV=${VERSION}
    198   for f in ${ACLOCAL_VERSION_M4}
    199   do
    200     sed -i -e "s|\[_RTEMS_VERSION\],\[.*\]|\[_RTEMS_VERSION\],\[${RV}\]|" ${f}
    201   done
    202   sed -i -e "s,\(^RTEMS Version\).*,\1 ${RV}," VERSION
    203   git add ${ACLOCAL_VERSION_M4} VERSION
    204   git commit -m "all version.m4, VERSION: Update to ${RV}"
    205 }
    206 
     200  case ${repo} in
     201    rtems)
     202      for f in ${ACLOCAL_VERSION_M4}
     203      do
     204        sed -i \
     205          -e "s|\[_RTEMS_VERSION\],\[.*\]|\[_RTEMS_VERSION\],\[${RV}\]|" ${f}
     206      done
     207      sed -i -e "s,\(^RTEMS Version\).*,\1 ${RV}," VERSION
     208      git add ${ACLOCAL_VERSION_M4} VERSION
     209      git commit -m "all version.m4, VERSION: Update to ${RV}"
     210      ;;
     211    rtems-source-builder)
     212      # XXX update version.py
     213      check_error 1 "Need to update version.py"
     214      ;;
     215    *)
     216      sed -i -e "s,\(^RTEMS Version\).*,\1 ${RV}," VERSION
     217      git add VERSION
     218      git commit -m "VERSION: Update to ${RV}"
     219      ;;
     220  esac
     221}
     222
     223# For the RTEMS repository, update the documentation versioning information
    207224update_doc_versions()
    208225{
     
    221238}
    222239
     240# So far, this only occurs with the RTEMS repository
    223241build_doxygen()
    224242{
     
    253271}
    254272
    255 # Step 1: Update the various version files
     273### Update the various version files
    256274vecho "Updating aclocal version.m4 and VERSION files"
    257275update_aclocal_version_for_version
    258276
    259 # Step 2: Update the documentation
    260 vecho "Updating version and dates in documentation"
    261 update_doc_versions
     277### Update the documentation
     278if [ ${repo} = "rtems" ] ; then
     279  vecho "Updating version and dates in documentation"
     280  update_doc_versions
     281fi
    262282
    263283# No further actions needed if bumping major version
     
    271291BASE=`pwd`
    272292
     293### Check that the tag does not exist
     294git tag | grep ${VERSION} >/dev/null
     295if [ $? -eq 0 ] ; then
     296  check_error 1 "git tag of ${VERSION} already exists"
     297fi
     298
    273299### Tag the source
    274300git tag ${VERSION}
    275301check_error $? "Unable to git tag"
    276302
    277 ### Now generate the RTEMS tarball generation
    278 vecho "Generating the RTEMS tarball"
    279 rm -rf rtems-${VERSION} \
    280        rtems-${VERSION}-not_bootstrapped.tar \
    281        rtems-${VERSION}.tar.bz2
    282 git archive --format=tar --prefix=rtems-${VERSION}/ ${VERSION} \
    283    >rtems-${VERSION}-not_bootstrapped.tar
    284 check_error $? "Unable to perform git archive"
    285 
    286 tar xf rtems-${VERSION}-not_bootstrapped.tar
    287 cd rtems-${VERSION}/
    288 check_error $? "Unable to cd to untarred RTEMS source"
    289 
    290 # bootstrap and then remove unnecessary files
    291 sb-bootstrap >/dev/null 2>&1
    292 check_error $? "Unable to bootstrap the RTEMS source code"
    293 
    294 find .  -name "stamp.*" \
    295      -o -name "autom4te.cache" \
    296      -o -name "rsb-log-*.txt" \
    297      | xargs -e rm -rf
    298 cd ..
    299 tar cjf rtems-${VERSION}.tar.bz2 rtems-${VERSION}
    300 check_error $? "Unable to create bootstrapped tar.bz2 for release"
    301 
    302 rm -f rtems-${VERSION}-not_bootstrapped.tar
    303 
    304 ### Now generate the documentation
    305 vecho "Generating the RTEMS documentation tarball"
    306 rm -rf b-doc rtemsdocs-${VERSION} rtemsdocs-${VERSION}.tar.bz2
    307 mkdir b-doc
    308 cd b-doc
    309 ../rtems-${VERSION}/doc/configure --enable-maintainer-mode \
    310   --prefix=/opt/rtems-${VERSION} >c.log 2>&1
    311 check_error $? "Unable to configure RTEMS documentation"
    312 
    313 make >b.log 2>&1
    314 check_error $? "Unable to build RTEMS documentation"
    315 
    316 make prefix=${BASE}/rtemsdocs-${VERSION} install >i.log 2>&1
    317 check_error $? "Unable to install RTEMS documentation"
    318 
    319 cd ..
    320 test -d rtemsdocs-${VERSION}
    321 check_error $? "Documentation was not installed into temporary location"
    322 
    323 tar cjf rtemsdocs-${VERSION}.tar.bz2 rtemsdocs-${VERSION}
    324 check_error $? "Unable to create RTEMS Documentation tar.bz2 for release"
    325 
    326 rm -rf b-docs
    327 
    328 ### Now generate Doxygen
    329 doxyDir=rtems-doxygen-${VERSION}
    330 doxyOut=${BASE}/${doxyDir}
    331 rm -rf ${doxyOut}
    332 build_doxygen ${doxyOut}
    333 
    334 cd ${BASE}
    335 tar cjf ${doxyDir}.tar.bz2 ${doxyDir}
    336 check_error $? "Unable to create RTEMS Doxygen tar.bz2 for release"
    337 
    338 
     303### Now generate the tarball
     304if [ ${repo} = "rtems" ] ; then
     305  vecho "Generating the RTEMS tarball"
     306  rm -rf rtems-${VERSION} \
     307         rtems-${VERSION}-not_bootstrapped.tar \
     308         rtems-${VERSION}.tar.bz2
     309  git archive --format=tar --prefix=rtems-${VERSION}/ ${VERSION} \
     310     >rtems-${VERSION}-not_bootstrapped.tar
     311  check_error $? "Unable to perform git archive"
     312
     313  tar xf rtems-${VERSION}-not_bootstrapped.tar
     314  cd rtems-${VERSION}/
     315  check_error $? "Unable to cd to untarred RTEMS source"
     316
     317  # bootstrap and then remove unnecessary files
     318  sb-bootstrap >/dev/null 2>&1
     319  check_error $? "Unable to bootstrap the RTEMS source code"
     320
     321  find .  -name "stamp.*" \
     322       -o -name "autom4te.cache" \
     323       -o -name "rsb-log-*.txt" \
     324       | xargs -e rm -rf
     325  cd ..
     326  tar cjf rtems-${VERSION}.tar.bz2 rtems-${VERSION}
     327  check_error $? "Unable to create bootstrapped tar.bz2 for release"
     328
     329  rm -f rtems-${VERSION}-not_bootstrapped.tar
     330
     331else
     332  vecho "Generating the ${repo} tarball"
     333  git archive --format=tar --prefix=${repo}-${VERSION}/ ${VERSION} \
     334     | bzip2 -9 >${repo}-${VERSION}.tar.bz2
     335  check_error $? "Unable to perform git archive on ${repo}"
     336fi
     337
     338### RTEMS has special actions after generating the tarball
     339if [ ${repo} = "rtems" ] ; then
     340  ### Now generate the documentation
     341  vecho "Generating the RTEMS documentation tarball"
     342  rm -rf b-doc rtemsdocs-${VERSION} rtemsdocs-${VERSION}.tar.bz2
     343  mkdir b-doc
     344  cd b-doc
     345  ../rtems-${VERSION}/doc/configure --enable-maintainer-mode \
     346    --prefix=/opt/rtems-${VERSION} >c.log 2>&1
     347  check_error $? "Unable to configure RTEMS documentation"
     348
     349  make >b.log 2>&1
     350  check_error $? "Unable to build RTEMS documentation"
     351
     352  make prefix=${BASE}/rtemsdocs-${VERSION} install >i.log 2>&1
     353  check_error $? "Unable to install RTEMS documentation"
     354
     355  cd ..
     356  test -d rtemsdocs-${VERSION}
     357  check_error $? "Documentation was not installed into temporary location"
     358
     359  tar cjf rtemsdocs-${VERSION}.tar.bz2 rtemsdocs-${VERSION}
     360  check_error $? "Unable to create RTEMS Documentation tar.bz2 for release"
     361
     362  rm -rf b-docs
     363
     364  ### Now generate Doxygen
     365  doxyDir=rtems-doxygen-${VERSION}
     366  doxyOut=${BASE}/${doxyDir}
     367  rm -rf ${doxyOut}
     368  build_doxygen ${doxyOut}
     369
     370  cd ${BASE}
     371  tar cjf ${doxyDir}.tar.bz2 ${doxyDir}
     372  check_error $? "Unable to create RTEMS Doxygen tar.bz2 for release"
     373fi
    339374
    340375exit 0
Note: See TracChangeset for help on using the changeset viewer.