
Since Ic16f134fe34293bb68e7c632dd320f523366320d simple-init has installed glean into a virtualenv. Despite this, it still needs to setup a range of global symlinks (in /usr/local/bin) so glean can blindly call "glean" or "glean.sh". This means that glean installation isn't actually stand-alone. Unless simple-init sets up these global symlinks the glean install doesn't work. This makes it very annoying to try and update the way the scripts are working, because we have to merge changes into simple-init as well. We can make the installation self-consistent by using the install tool. The init scripts call glean.sh -- we can find the full path to glean.sh using pkg_resources and write that into the files. glean.sh wants to call the python tool "glean". This is slightly harder, because at runtime the script doesn't really know how to invoke this (i.e. in a virtualenv, it should call /path/to/virtualenv/bin/glean). To allow for this, write a sibling file next to "glean.sh" to invoke glean with the interpreter the install is running under patched in. This way, glean.sh can call this wrapper relative to itself and get the right thing. Add a __main__ to allow glean to be called like this, and update the glean.sh script. Change-Id: I1adfecf0d5c53648ee857be502216fd8d6cc5e16
27 lines
757 B
Python
27 lines
757 B
Python
# Copyright (c) 2021 Ian Wienand <iwienand@redhat.com>
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
# implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
import sys
|
|
|
|
from glean.cmd import main
|
|
|
|
rc = 1
|
|
try:
|
|
main()
|
|
rc = 0
|
|
except Exception as e:
|
|
print('Error: %s' % e, file=sys.stderr)
|
|
sys.exit(rc)
|