From 6f285ca28d9ebe11711b2c3daffd3b7029642e47 Mon Sep 17 00:00:00 2001 From: Richard Kimberly Heck Date: Sat, 8 Sep 2018 14:24:49 -0400 Subject: [PATCH] Debugging, etc, for build script. --- development/tools/lyx-build | 184 +++++++++++++++++++----------------- 1 file changed, 98 insertions(+), 86 deletions(-) diff --git a/development/tools/lyx-build b/development/tools/lyx-build index 0463e4de5b..03623baa66 100755 --- a/development/tools/lyx-build +++ b/development/tools/lyx-build @@ -5,6 +5,8 @@ # It also includes several other tests, to make sure the packages # works as it should. +#DEBUG=echo; + # A few variables need to be set, here at the top. # # Where we will do our work @@ -15,10 +17,13 @@ SRCDIR="/cvs/lyx/lyx-stable"; if [ -z "$EDITOR" ]; then EDITOR=vi; fi # Options to make, when we compile MAKEOPTS="-j4"; +# Compile? +COMPILE="YES"; PKGNUM=""; -while getopts ":m:p:" opt; do +while getopts ":Cm:p:" opt; do case $opt in + C ) COMPILE="";; m ) MAKEOPTS="$OPTARG";; p ) PKGNUM="$OPTARG";; \? ) echo "Unknown option $opt"; exit 1;; @@ -40,59 +45,61 @@ echo -n "Ready to build source packages..."; read echo "Exporting clean tree..."; -rm -Rf $BASE/lyx-export/ -git checkout-index -a -f --prefix=$BASE/lyx-export/ -cd $BASE/lyx-export/ -./autogen.sh -rm -Rf $BASE/lyx-build/ -mkdir $BASE/lyx-build/ -cd $BASE/lyx-build/ +$DEBUG rm -Rf $BASE/lyx-export/ +$DEBUG git checkout-index -a -f --prefix=$BASE/lyx-export/ +$DEBUG cd $BASE/lyx-export/ +$DEBUG ./autogen.sh +$DEBUG rm -Rf $BASE/lyx-build/ +$DEBUG mkdir $BASE/lyx-build/ +$DEBUG cd $BASE/lyx-build/ echo "Building distribution..."; -$BASE/lyx-export/configure --enable-build-type=rel --enable-qt5 -if ! make lyxdist; then +$DEBUG $BASE/lyx-export/configure --enable-build-type=rel --enable-qt5 +if ! $DEBUG make lyxdist; then echo "Couldn't make distribution!"; exit 1; fi echo "Packages created:"; if [ -n "$PKGNUM" ]; then - mv lyx-$VERSION_BASE.tar.gz lyx-$VERSION.tar.gz; - mv lyx-$VERSION_BASE.tar.xz lyx-$VERSION.tar.xz; + $DEBUG mv lyx-$VERSION_BASE.tar.gz lyx-$VERSION.tar.gz; + $DEBUG mv lyx-$VERSION_BASE.tar.xz lyx-$VERSION.tar.xz; fi -cp -v lyx-$VERSION.tar.{gz,xz} $BASE; +$DEBUG cp -v lyx-$VERSION.tar.{gz,xz} $BASE; echo -n "Ready to build signatures..."; read -gpg -b lyx-$VERSION.tar.gz -gpg -b lyx-$VERSION.tar.xz +$DEBUG gpg -b lyx-$VERSION.tar.gz +$DEBUG gpg -b lyx-$VERSION.tar.xz echo "Signatures created:" -cp -v lyx-$VERSION.tar.*.sig $BASE; +$DEBUG cp -v lyx-$VERSION.tar.*.sig $BASE; -echo -n "Ready to test compilation..."; -read +if [ -n "$COMPILE" ]; then + echo -n "Ready to test compilation..."; + read -rm -Rf $BASE/lyx-test/ -mkdir $BASE/lyx-test/ -cd $BASE/lyx-test/ -tar -zxvf $BASE/lyx-build/lyx-$VERSION.tar.gz -if ! cd lyx-$VERSION_BASE; then - echo "Unable to enter build directory!"; - exit 1; -fi + $DEBUG rm -Rf $BASE/lyx-test/ + $DEBUG mkdir $BASE/lyx-test/ + $DEBUG cd $BASE/lyx-test/ + $DEBUG tar -zxvf $BASE/lyx-build/lyx-$VERSION.tar.gz + if ! $DEBUG cd lyx-$VERSION_BASE; then + echo "Unable to enter build directory!"; + exit 1; + fi -./configure --enable-build-type=rel --enable-qt5 + $DEBUG ./configure --enable-build-type=rel --enable-qt5 -if make $MAKEOPTS; then - echo "Compilation complete."; - echo -n "Ready to run LyX..."; - read - src/lyx -userdir /tmp/lyx-test -else - echo "Compilation errors!!"; - exit 1; + if $DEBUG make $MAKEOPTS; then + echo "Compilation complete."; + echo -n "Ready to run LyX..."; + read + $DEBUG src/lyx -userdir /tmp/lyx-test + else + echo "Compilation errors!!"; + exit 1; + fi fi LASTNUM=$(echo $VERSION_BASE | sed -e 's/.*\.//'); @@ -102,47 +109,53 @@ ORIGINAL=${FIRST}0; LAST=$FIRST$LAST; if [ ! -d "$BASE/lyx-patch/" ]; then - mkdir "$BASE/lyx-patch/" || exit 1; + $DEBUG mkdir "$BASE/lyx-patch/" || exit 1; fi if [ ! -d $BASE/lyx-patch/lyx-$LAST ]; then - echo "Can't find directory for last version $LAST."; - echo "See if you can fix this in $BASE/lyx-patch/."; - echo "Try that, if you like, and then we'll continue."; - echo "We'll try to download from the LyX site if that does not work."; - read; + echo "Can't find directory for last version $LAST."; + echo "See if you can fix this in $BASE/lyx-patch/."; + echo "Try that, if you like, and then we'll continue."; + echo "We'll try to download from the LyX site if that does not work."; + read; - if [ ! -d $BASE/lyx-patch/lyx-$LAST ]; then - echo "Will try to download from LyX site...."; - pushd $BASE/lyx-patch/; - wget ftp://ftp.lyx.org/pub/lyx/stable/${FIRST}x/lyx-$LAST.tar.gz; - wget ftp://ftp.lyx.org/pub/lyx/stable/${FIRST}x/lyx-$LAST.tar.gz.sig - gpg -q --verify lyx-$LAST.tar.gz.sig - if ! [ $? == 0 ]; then - echo "Signature wrong!" - exit 1; + if [ -z "$DEBUG" ]; then + if [ ! -d $BASE/lyx-patch/lyx-$LAST ]; then + echo "Will try to download from LyX site...."; + pushd $BASE/lyx-patch/; + wget ftp://ftp.lyx.org/pub/lyx/stable/${FIRST}x/lyx-$LAST.tar.gz; + wget ftp://ftp.lyx.org/pub/lyx/stable/${FIRST}x/lyx-$LAST.tar.gz.sig + gpg -q --verify lyx-$LAST.tar.gz.sig + if ! [ $? == 0 ]; then + echo "Signature wrong!" + exit 1; + fi + rm lyx-$LAST.tar.gz.sig + tar -zxvf lyx-$LAST.tar.gz; + if [ ! -f lyx-$LAST.tar.gz ]; then + echo "Still unable to find directory for last version $LAST."; + exit 1; + fi + $DEBUG popd; + fi fi - rm lyx-$LAST.tar.gz.sig - tar -zxvf lyx-$LAST.tar.gz; - if [ ! -f lyx-$LAST.tar.gz ]; then - echo "Still unable to find directory for last version $LAST."; - exit 1; - fi - popd; - fi fi echo -n "Ready to make patch against $LAST..."; read -cd $BASE/lyx-patch/; -tar -zxvf $BASE/lyx-build/lyx-$VERSION.tar.gz >/dev/null; +$DEBUG cd $BASE/lyx-patch/; +if [ -z "$DEBUG" ]; then + tar -zxvf $BASE/lyx-build/lyx-$VERSION.tar.gz >/dev/null; + diff -urN -x .svn -x version.cpp lyx-$LAST lyx-$VERSION_BASE > patch; + echo -n "Please check the patch..."; + read + $EDITOR patch; +else + $DEBUG tar -zxvf $BASE/lyx-build/lyx-$VERSION.tar.gz; + $DEBUG diff -urN -x .svn -x version.cpp lyx-$LAST lyx-$VERSION_BASE; +fi -diff -urN -x .svn -x version.cpp lyx-$LAST lyx-$VERSION > patch - -echo -n "Please check the patch..."; -read -$EDITOR patch; NUMFIX="th"; if [ "$LASTNUM" = "1" ]; then @@ -151,26 +164,25 @@ elif [ "$LASTNUM" = "2" ]; then NUMFIX="nd"; fi NUM="$LASTNUM$NUMFIX"; -cat $BASE/lyx-export/development/tools/patch-preamble | \ -sed -e "s/VERSION/$VERSION_BASE/; s/ORIGINAL/$ORIGINAL/; s/LAST/$LAST/; s/NUM/$NUM/;" >patch-preamble; -echo -n "Please verify the patch preamble..."; -read -$EDITOR patch-preamble; +if [ -z "$DEBUG" ]; then + cat $BASE/lyx-export/development/tools/patch-preamble | \ + sed -e "s/VERSION/$VERSION_BASE/; s/ORIGINAL/$ORIGINAL/; s/LAST/$LAST/; s/NUM/$NUM/;" >patch-preamble; + echo -n "Please verify the patch preamble..."; + read + $EDITOR patch-preamble; + PATCH="patch-$VERSION"; + cat patch-preamble $BASE/lyx-export/ANNOUNCE patch >$PATCH; + gzip -c $PATCH > $PATCH.gz + if [ -f $PATCH.gz.sig ]; then + rm $PATCH.gz.sig; + fi + gpg -b $PATCH.gz + xz -zc $PATCH > $PATCH.xz + if [ -f $PATCH.xz.sig ]; then + rm $PATCH.xz.sig; + fi + $DEBUG gpg -b $PATCH.xz -PATCH="patch-$VERSION"; -cat patch-preamble $BASE/lyx-export/ANNOUNCE patch >$PATCH; -gzip -c $PATCH > $PATCH.gz -if [ -f $PATCH.gz.sig ]; then - rm $PATCH.gz.sig; + echo -n "Patch and signatures created..."; + cp -v $PATCH.gz $PATCH.gz.sig $PATCH.xz $PATCH.xz.sig $BASE; fi -gpg -b $PATCH.gz -xz -zc $PATCH > $PATCH.xz -if [ -f $PATCH.xz.sig ]; then - rm $PATCH.xz.sig; -fi -gpg -b $PATCH.xz - -echo -n "Patch and signatures created..."; -cp -v $PATCH.gz $PATCH.gz.sig $PATCH.xz $PATCH.xz.sig $BASE; - -