2012-10-25 21:37:15 +00:00
|
|
|
#!/bin/sh
|
2011-09-08 12:04:30 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2011-09-07 22:41:37 +00:00
|
|
|
#
|
2012-10-25 21:37:15 +00:00
|
|
|
# 2012 Nico Schottelius (nico-cdist at schottelius.org)
|
2011-09-07 22:41:37 +00:00
|
|
|
#
|
|
|
|
# This file is part of cdist.
|
|
|
|
#
|
|
|
|
# cdist 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 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# cdist 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 cdist. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
2012-10-25 21:37:15 +00:00
|
|
|
# Wrapper for real script to allow execution from checkout
|
|
|
|
dir=${0%/*}
|
Rename cdist.py to scripts/cdist to avoid self import
naming cdist cdist.py and running import cdist, imports itself and thus raises an interesting error:
(virtualenv)[7:47] brief:virtualenv% cdist.py
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 1512, in _find_and_load_unlocked
AttributeError: 'module' object has no attribute '__path__'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/users/nico/oeffentlich/rechner/projekte/cdist/virtualenv/bin/cdist.py", line 230, in <module>
commandline()
File "/home/users/nico/oeffentlich/rechner/projekte/cdist/virtualenv/bin/cdist.py", line 27, in commandline
import cdist.banner
ImportError: No module named 'cdist.banner'; cdist is not a package
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/users/nico/oeffentlich/rechner/projekte/cdist/virtualenv/bin/cdist.py", line 235, in <module>
except cdist.Error as e:
AttributeError: 'module' object has no attribute 'Error'
Also described on
http://www.velocityreviews.com/forums/t953596-error-executing-import-html-parser-from-a-script.html
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-10-30 10:47:16 +00:00
|
|
|
|
|
|
|
# Ensure version is present - the bundled/shipped version contains a static version,
|
|
|
|
# the git version contains a dynamic version
|
2012-10-25 21:45:56 +00:00
|
|
|
"$dir/../build" version
|
Rename cdist.py to scripts/cdist to avoid self import
naming cdist cdist.py and running import cdist, imports itself and thus raises an interesting error:
(virtualenv)[7:47] brief:virtualenv% cdist.py
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 1512, in _find_and_load_unlocked
AttributeError: 'module' object has no attribute '__path__'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/users/nico/oeffentlich/rechner/projekte/cdist/virtualenv/bin/cdist.py", line 230, in <module>
commandline()
File "/home/users/nico/oeffentlich/rechner/projekte/cdist/virtualenv/bin/cdist.py", line 27, in commandline
import cdist.banner
ImportError: No module named 'cdist.banner'; cdist is not a package
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/users/nico/oeffentlich/rechner/projekte/cdist/virtualenv/bin/cdist.py", line 235, in <module>
except cdist.Error as e:
AttributeError: 'module' object has no attribute 'Error'
Also described on
http://www.velocityreviews.com/forums/t953596-error-executing-import-html-parser-from-a-script.html
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
2012-10-30 10:47:16 +00:00
|
|
|
PYTHONPATH="${dir}/../" "$dir/../scripts/cdist" "$@"
|