Changeset 328dfc8 in rtems-release


Ignore:
Timestamp:
Nov 3, 2016, 5:40:16 AM (4 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
8c365179ece35d4d61b151cb4b7609059840900b, 62681ee71d8e9f538f5f1899c12b89ef36ccb4cf
Children:
0cf9c0e
Parents:
b65befb
Message:

Format to show directory levels.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rtems-release-sources

    rb65befb r328dfc8  
    8686#
    8787cd ${release}
    88 rm -rf ${workspace}
    89 mkdir ${workspace}
    90 cd ${workspace}
    91 
    92 echo "tar Jxf ../${prefix}.tar.xz"
    93 tar Jxf ../${prefix}.tar.xz
    94 
    95 #
    96 # Get the RSB to download the source we need to release. This is 100% of the
    97 # actual sourced used.
    98 #
    99 cd ${prefix}
    100  cd rtems
    101   export_source=rtems
    102   mkdir sources patches
    103   #
    104   # Copy in any source not present on the server. If these are not copied in
    105   # the RSB does not find them.
    106   #
    107   for p in rtems-tools rtems
    108   do
    109    cp ${top}/${release}/${p}-${release}.tar.xz sources/
    110   done
    111   #
    112   # Fetch the source for RTEMS tools.
    113   #
    114   echo "../source-builder/sb-set-builder --dry-run --with-download " \
    115        "--without-error-report --without-release-url " \
    116        "${rtems_pkgs}"
    117   ../source-builder/sb-set-builder --dry-run --with-download \
    118                                    --without-error-report \
    119                                    --without-release-url \
    120                                    ${rtems_pkgs}
    121 
    122   # If git, svn or cvs exist the release fails.
    123   #
    124   if [ -d sources/git -o -d sources/svn -o -d sources/cvs ]; then
    125    echo "error: ${release} contains repositories and cannot be released."
    126    exit 1
    127   fi
    128   #
     88 rm -rf ${workspace}
     89 mkdir ${workspace}
     90 cd ${workspace}
     91
     92 echo "tar Jxf ../${prefix}.tar.xz"
     93 tar Jxf ../${prefix}.tar.xz
     94
     95 #
     96 # Get the RSB to download the source we need to release. This is 100% of the
     97 # actual sourced used.
     98 #
     99 cd ${prefix}
     100  cd rtems
     101   export_source=rtems
     102   mkdir sources patches
     103   #
     104   # Copy in any source not present on the server. If these are not copied in
     105   # the RSB does not find them.
     106   #
     107   for p in rtems-tools rtems
     108   do
     109    cp ${top}/${release}/${p}-${release}.tar.xz sources/
     110   done
     111   #
     112   # Fetch the source for RTEMS tools.
     113   #
     114   echo "../source-builder/sb-set-builder --dry-run --with-download " \
     115        "--without-error-report --without-release-url " \
     116        "${rtems_pkgs}"
     117   ../source-builder/sb-set-builder --dry-run --with-download \
     118                                    --without-error-report \
     119                                    --without-release-url \
     120                                    ${rtems_pkgs}
     121
     122   # If git, svn or cvs exist the release fails.
     123   #
     124   if [ -d sources/git -o -d sources/svn -o -d sources/cvs ]; then
     125    echo "error: ${release} contains repositories and cannot be released."
     126    exit 1
     127   fi
     128   #
    129129  # Clean out the packages we do not places in 'sources' we copied in..
    130130  #
     
    134134  done
    135135  cd ..
    136  #
    137  # Fetch the source for 3rd party packages tools.
    138  #
    139  if [ -n "${bare_pkgs}" -a "${bare_pkgs}" != "None" ]; then
    140   cd bare
    141    export_source="${export_source} bare"
    142   mkdir sources patches
    143    echo "../source-builder/sb-set-builder --dry-run --with-download " \
    144         "--without-error-report --without-release-url " \
    145         "${bare_pkgs}"
    146    ../source-builder/sb-set-builder --dry-run --with-download \
    147                                     --without-error-report \
    148                                     --without-release-url \
    149                                     ${bare_pkgs}
    150    #
    151    # If svn or cvs exist the release fails.
    152    #
    153    if [ -d sources/svn -o -d sources/cvs ]; then
    154     echo "error: ${release} contains repositories and cannot be released."
    155     exit 1
     136  #
     137  # Fetch the source for 3rd party packages tools.
     138  #
     139  if [ -n "${bare_pkgs}" -a "${bare_pkgs}" != "None" ]; then
     140   cd bare
     141    export_source="${export_source} bare"
     142    mkdir sources patches
     143    echo "../source-builder/sb-set-builder --dry-run --with-download " \
     144         "--without-error-report --without-release-url " \
     145         "${bare_pkgs}"
     146    ../source-builder/sb-set-builder --dry-run --with-download \
     147                                     --without-error-report \
     148                                     --without-release-url \
     149                                     ${bare_pkgs}
     150    #
     151    # If svn or cvs exist the release fails.
     152    #
     153    if [ -d sources/svn -o -d sources/cvs ]; then
     154     echo "error: ${release} contains repositories and cannot be released."
     155     exit 1
     156    fi
     157    #
     158    # If there are git repos create packages of them as they are.
     159    #
     160    if [ -d sources/git ]; then
     161     cd sources
     162      cd git
     163       for g in $(ls)
     164       do
     165        cd ${g}
     166         hash=$(git status | grep '^HEAD detached at ' | sed 's/^HEAD detached at //')
     167         prefix=$(echo ${g}-${hash} | sed 's/\./\-/')
     168         echo "Packaging GIT repo: ${g} to ${prefix}"
     169         git archive --format=tar --prefix=${prefix}/ ${hash} | xz > ../../${prefix}.tar.xz
     170         cd ..
     171       done
     172       cd ..
     173       rm -rf git
     174      cd ..
     175    fi
     176    cd ..
     177  fi
     178  #
     179  # Export the sources and patches.
     180  #
     181  rm -rf ${top}/${release}/sources
     182  mkdir ${top}/${release}/sources
     183  for p in ${export_source}
     184  do
     185   cp ${p}/sources/* ${top}/${release}/sources/
     186   cp ${p}/patches/* ${top}/${release}/sources/
     187  done
     188  cd ..
     189
     190 cd ..
     191 rm -rf ${workspace}
     192
     193 cd ${release}/sources
     194  rm -f ${checksum}sum.txt
     195  for f in $(ls -1)
     196  do
     197   if [ ! -d ${f} ]; then
     198    csum=$(${checksum} -q ${f})
     199    echo "${csum} ${f}" >> ${checksum}sum.txt
    156200   fi
    157    #
    158    # If there are git repos create packages of them as they are.
    159    #
    160    if [ -d sources/git ]; then
    161     cd sources
    162      cd git
    163       for g in $(ls)
    164       do
    165        cd ${g}
    166         hash=$(git status | grep '^HEAD detached at ' | sed 's/^HEAD detached at //')
    167         prefix=$(echo ${g}-${hash} | sed 's/\./\-/')
    168         echo "Packaging GIT repo: ${g} to ${prefix}"
    169         git archive --format=tar --prefix=${prefix}/ ${hash} | xz > ../../${prefix}.tar.xz
    170         cd ..
    171       done
    172       cd ..
    173       rm -rf git
    174      cd ..
    175    fi
    176    cd ..
    177  fi
    178  #
    179  # Export the sources and patches.
    180  #
    181  rm -rf ${top}/${release}/sources
    182  mkdir ${top}/${release}/sources
    183  for p in ${export_source}
    184  do
    185   cp ${p}/sources/* ${top}/${release}/sources/
    186   cp ${p}/patches/* ${top}/${release}/sources/
    187  done
     201  done
     202  cd ..
    188203 cd ..
    189 
    190 cd ..
    191 rm -rf ${workspace}
    192 cd ..
    193 
    194 cd ${release}/sources
    195 rm -f ${checksum}sum.txt
    196 for f in $(ls -1)
    197 do
    198  if [ ! -d ${f} ]; then
    199   csum=$(${checksum} -q ${f})
    200   echo "${csum} ${f}" >> ${checksum}sum.txt
    201  fi
    202 done
    203 
    204 cd ../..
    205204
    206205echo "Created: ${release}/sources/${checksum}sum.txt"
Note: See TracChangeset for help on using the changeset viewer.