bug-gnu-libiconv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gnu-libiconv] Re: adding version identification to libiconv and lib


From: amores perros
Subject: [bug-gnu-libiconv] Re: adding version identification to libiconv and libintl
Date: Mon, 21 May 2007 14:22:24 +0000



Before you send me the pieces, maybe one modification is possible: I would
guess that the makewinrc.sh does not require special tools, only normal
text processing tools (cat, sed, etc.)? If this is true, there is an

I misspoke earlier, when I said it didn't use external tools -- it does use sed.
I'd forgotten that, and just noticed again.

== BEGIN EXCERPT ==

# Function to apply version to one file
# Argument#1 is filename (eg, "NEWS")
# Arguments#2-? sed patterns, applied one after another
function alterfile {
 [ ! -z "$1" ] || failexit "Missing first argument to alterfile"
 [ ! -z "$2" ] || failexit "Missing second argument to alterfile"
 FILEPATH=$1
 shift
 cp $FILEPATH $FILEPATH.bak || failexit "Error backing up file "$FILEPATH
 # Now apply each remaining argument as sed command
 until [ -z "$1" ]
 do
   # sed doesn't seem to set its return value, so we don't check
   # that it found its match, unfortunately
   sed $FILEPATH -e "$1" > $FILEPATH.tmp
mv $FILEPATH.tmp $FILEPATH || failexit "mv failed in alterfile: $FILEPATH.tm
p"
   shift
 done
}

== END EXCERPT ==

(BTW, that is my comment about not being able to tell if or how many
matches sed found -- I'd prefer to be able to verify that it matched
exactly once, as I expect it to.)

_________________________________________________________________
Catch suspicious messages before you open them¬ówith Windows Live Hotmail. http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_protection_0507





reply via email to

[Prev in Thread] Current Thread [Next in Thread]