-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun-uninstalled.in
executable file
·54 lines (45 loc) · 2.05 KB
/
run-uninstalled.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env python3
#
# Copyright (C) 2019 Sam Thursfield <sam@afuera.me.uk>
#
# This is a tool for running development versions of Tracker the build tree.
#
# See README.md in tracker.git for usage information.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
import os
import pathlib
import sys
cli_dir = "@tracker_uninstalled_cli_dir@"
testutils_dir = "@tracker_uninstalled_testutils_dir@"
build_directory = pathlib.Path(__file__).parent
dbus_config = build_directory.joinpath('tests/test-bus.conf')
env = os.environ
# Add the `tracker` CLI to PATH.
path = env.get('PATH', '').split(':')
env['PATH'] = ':'.join([cli_dir] + path)
# Add trackertestutils module to PYTHONPATH
pythonpath = env.get('PYTHONPATH', '').split(':')
env['PYTHONPATH'] = ':'.join([testutils_dir] + pythonpath)
env['GSETTINGS_SCHEMA_DIR'] = '@uninstalled_gsettings_schema_dir@'
env['TRACKER_CLI_DIR'] = "@tracker_uninstalled_cli_dir@"
env['TRACKER_EXTRACTOR_RULES_DIR'] = "@tracker_uninstalled_extract_rules_dir@"
env['TRACKER_EXTRACTORS_DIR'] = "@tracker_uninstalled_extractors_dir@"
env['TRACKER_MINER_SERVICES_DIR'] = "@tracker_uninstalled_miner_services_dir@"
env['TRACKER_TEST_DOMAIN_ONTOLOGY_RULE'] = "@tracker_uninstalled_domain_rule@"
env['TRACKER_WRITEBACK_MODULES_DIR'] = "@tracker_uninstalled_writeback_modules_dir@"
args = [sys.argv[0], '-m', 'trackertestutils', '--dbus-config', dbus_config] + sys.argv[1:]
os.execve(sys.executable, args, env)