[rtems-release commit] Use defaults for compress.

Chris Johns chrisj at rtems.org
Wed Apr 12 11:53:21 UTC 2017


Module:    rtems-release
Branch:    master
Commit:    bcd2dd316232bdf8e7dafdaa971f33263801291e
Changeset: http://git.rtems.org/rtems-release/commit/?id=bcd2dd316232bdf8e7dafdaa971f33263801291e

Author:    Chris Johns <chrisj at rtems.org>
Date:      Wed Apr 12 10:54:02 2017 +1000

Use defaults for compress.

The threading option is added to the XZ command.

---

 rtems-release          |  3 ++-
 rtems-release-defaults |  7 +++++++
 rtems-release-docs     | 31 ++++++++++++++++---------------
 rtems-release-kernel   |  9 +++++----
 rtems-release-package  |  4 ++--
 rtems-release-sources  |  8 ++++----
 6 files changed, 36 insertions(+), 26 deletions(-)

diff --git a/rtems-release b/rtems-release
index 28c92e3..341fe90 100755
--- a/rtems-release
+++ b/rtems-release
@@ -81,7 +81,8 @@ build rtems-source-builder ${version} ${revision} rtems-release-rsb-version
 if [ ${rtems_examples} = yes ]; then
   build examples-v2         ${version} ${revision}
   # Hack around the repo naming.
-  mv ${release}/examples-v2-${release}.tar.xz ${release}/rtems-examples-v2-${release}.tar.xz
+  mv ${release}/examples-v2-${release}.tar.${comp_ext} \
+     ${release}/rtems-examples-v2-${release}.tar.${comp_ext}
 fi
 if [ ${rtems_libbsd} = yes ]; then
  build rtems-libbsd        ${version} ${revision}
diff --git a/rtems-release-defaults b/rtems-release-defaults
index 54dc51b..6fcf328 100755
--- a/rtems-release-defaults
+++ b/rtems-release-defaults
@@ -48,6 +48,13 @@ top=${PWD}
 checksum=sha512
 
 #
+# Default compression and options plus file suffix.
+#
+comp=xz --threads=0
+comp_ext=xz
+comp_tar=J
+
+#
 # Defaults.
 #
 rtems_examples=yes
diff --git a/rtems-release-docs b/rtems-release-docs
index bb57958..ee9f176 100755
--- a/rtems-release-docs
+++ b/rtems-release-docs
@@ -68,14 +68,14 @@ cd ${git_local}
  git fetch origin
  echo "git archive --format=tar --prefix=${prefix}/ origin/${version}"
  git archive --format=tar --prefix=${prefix}/ origin/${version} | \
-     xz > ../${prefix}-unstamped.tar.xz
+     ${comp} > ../${prefix}-unstamped.tar.${comp_ext}
  cd ..
 
 #
 # Stamp the source and package
 #
-echo "tar Jxf ../${prefix}-unstamped.tar.xz"
-tar Jxf ${prefix}-unstamped.tar.xz
+echo "tar ${comp_tar}xf ../${prefix}-unstamped.tar.${comp_ext}"
+tar ${comp_tar}xf ${prefix}-unstamped.tar.${comp_ext}
 
 cd ${prefix}
  #
@@ -90,9 +90,9 @@ cd ${prefix}
  cd ..
 
 echo "tar cf - ${prefix}"
-tar cf - ${prefix} | xz > ../${prefix}.tar.xz
+tar cf - ${prefix} | ${comp} > ../${prefix}.tar.${comp_ext}
 
-echo "Created: ${release}/${prefix}.tar.xz"
+echo "Created: ${release}/${prefix}.tar.${comp_ext}"
 
 #
 # Build the docs.
@@ -108,8 +108,8 @@ cd ${prefix}
 #
 mkdir ${top}/${release}/docs
 cd install
- echo "Creating DOC all rtems-${release}-docs-all.tar.xz"
- tar cf - * > ${top}/${release}/docs/rtems-${release}-docs-all.tar.xz
+ echo "Creating DOC all rtems-${release}-docs-all.tar.${comp_ext}"
+ tar cf - * | ${comp} > ${top}/${release}/docs/rtems-${release}-docs-all.tar.${comp_ext}
  for p in $(find . -name \*.pdf)
  do
   manual=$(echo $(basename $p) | sed -e "s/\\..*//")
@@ -117,21 +117,22 @@ cd install
   #
   # Compress the PDF and move it out of the way.
   #
-  echo "Creating PDF rtems-${release}-${manual}.pdf.xz"
-  xz $p
-  mv $p.xz ${top}/${release}/docs/rtems-${release}-${manual}.pdf.xz
+  echo "Creating PDF rtems-${release}-${manual}.pdf.${comp_ext}"
+  ${comp} $p
+  mv $p.${comp_ext} ${top}/${release}/docs/rtems-${release}-${manual}.pdf.${comp_ext}
   #
   # Create the single html manual
   #
