From e6027ff49b04c67a5259ac227611a29b4a2e23bc Mon Sep 17 00:00:00 2001 From: entropy Date: Sun, 22 Jan 2012 00:55:08 +0000 Subject: [PATCH] Use LF carraige control in shell scripts to fix build under Linux --- scripts/buildtype.sh | 58 +++++++++++++++--------------- scripts/svnrev.sh | 84 ++++++++++++++++++++++---------------------- source/svnrev.h | 2 +- 3 files changed, 72 insertions(+), 72 deletions(-) diff --git a/scripts/buildtype.sh b/scripts/buildtype.sh index 998a0d13..88522266 100644 --- a/scripts/buildtype.sh +++ b/scripts/buildtype.sh @@ -1,30 +1,30 @@ -#!/bin/bash - -FILENAME=source/loader/alt_ios_gen.c -GENERATE=0 -VERSION=249 - -if [ ! -z "$1" ]; -then - VERSION=$1 -fi - -if [ ! -f $FILENAME ]; -then - GENERATE=1 -else - CURRENT_VERSION=`grep mainIOS\ = $FILENAME | awk '{printf "%d", $4}'` - if [ $CURRENT_VERSION -ne $VERSION ]; - then - GENERATE=1 - fi -fi - -if [ $GENERATE -eq 1 ]; -then - - cat < $FILENAME -#include "alt_ios.h" -int mainIOS = $VERSION; -EOF +#!/bin/bash + +FILENAME=source/loader/alt_ios_gen.c +GENERATE=0 +VERSION=249 + +if [ ! -z "$1" ]; +then + VERSION=$1 +fi + +if [ ! -f $FILENAME ]; +then + GENERATE=1 +else + CURRENT_VERSION=`grep mainIOS\ = $FILENAME | awk '{printf "%d", $4}'` + if [ $CURRENT_VERSION -ne $VERSION ]; + then + GENERATE=1 + fi +fi + +if [ $GENERATE -eq 1 ]; +then + + cat < $FILENAME +#include "alt_ios.h" +int mainIOS = $VERSION; +EOF fi \ No newline at end of file diff --git a/scripts/svnrev.sh b/scripts/svnrev.sh index 2a9f3940..28551a10 100644 --- a/scripts/svnrev.sh +++ b/scripts/svnrev.sh @@ -1,42 +1,42 @@ -#! /bin/bash -# -rev_new_raw=$(svnversion -n . 2>/dev/null | tr '\n' ' ' | tr -d '\r') -[ -n "$rev_new_raw" ] || rev_new_raw=$(SubWCRev . 2>/dev/null | tr '\n' ' ' | tr -d '\r') - -if [ "$rev_new_raw" == "exported" ]; -then - echo This copy of wiiflow is not under source control - exit -fi - - -rev_new_raw=$(echo $rev_new_raw | sed 's/[^0-9]*\([0-9]*\)\(.*\)/\1 \2/') -rev_new=0 -a=$(echo $rev_new_raw | sed 's/\([0-9]*\).*/\1/') -let "a+=0" -#find max rev -while [ "$a" ]; do - [ "$a" -gt "$rev_new" ] && rev_new=$a - rev_new_raw=$(echo -n $rev_new_raw | sed 's/[0-9]*[^0-9]*\([0-9]*\)\(.*\)/\1 \2/') - a=$(echo $rev_new_raw | sed 's/\([0-9]*\).*/\1/') -done - -rev_old=$(cat ./source/svnrev.h 2>/dev/null | tr -d '\n' | sed 's/[^0-9]*\([0-9]*\).*/\1/') - -if [ "$rev_new" != "$rev_old" ] || [ ! -f ./source/svnrev.h ]; then - - cat < ./source/svnrev.h -#define SVN_REV "$rev_new" -EOF - - if [ -n "$rev_old" ]; then - echo "Changed Rev $rev_old to $rev_new" >&2 - else - echo "svnrev.h created" >&2 - fi - - rev_new=`expr $rev_new + 1` - rev_date=`date +%Y%m%d%H%M -u` - - -fi +#! /bin/bash +# +rev_new_raw=$(svnversion -n . 2>/dev/null | tr '\n' ' ' | tr -d '\r') +[ -n "$rev_new_raw" ] || rev_new_raw=$(SubWCRev . 2>/dev/null | tr '\n' ' ' | tr -d '\r') + +if [ "$rev_new_raw" == "exported" ]; +then + echo This copy of wiiflow is not under source control + exit +fi + + +rev_new_raw=$(echo $rev_new_raw | sed 's/[^0-9]*\([0-9]*\)\(.*\)/\1 \2/') +rev_new=0 +a=$(echo $rev_new_raw | sed 's/\([0-9]*\).*/\1/') +let "a+=0" +#find max rev +while [ "$a" ]; do + [ "$a" -gt "$rev_new" ] && rev_new=$a + rev_new_raw=$(echo -n $rev_new_raw | sed 's/[0-9]*[^0-9]*\([0-9]*\)\(.*\)/\1 \2/') + a=$(echo $rev_new_raw | sed 's/\([0-9]*\).*/\1/') +done + +rev_old=$(cat ./source/svnrev.h 2>/dev/null | tr -d '\n' | sed 's/[^0-9]*\([0-9]*\).*/\1/') + +if [ "$rev_new" != "$rev_old" ] || [ ! -f ./source/svnrev.h ]; then + + cat < ./source/svnrev.h +#define SVN_REV "$rev_new" +EOF + + if [ -n "$rev_old" ]; then + echo "Changed Rev $rev_old to $rev_new" >&2 + else + echo "svnrev.h created" >&2 + fi + + rev_new=`expr $rev_new + 1` + rev_date=`date +%Y%m%d%H%M -u` + + +fi diff --git a/source/svnrev.h b/source/svnrev.h index a812cc05..874b795e 100644 --- a/source/svnrev.h +++ b/source/svnrev.h @@ -1 +1 @@ -#define SVN_REV "417" +#define SVN_REV "4"