Debian Codegraph @

cmake/tribits/python_utils/snapshot-dir.py

raw
1 #!/usr/bin/env python3
2 # @HEADER
3 # *****************************************************************************
4 # TriBITS: Tribal Build, Integrate, and Test System
5 #
6 # Copyright 2013-2016 NTESS and the TriBITS contributors.
7 # SPDX-License-Identifier: BSD-3-Clause
8 # *****************************************************************************
9 # @HEADER
10
11
12 import sys
13 import os
14
15
16 #
17 # Get the location of the scripts directory whether from a sym link or the
18 # actual
19 #
20
21 checkinTestFilePath = os.path.abspath(sys.argv[0])
22 checkinTestFileRealPath = os.path.realpath(checkinTestFilePath)
23 scriptsDir = os.path.dirname(checkinTestFileRealPath)+"/python"
24 #print("scriptsDir='" + scriptsDir + "'")
25 sys.path.insert(0, scriptsDir)
26
27
28
29 #
30 # Import and run
31 #
32
33 import SnapshotDir
34
35 snapshotDirDummyDefaults = os.environ.get("SNAPSHOT_DIR_DUMMY_DEFAULTS","")
36
37 defaultOptions = None
38 if snapshotDirDummyDefaults:
39 defaultOptions = SnapshotDir.DefaultOptions()
40 defaultOptions.origDir = "<orig-dir>"
41 defaultOptions.destDir = "<dest-dir>"
42
43 success = SnapshotDir.snapshotDirMainDriver(sys.argv[1:], defaultOptions)
44
45 if success:
46 rtnCode = 0
47 else:
48 rtnCode = 1
49
50 sys.exit(rtnCode)