From: lxoliva Date: Mon, 19 May 2008 00:03:26 +0000 (+0000) Subject: Factor out check_changed, fix status check, print explanation error, check for change... X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=c9f9eb2f3878d9aabce50fe2e4e6040fc97b6b02;p=releases.git Factor out check_changed, fix status check, print explanation error, check for changes in Makefiles too. git-svn-id: http://www.fsfla.org/svn/fsfla/software/linux-libre/scripts@3552 559672b5-ba27-0410-b829-e8f1faed8b1b --- diff --git a/deblob-2.6.23 b/deblob-2.6.23 index f1e237f639f..d7f3fe216c4 100755 --- a/deblob-2.6.23 +++ b/deblob-2.6.23 @@ -58,6 +58,14 @@ function clean_file { rm -v $1 } +function check_changed { + if cmp $1.deblob $1; then + echo $1 did not change, something is wrong >&2 + exit 1 + fi + mv $1.deblobbed $1 +} + check=`echo $0 | sed 's,/[^/]*$,,'`/deblob-check function clean_blob { #$1 = filename @@ -66,8 +74,7 @@ function clean_blob { set fnord "$@" -d shift 2 $check "$@" $name > $name.deblob - cmp $name.deblob $name || exit 1 - mv $name.deblob $name + check_changed $name else clean_file $1 fi @@ -75,9 +82,10 @@ function clean_blob { function clean_kconfig { #$1 = filename $2 = things to remove - sed -i "/^config $2\$/{p;i\ + sed "/^config $2\$/{p;i\ depends on NONFREE -d;}" $1 +d;}" $1 > $1.deblob + check_changed $1 } function clean_mk { @@ -89,8 +97,7 @@ function clean_mk { function clean_ifdef { #$1 = filename $2 = macro to -U unifdef $1 -U$2 > $1.deblob - cmp $name.deblob $name || exit 1 - mv $1.deblob $1 + check_changed $1 } ####################### diff --git a/deblob-2.6.24 b/deblob-2.6.24 index 5485aae1714..1b7dc4a66ac 100755 --- a/deblob-2.6.24 +++ b/deblob-2.6.24 @@ -58,6 +58,14 @@ function clean_file { rm -v $1 } +function check_changed { + if cmp $1.deblob $1; then + echo $1 did not change, something is wrong >&2 + exit 1 + fi + mv $1.deblobbed $1 +} + check=`echo $0 | sed 's,/[^/]*$,,'`/deblob-check function clean_blob { #$1 = filename @@ -66,8 +74,7 @@ function clean_blob { set fnord "$@" -d shift 2 $check "$@" $name > $name.deblob - cmp $name.deblob $name || exit 1 - mv $name.deblob $name + check_changed $name else clean_file $1 fi @@ -75,9 +82,10 @@ function clean_blob { function clean_kconfig { #$1 = filename $2 = things to remove - sed -i "/^config $2\$/{p;i\ + sed "/^config $2\$/{p;i\ depends on NONFREE -d;}" $1 +d;}" $1 > $1.deblob + check_changed $1 } function clean_mk { @@ -89,8 +97,7 @@ function clean_mk { function clean_ifdef { #$1 = filename $2 = macro to -U unifdef $1 -U$2 > $1.deblob - cmp $name.deblob $name || exit 1 - mv $1.deblob $1 + check_changed $1 } ####################### diff --git a/deblob-2.6.25 b/deblob-2.6.25 index 968bf5efcb1..45db325a23a 100755 --- a/deblob-2.6.25 +++ b/deblob-2.6.25 @@ -58,6 +58,14 @@ function clean_file { rm -v $1 } +function check_changed { + if cmp $1.deblob $1; then + echo $1 did not change, something is wrong >&2 + exit 1 + fi + mv $1.deblobbed $1 +} + check=`echo $0 | sed 's,/[^/]*$,,'`/deblob-check function clean_blob { #$1 = filename @@ -66,8 +74,7 @@ function clean_blob { set fnord "$@" -d shift 2 $check "$@" $name > $name.deblob - cmp $name.deblob $name || exit 1 - mv $name.deblob $name + check_changed $name else clean_file $1 fi @@ -75,9 +82,10 @@ function clean_blob { function clean_kconfig { #$1 = filename $2 = things to remove - sed -i "/^config $2\$/{p;i\ + sed "/^config $2\$/{p;i\ depends on NONFREE -d;}" $1 +d;}" $1 > $1.deblob + check_changed $1 } function clean_mk { @@ -89,8 +97,7 @@ function clean_mk { function clean_ifdef { #$1 = filename $2 = macro to -U unifdef $1 -U$2 > $1.deblob - cmp $name.deblob $name || exit 1 - mv $1.deblob $1 + check_changed $1 } #######################