-  echo "Creating SingleHTML rtems-${release}-${manual}.html.xz"
+  echo "Creating SingleHTML rtems-${release}-${manual}.html.${comp_ext}"
   mv ${base}/${manual}.html ${base}/rtems-${release}-${manual}.html
-  xz ${base}/rtems-${release}-${manual}.html
-  mv ${base}/rtems-${release}-${manual}.html.xz ${top}/${release}/docs/.
+  ${comp} ${base}/rtems-${release}-${manual}.html
+  mv ${base}/rtems-${release}-${manual}.html.${comp_ext} ${top}/${release}/docs/.
   #
   # Tar the multi-page html and install.
   #
-  echo "Creating HTML rtems-${release}-${manual}-html.tar.xz"
-  tar cf - ${base}/${manual} > ${top}/${release}/docs/rtems-${release}-${manual}-html.tar.xz
+  echo "Creating HTML rtems-${release}-${manual}-html.tar.${comp_ext}"
+  tar cf - ${base}/${manual} | \
+      ${comp} > ${top}/${release}/docs/rtems-${release}-${manual}-html.tar.${comp_ext}
  done
  cd ..
 
diff --git a/rtems-release-kernel b/rtems-release-kernel
index fe67112..8859517 100755
--- a/rtems-release-kernel
+++ b/rtems-release-kernel
@@ -62,8 +62,8 @@ echo "Release: ${release}"
 # Unpack the released RSB.
 #
 rsb=rtems-source-builder-${release}
-echo "tar Jxf ../${rsb}.tar.xz"
-tar Jxf ../${rsb}.tar.xz
+echo "tar ${comp_tar}xf ../${rsb}.tar.${comp_ext}"
+tar ${comp_tar}xf ../${rsb}.tar.${comp_ext}
 
 #
 # Build autoconf and automake.
@@ -133,8 +133,9 @@ cat ${prefix}/cpukit/Doxyfile.in | \
 	-e "s/^INPUT[[:space:]].*=.*$/INPUT = ${top_srcdir}/g" > Doxyfile
 doxygen Doxyfile
 
-echo "Creating: rtems-doxygen-${release}.tar.xz"
+echo "Creating: rtems-doxygen-${release}.tar.${comp_ext}"
 mv cpukit_doxy/html rtems-doxygen-${release}
-tar cf - rtems-doxygen-${release} | xz > ../rtems-doxygen-${release}.tar.xz
+tar cf - rtems-doxygen-${release} | \
+    ${comp} > ../rtems-doxygen-${release}.tar.${comp_ext}
 
 exit 0
diff --git a/rtems-release-package b/rtems-release-package
index c7e0b8c..26e387d 100755
--- a/rtems-release-package
+++ b/rtems-release-package
@@ -127,9 +127,9 @@ fi
 # The '..' is the release directory.
 #
 echo "tar cf - ${prefix}"
-tar cf - ${prefix} | xz > ../${prefix}.tar.xz
+tar cf - ${prefix} | ${comp} > ../${prefix}.tar.${comp_ext}
 
-echo "Created: ${release}/${prefix}.tar.xz"
+echo "Created: ${release}/${prefix}.tar.${comp_ext}"
 
 #
 # Comman package end.
diff --git a/rtems-release-sources b/rtems-release-sources
index fcb7df1..1c823c9 100755
--- a/rtems-release-sources
+++ b/rtems-release-sources
@@ -84,8 +84,8 @@ cd ${release}
  mkdir ${workspace}
  cd ${workspace}
 
-  echo "tar Jxf ../${prefix}.tar.xz"
-  tar Jxf ../${prefix}.tar.xz
+  echo "tar ${comp_tar}xf ../${prefix}.tar.${comp_ext}"
+  tar ${comp_tar}xf ../${prefix}.tar.${comp_ext}
 
   #
   # Get the RSB to download the source we need to release. This is 100% of the
@@ -101,7 +101,7 @@ cd ${release}
     #
     for p in rtems-tools rtems
     do
-     cp ${top}/${release}/${p}-${release}.tar.xz sources/
+     cp ${top}/${release}/${p}-${release}.tar.${comp_ext} sources/
     done
     #
     # Fetch the source for RTEMS tools.
@@ -155,7 +155,7 @@ cd ${release}
           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
+          git archive --format=tar --prefix=${prefix}/ ${hash} | ${comp} > ../../${prefix}.tar.${comp_ext}
           cd ..  # ${g}
         done
         cd ..   # git



More information about the vc mailing list