From 35010006a1f4c10459dd3b9bdfcb60d0ddcea8e2 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 2 Aug 2016 11:50:42 +0200 Subject: [PATCH] Some cosmetic changes --- extra/shutils/precommit-hook | 7 ++++--- lib/core/settings.py | 9 +++++---- lib/parse/cmdline.py | 2 +- txt/checksum.md5 | 4 ++-- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/extra/shutils/precommit-hook b/extra/shutils/precommit-hook index 9cbe771b0..faa2fb105 100644 --- a/extra/shutils/precommit-hook +++ b/extra/shutils/precommit-hook @@ -10,9 +10,6 @@ PROJECT_FULLPATH=${SCRIPTPATH%/*}/$PROJECT SETTINGS_FULLPATH=${SCRIPTPATH%/*}/$SETTINGS CHECKSUM_FULLPATH=${SCRIPTPATH%/*}/$CHECKSUM -truncate -s 0 "$CHECKSUM_FULLPATH" -cd $PROJECT_FULLPATH && for i in $(find . -name "*.py" -o -name "*.xml" -o -iname "*_" | sort); do git ls-files $i --error-unmatch &>/dev/null && md5sum $i | sed 's/\.\///' >> "$CHECKSUM_FULLPATH"; git add "$CHECKSUM_FULLPATH"; done - if [ -f $SETTINGS_FULLPATH ] then LINE=$(grep -o ${SETTINGS_FULLPATH} -e 'VERSION = "[0-9.]*"'); @@ -26,4 +23,8 @@ then echo "Something went wrong in VERSION increment" exit 1 fi + git add "$SETTINGS_FULLPATH" fi; + +truncate -s 0 "$CHECKSUM_FULLPATH" +cd $PROJECT_FULLPATH && for i in $(find . -name "*.py" -o -name "*.xml" -o -iname "*_" | sort); do git ls-files $i --error-unmatch &>/dev/null && md5sum $i | sed 's/\.\///' >> "$CHECKSUM_FULLPATH"; git add "$CHECKSUM_FULLPATH"; done diff --git a/lib/core/settings.py b/lib/core/settings.py index adaae913c..9d82d00e9 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -19,10 +19,11 @@ from lib.core.enums import OS from lib.core.revision import getRevisionNumber # sqlmap version (...) -VERSION = "1.0.8.1" +VERSION = "1.0.8.8" REVISION = getRevisionNumber() -STABLE = VERSION.count('.') <= 2 -VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev") +TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" +TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} +VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[::-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) DESCRIPTION = "automatic SQL injection and database takeover tool" SITE = "http://sqlmap.org" ISSUES_PAGE = "https://github.com/sqlmapproject/sqlmap/issues/new" @@ -35,7 +36,7 @@ BANNER = """\033[01;33m _ |_ -| . | | | .'| . | |___|_ |_|_|_|_|__,| _| |_| |_| \033[0m\033[4;37m%s\033[0m\n -""" % ((31 + hash(VERSION) % 6) if not STABLE else 30, VERSION_STRING.split('/')[-1], SITE) +""" % (TYPE_COLORS.get(TYPE, 31), VERSION_STRING.split('/')[-1], SITE) # Minimum distance of ratio from kb.matchRatio to result in True DIFF_TOLERANCE = 0.05 diff --git a/lib/parse/cmdline.py b/lib/parse/cmdline.py index ab95f973e..69ffaeec2 100644 --- a/lib/parse/cmdline.py +++ b/lib/parse/cmdline.py @@ -938,7 +938,7 @@ def cmdLineParser(argv=None): args.requestFile, args.updateAll, args.smokeTest, args.liveTest, args.wizard, args.dependencies, \ args.purgeOutput, args.pickledOptions, args.sitemapUrl)): errMsg = "missing a mandatory option (-d, -u, -l, -m, -r, -g, -c, -x, --wizard, --update, --purge-output or --dependencies), " - errMsg += "use -h for basic or -hh for advanced help" + errMsg += "use -h for basic or -hh for advanced help\n" parser.error(errMsg) return args diff --git a/txt/checksum.md5 b/txt/checksum.md5 index 0b9b4da14..ad4d2bfd8 100644 --- a/txt/checksum.md5 +++ b/txt/checksum.md5 @@ -45,7 +45,7 @@ e60456db5380840a586654344003d4e6 lib/core/readlineng.py 5ef56abb8671c2ca6ceecb208258e360 lib/core/replication.py 99a2b496b9d5b546b335653ca801153f lib/core/revision.py 7c15dd2777af4dac2c89cab6df17462e lib/core/session.py -7818f4d503649d92e5239be5f6790501 lib/core/settings.py +e9ab1f38b3653ca51519b62929b52492 lib/core/settings.py 7af83e4f18cab6dff5e67840eb65be80 lib/core/shell.py 23657cd7d924e3c6d225719865855827 lib/core/subprocessng.py 0bc2fae1dec18cdd11954b22358293f2 lib/core/target.py @@ -57,7 +57,7 @@ e60456db5380840a586654344003d4e6 lib/core/readlineng.py 354ecc0c6d3e0ac9c06ed897c4d52edf lib/core/xmldump.py cc9c82cfffd8ee9b25ba3af6284f057e lib/__init__.py c1288bc4ce5651dbdd82d4a9435fdc03 lib/parse/banner.py -bf7fbfb04d6150d19ecfd9b25ee5618a lib/parse/cmdline.py +daea32290b63c43f7d1c0e14c66d4826 lib/parse/cmdline.py 8ec4d4f02634834701f8258726f2e511 lib/parse/configfile.py fe4e2152292587928edb94c9a4d311ff lib/parse/handler.py 8e6bfb13e5a34b2610f3ff23467a34cf lib/parse/headers.py