Skip to content

Commit

Permalink
Sanity check before python script execution
Browse files Browse the repository at this point in the history
Only generate Augeas ups.conf lens if we can import required Python
modules (re,glob,codecs)

Fossil-ID: SVN r3481
  • Loading branch information
aquette committed Mar 2, 2012
1 parent d9dac75 commit bb623b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# re-generate files needed by configure, and created otherwise at 'dist' time
if [ ! -f scripts/augeas/nutupsconf.aug.in ]
then
if python -c pass; then
if python -c "import re,glob,codecs"; then
echo "Regenerating Augeas ups.conf lens..."
cd scripts/augeas && ./gen-nutupsconf-aug.py && cd ../..
else
Expand Down
2 changes: 1 addition & 1 deletion scripts/augeas/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ EXTRA_DIST = gen-nutupsconf-aug.py nutupsconf.aug.tpl \
# only call the script to generate Augeas ups.conf lens upon "make dist",
# and if Python is present
dist-hook:
@if python -c pass; then \
@if python -c "import re,glob,codecs"; then \
echo "Regenerating Augeas ups.conf lens."; \
$(distdir)/gen-nutupsconf-aug.py $(distdir)/; \
else \
Expand Down

0 comments on commit bb623b7

Please sign in to comment.