[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[FYI] {ylwrap-refactor} ylwrap: another cleanup refactoring (no semantic
From: |
Stefano Lattarini |
Subject: |
[FYI] {ylwrap-refactor} ylwrap: another cleanup refactoring (no semantic change) |
Date: |
Thu, 5 May 2011 19:32:29 +0200 |
User-agent: |
KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) |
* lib/ylwrap: Restructure main code to remove an if/else
construct.
---
ChangeLog | 6 ++++++
lib/ylwrap | 30 +++++++++++++-----------------
2 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 264c5fe..78d7ffa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2011-05-05 Stefano Lattarini <address@hidden>
+ ylwrap: another cleanup refactoring (no semantic change)
+ * lib/ylwrap: Restructure main code to remove an if/else
+ construct.
+
+2011-05-05 Stefano Lattarini <address@hidden>
+
ylwrap: cleanup refactoring (no semantic change)
* lib/ylwrap (handle_renaming): Restructure to remove a longish
if/else construct.
diff --git a/lib/ylwrap b/lib/ylwrap
index dfff700..fbbca84 100755
--- a/lib/ylwrap
+++ b/lib/ylwrap
@@ -271,27 +271,23 @@ case $# in
esac
ret=$?
-if test $ret -eq 0; then
+test $ret -eq 0 || eval "$do_exit"
- set X $pairlist
- shift
-
- # The directory holding the input.
- input_dir=`dirname_ "$input"`
- # Quote $input_dir so we can use it in a regexp.
- input_rx=`quote_for_sed "$input_dir"`
+set X $pairlist
+shift
- while test $# -ne 0; do
- handle_renaming "$1" "$2"
- shift
- shift
- done
-fi
+# The directory holding the input.
+input_dir=`dirname_ "$input"`
+# Quote $input_dir so we can use it in a regexp.
+input_rx=`quote_for_sed "$input_dir"`
-# Remove the temporary directory.
-cd "$ocwd" && rm -rf $dirname
+while test $# -ne 0; do
+ handle_renaming "$1" "$2"
+ shift
+ shift
+done
-exit $ret
+eval "$do_exit"
# Local Variables:
# mode: shell-script
--
1.7.2.3
- [FYI] {ylwrap-refactor} Refactoring (eventual rewriting) of the `ylwrap' script., Stefano Lattarini, 2011/05/05
- [FYI] {ylwrap-refactor} ylwrap: various refactorings, few improvements, Stefano Lattarini, 2011/05/05
- [FYI] {ylwrap-refactor} ylwrap: fixlets in option parsing, Stefano Lattarini, 2011/05/05
- [FYI] {ylwrap-refactor} ylwrap: make less general and more "expert", Stefano Lattarini, 2011/05/05
- [FYI] {ylwrap-refactor} ylwrap: new subroutine `tr_cpp', Stefano Lattarini, 2011/05/05
- [FYI] {ylwrap-refactor} ylwrap: new subroutine `handle_renaming', Stefano Lattarini, 2011/05/05
- [FYI] {ylwrap-refactor} ylwrap: warn when expected output files are missing, Stefano Lattarini, 2011/05/05
- [FYI] {ylwrap-refactor} ylwrap: cleanup refactoring (no semantic change), Stefano Lattarini, 2011/05/05
- [FYI] {ylwrap-refactor} ylwrap: another cleanup refactoring (no semantic change),
Stefano Lattarini <=
- [FYI] {ylwrap-refactor} ylwrap: get rid of the loop on "FROM TARGET" couples, Stefano Lattarini, 2011/05/05
- FYI] {ylwrap-refactor} ylwrap: go into tempdir only when running wrapped program, Stefano Lattarini, 2011/05/05
- [FYI] {ylwrap-refactor} ylwrap: pull `dos_fix_yacc_filenames' out of `handle_renaming', Stefano Lattarini, 2011/05/05
- [FYI] {ylwrap-refactor} ylwrap: move "update if changed" logic out of `handle_renaming', Stefano Lattarini, 2011/05/05
- [FYI] {ylwrap-refactor} ylwrap: some renaming of variables and subroutines, Stefano Lattarini, 2011/05/06
- [FYI] {ylwrap-refactor} ylwrap: fix indentation, Stefano Lattarini, 2011/05/06
- [FYI] {ylwrap-refactor} ylwrap: rename 'handle_renaming' to 'tempfile_deploy', Stefano Lattarini, 2011/05/06
- [FYI] {ylwrap-refactor} merged branch 'yacc-work', Stefano Lattarini, 2011/05/06