Skip to content

Commit

Permalink
[internal] update hooks to remove automated tagging
Browse files Browse the repository at this point in the history
* Also update AppVeyor builds wrt the above
  • Loading branch information
pbatard committed Oct 19, 2018
1 parent bc6e23e commit 6d7a938
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 54 deletions.
19 changes: 0 additions & 19 deletions _post-commit.sh

This file was deleted.

20 changes: 9 additions & 11 deletions _pre-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,26 @@ if [ -x ./_detect-amend.sh ]; then
. ./_detect-amend.sh
fi

TAGVER=`git rev-list HEAD --count`
BUILD=`git rev-list HEAD --count`
# adjust so that we match the github commit count
((TAGVER++))
((BUILD++))
# there may be a better way to prevent improper micro on amend. For now the detection
# of a .amend file in the current directory will do
if [ -f ./.amend ]; then
((TAGVER--))
git tag -d "b$TAGVER"
((BUILD--))
rm ./.amend;
fi
echo "setting micro to $TAGVER"
echo $TAGVER > .tag
echo "setting micro to $BUILD"

cat > cmd.sed <<\_EOF
s/^\([ \t]*\)*\(FILE\|PRODUCT\)VERSION\([ \t]*\)\([0-9]*\),\([0-9]*\),[0-9]*,\(.*\)/\1\2VERSION\3\4,\5,@@TAGVER@@,\6/
s/^\([ \t]*\)VALUE\([ \t]*\)"\(File\|Product\)Version",\([ \t]*\)"\(.*\)\..*"[ \t]*/\1VALUE\2"\3Version",\4"\5.@@TAGVER@@"/
s/^\(.*\)"Rufus \(.*\)\..*"\(.*\)/\1"Rufus \2.@@TAGVER@@"\3/
s/^\([ \t]*\)Version="\([0-9]*\)\.\([0-9]*\)\.[0-9]*\.\([0-9]*\)"\(.*\)/\1Version="\2.\3.@@TAGVER@@.\4"\5/
s/^\([ \t]*\)*\(FILE\|PRODUCT\)VERSION\([ \t]*\)\([0-9]*\),\([0-9]*\),[0-9]*,\(.*\)/\1\2VERSION\3\4,\5,@@BUILD@@,\6/
s/^\([ \t]*\)VALUE\([ \t]*\)"\(File\|Product\)Version",\([ \t]*\)"\(.*\)\..*"[ \t]*/\1VALUE\2"\3Version",\4"\5.@@BUILD@@"/
s/^\(.*\)"Rufus \(.*\)\..*"\(.*\)/\1"Rufus \2.@@BUILD@@"\3/
s/^\([ \t]*\)Version="\([0-9]*\)\.\([0-9]*\)\.[0-9]*\.\([0-9]*\)"\(.*\)/\1Version="\2.\3.@@BUILD@@.\4"\5/
_EOF

# First run sed to substitute our variable in the sed command file
sed -i -e "s/@@TAGVER@@/$TAGVER/g" cmd.sed
sed -i -e "s/@@BUILD@@/$BUILD/g" cmd.sed
# Run sed to update the nano version
sed -b -i -f cmd.sed src/rufus.rc
# NB: we need to run git add else the modified files may be ignored
Expand Down
10 changes: 2 additions & 8 deletions _set_git_hooks.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
# Sets the git hooks on a new git development system
if [ -e ".git/hooks/pre-commit" ] || [ -e ".git/hooks/post-commit" ] ; then
echo 'pre-commit or post-commit git hook is already set, aborting.'
if [ -e ".git/hooks/pre-commit" ]; then
echo 'pre-commit git hook is already set, aborting.'
exit
fi

Expand All @@ -10,9 +10,3 @@ echo '#!/bin/sh' > .git/hooks/pre-commit
echo 'if [ -x ./_pre-commit.sh ]; then' >> .git/hooks/pre-commit
echo ' . ./_pre-commit.sh' >> .git/hooks/pre-commit
echo 'fi' >> .git/hooks/pre-commit

echo 'Creating post-commit git hook...'
echo '#!/bin/sh' > .git/hooks/post-commit
echo 'if [ -x ./_post-commit.sh ]; then' >> .git/hooks/post-commit
echo ' . ./_post-commit.sh' >> .git/hooks/post-commit
echo 'fi' >> .git/hooks/post-commit
11 changes: 0 additions & 11 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
os: Visual Studio 2017

# May choose to enable the following if we get tired of seeing double AppVeyor builds for tagged and untagged
# skip_non_tags: true

skip_commits:
# Don't run AppVeyor for commits that only modify resource or non-code files
files:
Expand Down Expand Up @@ -55,10 +52,6 @@ init:
Update-AppveyorBuild -Version "$($env:APPVEYOR_REPO_TAG_NAME)_#$env:APPVEYOR_BUILD_NUMBER";
} else {
Update-AppveyorBuild -Version "dev-$($env:APPVEYOR_REPO_COMMIT.Substring(0,8))_#$env:APPVEYOR_BUILD_NUMBER";
if ("$env:APPVEYOR_REPO_NAME" -eq "pbatard/rufus" -and "$env:APPVEYOR_REPO_BRANCH" -eq "master") {
Write-Output "Not running dev-build since we expect a tagged commit.";
Exit-AppVeyorBuild;
}
}
build:
Expand Down Expand Up @@ -88,10 +81,6 @@ build_script:
Write-Output "Not running Coverity due to missing credential.";
return;
}
if ($env:APPVEYOR_REPO_TAG -eq "false") {
Write-Output "Not running Coverity due to missing tag.";
return;
}
& nuget install PublishCoverity -o "$env:APPVEYOR_BUILD_FOLDER" -excludeversion;
& cov-build.exe --dir cov-int msbuild rufus.sln /m /p:Configuration=$env:CONFIGURATION,Platform=$env:PLATFORM /l:$APPVEYOR_LOGGER;
& $PUBLISHCOVERITY compress --nologo -i "$env:APPVEYOR_BUILD_FOLDER\cov-int" -o "$env:APPVEYOR_BUILD_FOLDER\coverity.zip" --overwrite;
Expand Down
10 changes: 5 additions & 5 deletions src/rufus.rc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 232, 326
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_ACCEPTFILES
CAPTION "Rufus 3.4.1408"
CAPTION "Rufus 3.4.1409"
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
BEGIN
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
Expand Down Expand Up @@ -392,8 +392,8 @@ END
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,4,1408,0
PRODUCTVERSION 3,4,1408,0
FILEVERSION 3,4,1409,0
PRODUCTVERSION 3,4,1409,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -411,13 +411,13 @@ BEGIN
VALUE "Comments", "https://akeo.ie"
VALUE "CompanyName", "Akeo Consulting"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "3.4.1408"
VALUE "FileVersion", "3.4.1409"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "� 2011-2018 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "https://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus-3.4.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "3.4.1408"
VALUE "ProductVersion", "3.4.1409"
END
END
BLOCK "VarFileInfo"
Expand Down

0 comments on commit 6d7a938

Please sign in to comment.