+def SelfCheckIsLatestVersion(base_path):
+ """Checks that this script is the latest available by comparing itself to
+ the reference script in |base_path|. It is important to do that check as
+ most deployment will want to execute this script with root privileges,
+ which implies that this script is deployed in a safe directory, and not
+ just executed from an automatically updated checkout of plat/al (how
+ unsafe would that be...)."""
+
+ base_script = os.path.join(base_path, 'bin/check_security_fixes.py')
+ local_script = os.path.abspath(sys.argv[0])
+
+ if os.system('diff -q %s %s' % (base_script, local_script)) != 0:
+ sys.stderr.write('Please upgrade this script to the latest version.\n')