From 328dfc816ab54bd9704a2e5fd3b88d9382160a1a Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Thu, 3 Nov 2016 05:40:16 +0000 Subject: Format to show directory levels. --- rtems-release-sources | 199 +++++++++++++++++++++++++------------------------- 1 file changed, 99 insertions(+), 100 deletions(-) diff --git a/rtems-release-sources b/rtems-release-sources index de714ef..741a2a9 100755 --- a/rtems-release-sources +++ b/rtems-release-sources @@ -85,123 +85,122 @@ fi # Work in a package specific directory in the release directory. # cd ${release} -rm -rf ${workspace} -mkdir ${workspace} -cd ${workspace} + rm -rf ${workspace} + mkdir ${workspace} + cd ${workspace} -echo "tar Jxf ../${prefix}.tar.xz" -tar Jxf ../${prefix}.tar.xz + echo "tar Jxf ../${prefix}.tar.xz" + tar Jxf ../${prefix}.tar.xz -# -# Get the RSB to download the source we need to release. This is 100% of the -# actual sourced used. -# -cd ${prefix} - cd rtems - export_source=rtems - mkdir sources patches - # - # Copy in any source not present on the server. If these are not copied in - # the RSB does not find them. - # - for p in rtems-tools rtems - do - cp ${top}/${release}/${p}-${release}.tar.xz sources/ - done - # - # Fetch the source for RTEMS tools. - # - echo "../source-builder/sb-set-builder --dry-run --with-download " \ - "--without-error-report --without-release-url " \ - "${rtems_pkgs}" - ../source-builder/sb-set-builder --dry-run --with-download \ - --without-error-report \ - --without-release-url \ - ${rtems_pkgs} - - # If git, svn or cvs exist the release fails. - # - if [ -d sources/git -o -d sources/svn -o -d sources/cvs ]; then - echo "error: ${release} contains repositories and cannot be released." - exit 1 - fi - # - # Clean out the packages we do not places in 'sources' we copied in.. - # - for p in rtems-tools rtems - do - rm sources/${p}-${release}.tar.xz - done - cd .. # - # Fetch the source for 3rd party packages tools. + # Get the RSB to download the source we need to release. This is 100% of the + # actual sourced used. # - if [ -n "${bare_pkgs}" -a "${bare_pkgs}" != "None" ]; then - cd bare - export_source="${export_source} bare" - mkdir sources patches + cd ${prefix} + cd rtems + export_source=rtems + mkdir sources patches + # + # Copy in any source not present on the server. If these are not copied in + # the RSB does not find them. + # + for p in rtems-tools rtems + do + cp ${top}/${release}/${p}-${release}.tar.xz sources/ + done + # + # Fetch the source for RTEMS tools. + # echo "../source-builder/sb-set-builder --dry-run --with-download " \ "--without-error-report --without-release-url " \ - "${bare_pkgs}" + "${rtems_pkgs}" ../source-builder/sb-set-builder --dry-run --with-download \ --without-error-report \ --without-release-url \ - ${bare_pkgs} - # - # If svn or cvs exist the release fails. + ${rtems_pkgs} + + # If git, svn or cvs exist the release fails. # - if [ -d sources/svn -o -d sources/cvs ]; then + if [ -d sources/git -o -d sources/svn -o -d sources/cvs ]; then echo "error: ${release} contains repositories and cannot be released." exit 1 fi # - # If there are git repos create packages of them as they are. - # - if [ -d sources/git ]; then - cd sources - cd git - for g in $(ls) - do - cd ${g} - hash=$(git status | grep '^HEAD detached at ' | sed 's/^HEAD detached at //') - prefix=$(echo ${g}-${hash} | sed 's/\./\-/') - echo "Packaging GIT repo: ${g} to ${prefix}" - git archive --format=tar --prefix=${prefix}/ ${hash} | xz > ../../${prefix}.tar.xz - cd .. - done + # Clean out the packages we do not places in 'sources' we copied in.. + # + for p in rtems-tools rtems + do + rm sources/${p}-${release}.tar.xz + done + cd .. + # + # Fetch the source for 3rd party packages tools. + # + if [ -n "${bare_pkgs}" -a "${bare_pkgs}" != "None" ]; then + cd bare + export_source="${export_source} bare" + mkdir sources patches + echo "../source-builder/sb-set-builder --dry-run --with-download " \ + "--without-error-report --without-release-url " \ + "${bare_pkgs}" + ../source-builder/sb-set-builder --dry-run --with-download \ + --without-error-report \ + --without-release-url \ + ${bare_pkgs} + # + # If svn or cvs exist the release fails. + # + if [ -d sources/svn -o -d sources/cvs ]; then + echo "error: ${release} contains repositories and cannot be released." + exit 1 + fi + # + # If there are git repos create packages of them as they are. + # + if [ -d sources/git ]; then + cd sources + cd git + for g in $(ls) + do + cd ${g} + hash=$(git status | grep '^HEAD detached at ' | sed 's/^HEAD detached at //') + prefix=$(echo ${g}-${hash} | sed 's/\./\-/') + echo "Packaging GIT repo: ${g} to ${prefix}" + git archive --format=tar --prefix=${prefix}/ ${hash} | xz > ../../${prefix}.tar.xz + cd .. + done + cd .. + rm -rf git cd .. - rm -rf git - cd .. - fi - cd .. - fi - # - # Export the sources and patches. - # - rm -rf ${top}/${release}/sources - mkdir ${top}/${release}/sources - for p in ${export_source} - do - cp ${p}/sources/* ${top}/${release}/sources/ - cp ${p}/patches/* ${top}/${release}/sources/ - done - cd .. + fi + cd .. + fi + # + # Export the sources and patches. + # + rm -rf ${top}/${release}/sources + mkdir ${top}/${release}/sources + for p in ${export_source} + do + cp ${p}/sources/* ${top}/${release}/sources/ + cp ${p}/patches/* ${top}/${release}/sources/ + done + cd .. -cd .. -rm -rf ${workspace} -cd .. - -cd ${release}/sources -rm -f ${checksum}sum.txt -for f in $(ls -1) -do - if [ ! -d ${f} ]; then - csum=$(${checksum} -q ${f}) - echo "${csum} ${f}" >> ${checksum}sum.txt - fi -done + cd .. + rm -rf ${workspace} -cd ../.. + cd ${release}/sources + rm -f ${checksum}sum.txt + for f in $(ls -1) + do + if [ ! -d ${f} ]; then + csum=$(${checksum} -q ${f}) + echo "${csum} ${f}" >> ${checksum}sum.txt + fi + done + cd .. + cd .. echo "Created: ${release}/sources/${checksum}sum.txt" echo "Created: ${release}/sources" -- cgit v1.2.3