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

* Also remove unused "Version" entry
This commit is contained in:
Pete Batard 2014-02-03 19:22:32 +00:00
parent 152201bf8f
commit d3a0fc9b1d
3 changed files with 14 additions and 20 deletions

View File

@ -25,22 +25,18 @@ case $MICRO in *[!0-9]*)
exit 1 exit 1
esac esac
echo "changing version to $MAJOR.$MINOR.$MICRO" echo "changing version to $MAJOR.$MINOR.$MICRO"
sed -e "s/^AC_INIT(\[\([^ ]*\)\], \[[^ ]*\]\(.*\)/AC_INIT([\1], [$MAJOR.$MINOR.$MICRO]\2/" configure.ac > configure.ac~ sed -i -e "s/^AC_INIT(\[\([^ ]*\)\], \[[^ ]*\]\(.*\)/AC_INIT([\1], [$MAJOR.$MINOR.$MICRO]\2/" configure.ac
mv configure.ac~ configure.ac
cat > cmd.sed <<\_EOF cat > cmd.sed <<\_EOF
s/^[ \t]*FILEVERSION[ \t]*.*,.*,.*,\(.*\)/ FILEVERSION @@MAJOR@@,@@MINOR@@,@@MICRO@@,\1/ s/^[ \t]*FILEVERSION[ \t]*.*,.*,.*,\(.*\)/ FILEVERSION @@MAJOR@@,@@MINOR@@,@@MICRO@@,\1/
s/^[ \t]*PRODUCTVERSION[ \t]*.*,.*,.*,\(.*\)/ PRODUCTVERSION @@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]*"FileVersion",[ \t]*".*\..*\..*\.\(.*\)"/\1VALUE "FileVersion", "@@MAJOR@@.@@MINOR@@.@@MICRO@@.\2"/
s/^\([ \t]*\)VALUE[ \t]*"ProductVersion",[ \t]*".*\..*\..*\.\(.*\)"/\1VALUE "ProductVersion", "@@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/^\(.*\)"Rufus \(.*\)\.\(.*\)"\(.*\)/\1"Rufus @@MAJOR@@.@@MINOR@@.@@MICRO@@.\3"\4/
s/^\(.*\)"Version \(.*\) (\(.*\)"\(.*\)/\1"Version @@MAJOR@@.@@MINOR@@.@@MICRO@@ (\3"\4/
_EOF _EOF
# First run sed to substitute our variable in the sed command file # 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~ sed -i -e "s/@@MAJOR@@/$MAJOR/g" -e "s/@@MINOR@@/$MINOR/g" -e "s/@@MICRO@@/$MICRO/g" cmd.sed
mv cmd.sed~ cmd.sed sed -i -f cmd.sed src/rufus.rc
sed -f cmd.sed src/rufus.rc > src/rufus.rc~ sed -i 's/$/\r/' src/rufus.rc
sed 's/$/\r/' src/rufus.rc~ > src/rufus.rc
rm src/rufus.rc~
rm cmd.sed rm cmd.sed
source bootstrap.sh source bootstrap.sh

View File

@ -34,15 +34,13 @@ s/^\(.*\)"Rufus \(.*\)\.\(.*\)"\(.*\)/\1"Rufus \2.@@TAGVER@@"\4/
_EOF _EOF
# First run sed to substitute our variable in the sed command file # First run sed to substitute our variable in the sed command file
sed -e "s/@@TAGVER@@/$TAGVER/g" cmd.sed > cmd.sed~ sed -i -e "s/@@TAGVER@@/$TAGVER/g" cmd.sed
mv cmd.sed~ cmd.sed
# Run sed to update the nano version # Run sed to update the nano version
# NB: we need to run git add else the modified files may be ignored sed -i -f cmd.sed src/rufus.rc
sed -f cmd.sed src/rufus.rc > src/rufus.rc~
# MinGW's sed has the bad habit of eating CRLFs - make sure we keep 'em # MinGW's sed has the bad habit of eating CRLFs - make sure we keep 'em
sed 's/$/\r/' src/rufus.rc~ > src/rufus.rc sed -i 's/$/\r/' src/rufus.rc
rm src/rufus.rc~ # NB: we need to run git add else the modified files may be ignored
git add src/rufus.rc git add src/rufus.rc
rm cmd.sed rm cmd.sed

View File

@ -32,7 +32,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 206, 329 IDD_DIALOG DIALOGEX 12, 12, 206, 329
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU 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 FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN BEGIN
DEFPUSHBUTTON "Start",IDC_START,94,291,50,14 DEFPUSHBUTTON "Start",IDC_START,94,291,50,14
@ -165,7 +165,7 @@ END
RTL_IDD_DIALOG DIALOGEX 12, 12, 206, 329 RTL_IDD_DIALOG DIALOGEX 12, 12, 206, 329
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU 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 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 FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN BEGIN
DEFPUSHBUTTON "Start",IDC_START,94,291,50,14 DEFPUSHBUTTON "Start",IDC_START,94,291,50,14
@ -427,8 +427,8 @@ END
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,4,4,401 FILEVERSION 1,4,4,402
PRODUCTVERSION 1,4,4,401 PRODUCTVERSION 1,4,4,402
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -445,13 +445,13 @@ BEGIN
BEGIN BEGIN
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
VALUE "FileDescription", "Rufus" VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "1.4.4.401" VALUE "FileVersion", "1.4.4.402"
VALUE "InternalName", "Rufus" VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2014 Pete Batard (GPL v3)" VALUE "LegalCopyright", "© 2011-2014 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe" VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus" VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "1.4.4.401" VALUE "ProductVersion", "1.4.4.402"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"