aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts/touch.py
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.com>2022-08-19 15:00:44 +0300
committerthegeorg <thegeorg@yandex-team.com>2022-08-19 15:00:44 +0300
commitad2a1b622d2bf6cf025982846153d9c4c791af2c (patch)
tree8906addc18a494ece9dff28b2701a37ef4b52bf8 /build/scripts/touch.py
parent7b61b052f3baa7e43edca48c373f95b5e5f1c845 (diff)
downloadydb-ad2a1b622d2bf6cf025982846153d9c4c791af2c.tar.gz
Let cmake export determine which build/scripts are mandatory
Diffstat (limited to 'build/scripts/touch.py')
-rwxr-xr-xbuild/scripts/touch.py50
1 files changed, 0 insertions, 50 deletions
diff --git a/build/scripts/touch.py b/build/scripts/touch.py
deleted file mode 100755
index e01ba7f86b..0000000000
--- a/build/scripts/touch.py
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/env python
-
-import optparse
-import os
-import sys
-import time
-
-
-def main(argv):
- parser = optparse.OptionParser(add_help_option=False)
- parser.disable_interspersed_args()
-
- parser.add_option('-?', '--help', dest='help',
- action='store_true', default=None, help='print help')
- parser.add_option('-t', dest='t', action='store', default=None)
-
- opts, argv_rest = parser.parse_args(argv)
- if getattr(opts, 'help', False):
- parser.print_help()
- return 0
-
- tspec = opts.t
- if tspec is None:
- times = None
- else:
- head, sep, tail = tspec.partition('.')
- if 8 > len(head):
- raise Exception("time spec must follow format [[CC]YY]MMDDhhmm[.SS]: " + tspec + '; ' + head)
- tfmt = ''
- if 12 == len(head):
- tfmt += '%Y'
- elif 10 == len(head):
- tfmt += '%y'
- tfmt += '%m%d%H%M'
- if 2 == len(tail):
- tfmt += '.%S'
- mtime = time.mktime(time.strptime(tspec, tfmt))
- times = (mtime, mtime)
-
- for file in argv_rest:
- try:
- os.utime(file, times)
- except:
- open(file, 'w').close()
- if times is not None:
- os.utime(file, times)
-
-
-if __name__ == '__main__':
- sys.exit(main(sys.argv[1:]))