Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn2010-06-16 23:30:10 +0000
committerMatthias Sohn2010-06-16 23:30:10 +0000
commite64a8ac70e6f7f754b8fa772cb0388aaf858d434 (patch)
tree208f8db65f0dd554f7664345dccd87850380512d /tools/version.sh
parent7dd3fcd6eaef38a56a227c73474ed4ff0e4206ae (diff)
downloadegit-e64a8ac70e6f7f754b8fa772cb0388aaf858d434.tar.gz
egit-e64a8ac70e6f7f754b8fa772cb0388aaf858d434.tar.xz
egit-e64a8ac70e6f7f754b8fa772cb0388aaf858d434.zip
tools/version.sh: Use backup files on Win32
Copied from corresponding change in jgit repository. Windows doesn't permit us to edit a file in-place with Perl. So create backup files when we perform the edit, and remove them when we are done. This is a tad slower on POSIX systems, but is much more portable. Change-Id: Ib267092d47b115972139c8ae367acee572d62ccf Also-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'tools/version.sh')
-rwxr-xr-xtools/version.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/version.sh b/tools/version.sh
index 4c92033d88..e97a2b7472 100755
--- a/tools/version.sh
+++ b/tools/version.sh
@@ -101,14 +101,14 @@ EGIT_N=$(next_version "$EGIT_V")
JGIT_V=$(to_version "$J")
JGIT_N=$(next_version "$JGIT_V")
-perl -pi -e '
+perl -pi~ -e '
s/^(Bundle-Version:\s*).*$/${1}'"$OSGI_V"'/;
s/(org.eclipse.egit.*;version=")[^"[(]*(")/${1}'"$EGIT_V"'${2}/;
s/(org.eclipse.egit.*;version="\[)[^"]*(\)")/${1}'"$EGIT_V,$EGIT_N"'${2}/;
s/(org.eclipse.jgit.*;version="\[)[^"]*(\)")/${1}'"$JGIT_V,$JGIT_N"'${2}/;
' $(git ls-files | grep META-INF/MANIFEST.MF)
-perl -pi -e '
+perl -pi~ -e '
if ($ARGV ne $old_argv) {
$seen_version = 0;
$old_argv = $ARGV;
@@ -120,11 +120,11 @@ perl -pi -e '
s/(feature="org.eclipse.jgit" version=")[^"]*(")/${1}'"$JGIT_V"'${2}/;
' org.eclipse.egit-feature/feature.xml
-perl -pi -e '
+perl -pi~ -e '
s{<(version)>[^<\$]*</\1>}{<${1}>'"$POM_V"'</${1}>};
' org.eclipse.egit-feature/pom.xml
-perl -pi -e '
+perl -pi~ -e '
if ($ARGV ne $old_argv) {
$seen_version = 0;
$old_argv = $ARGV;
@@ -135,7 +135,7 @@ perl -pi -e '
}
' org.eclipse.egit-updatesite/pom.xml
-perl -pi -e '
+perl -pi~ -e '
if ($ARGV ne $old_argv) {
$seen_version = 0;
$old_argv = $ARGV;
@@ -147,4 +147,5 @@ perl -pi -e '
s{<(jgit-version)>[^<]*</\1>}{<${1}>'"$J"'</${1}>};
' $(git ls-files | grep pom.xml)
+find . -name '*~' | xargs rm -f
git diff

Back to the top