./py-compile --basedir "$d" "$f.py" "sub/$f.py"
find "$d2" # For debugging.
py_installed "$d2/$f.pyc"
- py_installed "$d2/$f.pyo"
py_installed "$d2/sub/$f.pyc"
- py_installed "$d2/sub/$f.pyo"
files=$(find "$d2" | grep '\.py[co]$')
- test $(echo "$files" | wc -l) -eq 4
+ # with new-enough Python3, there are six files.
+ test $(echo "$files" | wc -l) -eq 4 || $(echo "$files" | wc -l) -eq 6
case $d2 in
.|..) rm -f $files;;
*) rm -rf "$d2";;
./py-compile foo.py sub/bar.py 1/_/2/_/3/_/0.py
py_installed foo.pyc
-py_installed foo.pyo
py_installed sub/bar.pyc
-py_installed sub/bar.pyo
py_installed 1/_/2/_/3/_/0.pyc
-py_installed 1/_/2/_/3/_/0.pyo
:
find $destdir # For debugging.
st=0
-for x in c o; do
- for b in foo sub/bar; do
- f=$(pyc_location -p "$destdir/$b.py$x")
- test -f "$f"
- strings "$f" || : # For debugging.
- $FGREP $destdir $f && { echo BAD: $f; st=1; }
- done
+for b in foo sub/bar; do
+ f=$(pyc_location -p "$destdir/$b.pyc")
+ test -f "$f"
+ strings "$f" || : # For debugging.
+ $FGREP $destdir $f && { echo BAD: $f; st=1; }
done
exit $st
: > ./--foo.py
./py-compile -- -o.py --foo.py
py_installed ./-o.pyc
-py_installed ./-o.pyo
py_installed ./--foo.pyc
-py_installed ./--foo.pyo
rm -f ./-*.py[co]
: > x.py
./py-compile x.py -o.py --foo.py
py_installed ./x.pyc
-py_installed ./x.pyo
py_installed ./-o.pyc
-py_installed ./-o.pyo
py_installed ./--foo.pyc
-py_installed ./--foo.pyo
:
test -f "$py_site"/am_foo.py
py_installed "$py_site"/am_foo.pyc
- py_installed "$py_site"/am_foo.pyo
py_installed "$py_site"/am_virtenv/__init__.py
py_installed "$py_site"/am_virtenv/__init__.pyc
- py_installed "$py_site"/am_virtenv/__init__.pyo
test -f "$py_site"/libquux.a
test -f "$py_site"/am_virtenv/libzardoz.a
}
test ! -e "$py_site"/am_foo.py
py_installed --not "$py_site"/am_foo.pyc
- py_installed --not "$py_site"/am_foo.pyo
test ! -e "$py_site"/am_virtenv/__init__.py
py_installed --not "$py_site"/am_virtenv/__init__.pyc
- py_installed --not "$py_site"/am_virtenv/__init__.pyo
test ! -e "$py_site"/libquux.a
test ! -e "$py_site"/am_virtenv/libzardoz.a
}
$MAKE install
test -f "$inst/your/two.py"
py_installed "$inst/your/two.pyc"
-py_installed "$inst/your/two.pyo"
py_installed --not "$inst/my/one.py"
py_installed --not "$inst/my/one.pyc"
-py_installed --not "$inst/my/one.pyo"
$MAKE uninstall
py_installed --not "$inst/your/two.py"
py_installed --not "$inst/your/two.pyc"
-py_installed --not "$inst/your/two.pyo"
../configure --prefix=$cwd/"$inst" one=1
$MAKE install
py_installed --not "$inst/your/two.py"
py_installed --not "$inst/your/two.pyc"
-py_installed --not "$inst/your/two.pyo"
test -f "$inst/my/one.py"
py_installed "$inst/my/one.pyc"
-py_installed "$inst/my/one.pyo"
$MAKE uninstall
py_installed --not "$inst/my/one.py"
py_installed --not "$inst/my/one.pyc"
-py_installed --not "$inst/my/one.pyo"
$MAKE disttest
# Perfunctory test that the files were created.
test -f "$destdir/usr/share/my/my.py"
-pyo=$(pyc_location -p "$destdir/usr/share/my/my.pyo")
pyc=$(pyc_location -p "$destdir/usr/share/my/my.pyc")
# If DESTDIR has made it into the byte compiled files, fail the test.
-st=0; $FGREP "$destdir" "$pyc" "$pyo" || st=$?
+st=0; $FGREP "$destdir" "$pyc" || st=$?
test $st -eq 1
:
$MAKE install
py_installed inst/my/one.py
py_installed inst/my/one.pyc
-py_installed inst/my/one.pyo
: