1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00

[internal] add auto detection of 'git commit --amend'

* Finally!
* Also improve UPX compression
This commit is contained in:
Pete Batard 2018-05-12 11:37:07 +01:00
parent 9815a18009
commit 63555cd04d
7 changed files with 33 additions and 11 deletions

View file

@ -1,2 +0,0 @@
echo off
echo .>.amend

View file

@ -9,7 +9,7 @@ release: all
@mv src/$(TARGET)$(EXEEXT) .
@sleep 1
@$(STRIP) $(TARGET)$(EXEEXT)
@upx --lzma $(TARGET)$(EXEEXT)
@upx --lzma --best $(TARGET)$(EXEEXT)
@mv $(TARGET)$(EXEEXT) $(TARGET)-$(VERSION)$(SUFFIX)$(EXEEXT)
@cmd.exe //c _sign.cmd $(TARGET)-$(VERSION)$(SUFFIX)$(EXEEXT)

View file

@ -506,7 +506,7 @@ release: all
@mv src/$(TARGET)$(EXEEXT) .
@sleep 1
@$(STRIP) $(TARGET)$(EXEEXT)
@upx --lzma $(TARGET)$(EXEEXT)
@upx --lzma --best $(TARGET)$(EXEEXT)
@mv $(TARGET)$(EXEEXT) $(TARGET)-$(VERSION)$(SUFFIX)$(EXEEXT)
@cmd.exe //c _sign.cmd $(TARGET)-$(VERSION)$(SUFFIX)$(EXEEXT)

20
_detect-amend.sh Normal file
View file

@ -0,0 +1,20 @@
#!/bin/sh
#
# This script detects whether git commit is being executed in amend or regular mode
# Needed to determine whether the build number should be incremented or not.
#
# Need to figure out if we are running on Windows or *NIX
if [ "$(uname -o)" = "Msys" ]; then
type -P wmic &>/dev/null || { echo "wmic command not found. Aborting." >&2; exit 1; }
type -P grep &>/dev/null || { echo "grep command not found. Aborting." >&2; exit 1; }
if $(wmic path win32_process get CommandLine | grep git.exe | grep -q -- --amend); then
echo AMEND detected
touch ./.amend
fi
else
if $(ps -fp $PPID | grep -q -- --amend); then
echo AMEND detected
touch ./.amend
fi
fi

View file

@ -6,7 +6,7 @@
# .git/hooks/ with the following content:
# #!/bin/sh
# if [ -x ./_post-commit.sh ]; then
# source ./_post-commit.sh
# . ./_post-commit.sh
# fi
type -P git &>/dev/null || { echo "git command not found. Aborting." >&2; exit 1; }

View file

@ -6,12 +6,16 @@
# .git/hooks/ with the following content:
# #!/bin/sh
# if [ -x ./_pre-commit.sh ]; then
# source ./_pre-commit.sh
# . ./_pre-commit.sh
# fi
type -P sed &>/dev/null || { echo "sed command not found. Aborting." >&2; exit 1; }
type -P git &>/dev/null || { echo "git command not found. Aborting." >&2; exit 1; }
if [ -x ./_detect-amend.sh ]; then
. ./_detect-amend.sh
fi
TAGVER=`git rev-list HEAD --count`
# adjust so that we match the github commit count
((TAGVER++))

View file

@ -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.0.1276"
CAPTION "Rufus 3.0.1277"
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
BEGIN
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
@ -389,8 +389,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,0,1276,0
PRODUCTVERSION 3,0,1276,0
FILEVERSION 3,0,1277,0
PRODUCTVERSION 3,0,1277,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -407,13 +407,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "3.0.1276"
VALUE "FileVersion", "3.0.1277"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2018 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "3.0.1276"
VALUE "ProductVersion", "3.0.1277"
END
END
BLOCK "VarFileInfo"