mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-22 17:46:37 +03:00
Further update for #1765
This commit is contained in:
parent
5b88e3e1ad
commit
d76ee8f534
20
extra/shutils/postcommit-hook
Normal file
20
extra/shutils/postcommit-hook
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
SETTINGS="../../lib/core/settings.py"
|
||||||
|
|
||||||
|
declare -x SCRIPTPATH="${0}"
|
||||||
|
|
||||||
|
FULLPATH=${SCRIPTPATH%/*}/$SETTINGS
|
||||||
|
|
||||||
|
if [ -f $FULLPATH ]
|
||||||
|
then
|
||||||
|
LINE=$(grep -o ${FULLPATH} -e 'VERSION = "[0-9.]*"');
|
||||||
|
declare -a LINE;
|
||||||
|
NEW_TAG=$(python -c "import re, sys, time; version = re.search('\"([0-9.]*)\"', sys.argv[1]).group(1); _ = version.split('.'); print '.'.join(_[:-1]) if len(_) == 4 and _[-1] == '0' else ''" "$LINE")
|
||||||
|
if [ -n "$NEW_TAG" ]
|
||||||
|
then
|
||||||
|
echo "Creating new tag ${NEW_TAG}";
|
||||||
|
git tag $NEW_TAG;
|
||||||
|
#git push origin $NEW_TAG
|
||||||
|
fi
|
||||||
|
fi;
|
|
@ -10,7 +10,7 @@ if [ -f $FULLPATH ]
|
||||||
then
|
then
|
||||||
LINE=$(grep -o ${FULLPATH} -e 'VERSION = "[0-9.]*"');
|
LINE=$(grep -o ${FULLPATH} -e 'VERSION = "[0-9.]*"');
|
||||||
declare -a LINE;
|
declare -a LINE;
|
||||||
INCREMENTED=$(python -c "import re, sys, time; version = re.search('\"([0-9.]*)\"', sys.argv[1]).group(1); _ = version.split('.'); _.append(0) if len(_) < 3 else _; _[-1] = str(int(_[-1]) + 1); month = str(time.gmtime().tm_mon); _[-1] = '1' if _[-2] != month else _[-1]; _[-2] = month; print sys.argv[1].replace(version, '.'.join(_))" "$LINE")
|
INCREMENTED=$(python -c "import re, sys, time; version = re.search('\"([0-9.]*)\"', sys.argv[1]).group(1); _ = version.split('.'); _.append(0) if len(_) < 3 else _; _[-1] = str(int(_[-1]) + 1); month = str(time.gmtime().tm_mon); _[-1] = '0' if _[-2] != month else _[-1]; _[-2] = month; print sys.argv[1].replace(version, '.'.join(_))" "$LINE")
|
||||||
if [ -n "$INCREMENTED" ]
|
if [ -n "$INCREMENTED" ]
|
||||||
then
|
then
|
||||||
sed "s/${LINE}/${INCREMENTED}/" $FULLPATH > $FULLPATH.tmp && mv $FULLPATH.tmp $FULLPATH
|
sed "s/${LINE}/${INCREMENTED}/" $FULLPATH > $FULLPATH.tmp && mv $FULLPATH.tmp $FULLPATH
|
||||||
|
|
|
@ -20,7 +20,7 @@ from lib.core.enums import OS
|
||||||
from lib.core.revision import getRevisionNumber
|
from lib.core.revision import getRevisionNumber
|
||||||
|
|
||||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||||
VERSION = "1.0.3.2"
|
VERSION = "1.0.3.3"
|
||||||
REVISION = getRevisionNumber()
|
REVISION = getRevisionNumber()
|
||||||
STABLE = VERSION.count('.') <= 2
|
STABLE = VERSION.count('.') <= 2
|
||||||
VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev")
|
VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user