Permalink
Browse files

[misc] use "in-place" option when running sed

* Also remove unused "Version" entry
  • Loading branch information...
pbatard committed Feb 3, 2014
1 parent 152201b commit d3a0fc9b1dd8b7fb488910085cf1c2464c22514f
Showing with 14 additions and 20 deletions.
  1. +4 −8 _chver.sh
  2. +4 −6 _pre-commit.sh
  3. +6 −6 src/rufus.rc
View
@@ -25,22 +25,18 @@ case $MICRO in *[!0-9]*)
exit 1
esac
echo "changing version to $MAJOR.$MINOR.$MICRO"
-sed -e "s/^AC_INIT(\[\([^ ]*\)\], \[[^ ]*\]\(.*\)/AC_INIT([\1], [$MAJOR.$MINOR.$MICRO]\2/" configure.ac > configure.ac~
-mv configure.ac~ configure.ac
+sed -i -e "s/^AC_INIT(\[\([^ ]*\)\], \[[^ ]*\]\(.*\)/AC_INIT([\1], [$MAJOR.$MINOR.$MICRO]\2/" configure.ac
cat > cmd.sed <<\_EOF
s/^[ \t]*FILEVERSION[ \t]*.*,.*,.*,\(.*\)/ FILEVERSION @@MAJOR@@,@@MINOR@@,@@MICRO@@,\1/
s/^[ \t]*PRODUCTVERSION[ \t]*.*,.*,.*,\(.*\)/ PRODUCTVERSION @@MAJOR@@,@@MINOR@@,@@MICRO@@,\1/
s/^\([ \t]*\)VALUE[ \t]*"FileVersion",[ \t]*".*\..*\..*\.\(.*\)"/\1VALUE "FileVersion", "@@MAJOR@@.@@MINOR@@.@@MICRO@@.\2"/
s/^\([ \t]*\)VALUE[ \t]*"ProductVersion",[ \t]*".*\..*\..*\.\(.*\)"/\1VALUE "ProductVersion", "@@MAJOR@@.@@MINOR@@.@@MICRO@@.\2"/
s/^\(.*\)"Rufus \(.*\)\.\(.*\)"\(.*\)/\1"Rufus @@MAJOR@@.@@MINOR@@.@@MICRO@@.\3"\4/
-s/^\(.*\)"Version \(.*\) (\(.*\)"\(.*\)/\1"Version @@MAJOR@@.@@MINOR@@.@@MICRO@@ (\3"\4/
_EOF
# First run sed to substitute our variable in the sed command file
-sed -e "s/@@MAJOR@@/$MAJOR/g" -e "s/@@MINOR@@/$MINOR/g" -e "s/@@MICRO@@/$MICRO/g" cmd.sed > cmd.sed~
-mv cmd.sed~ cmd.sed
-sed -f cmd.sed src/rufus.rc > src/rufus.rc~
-sed 's/$/\r/' src/rufus.rc~ > src/rufus.rc
-rm src/rufus.rc~
+sed -i -e "s/@@MAJOR@@/$MAJOR/g" -e "s/@@MINOR@@/$MINOR/g" -e "s/@@MICRO@@/$MICRO/g" cmd.sed
+sed -i -f cmd.sed src/rufus.rc
+sed -i 's/$/\r/' src/rufus.rc
rm cmd.sed
source bootstrap.sh
View
@@ -34,15 +34,13 @@ s/^\(.*\)"Rufus \(.*\)\.\(.*\)"\(.*\)/\1"Rufus \2.@@TAGVER@@"\4/
_EOF
# First run sed to substitute our variable in the sed command file
-sed -e "s/@@TAGVER@@/$TAGVER/g" cmd.sed > cmd.sed~
-mv cmd.sed~ cmd.sed
+sed -i -e "s/@@TAGVER@@/$TAGVER/g" cmd.sed
# Run sed to update the nano version
-# NB: we need to run git add else the modified files may be ignored
-sed -f cmd.sed src/rufus.rc > src/rufus.rc~
+sed -i -f cmd.sed src/rufus.rc
# MinGW's sed has the bad habit of eating CRLFs - make sure we keep 'em
-sed 's/$/\r/' src/rufus.rc~ > src/rufus.rc
-rm src/rufus.rc~
+sed -i 's/$/\r/' src/rufus.rc
+# NB: we need to run git add else the modified files may be ignored
git add src/rufus.rc
rm cmd.sed
View
@@ -32,7 +32,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 206, 329
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Rufus 1.4.4.401"
+CAPTION "Rufus 1.4.4.402"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "Start",IDC_START,94,291,50,14
@@ -165,7 +165,7 @@ END
RTL_IDD_DIALOG DIALOGEX 12, 12, 206, 329
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_RTLREADING | WS_EX_APPWINDOW | WS_EX_LAYOUTRTL
-CAPTION "Rufus 1.4.4.401"
+CAPTION "Rufus 1.4.4.402"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "Start",IDC_START,94,291,50,14
@@ -427,8 +427,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,4,4,401
- PRODUCTVERSION 1,4,4,401
+ FILEVERSION 1,4,4,402
+ PRODUCTVERSION 1,4,4,402
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -445,13 +445,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
VALUE "FileDescription", "Rufus"
- VALUE "FileVersion", "1.4.4.401"
+ VALUE "FileVersion", "1.4.4.402"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "� 2011-2014 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus"
- VALUE "ProductVersion", "1.4.4.401"
+ VALUE "ProductVersion", "1.4.4.402"
END
END
BLOCK "VarFileInfo"

0 comments on commit d3a0fc9

Please sign in to comment.