summaryrefslogtreecommitdiffstats
path: root/t/recipes/checks/cruft/cruft-python/build-spec/pre-build
blob: a5ee0a02df42f1f200797c6bea645725e81d942a (plain)
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
#!/bin/sh
#
# Create all the various junk that shouldn't exist in the diff so that we can
# trigger all the tags.

set -e
dir="$1"
fake="$dir/debian/missing-sources/fake.py"

cp "$fake" "$dir"
echo 'import fake' > "${dir}/main.py"
unset PYTHONDONTWRITEBYTECODE
PYTHONPATH="${dir}" python "${dir}/main.py" > /dev/null
PYTHONPATH="${dir}" python -O "${dir}/main.py"  > /dev/null
# now remove source
rm -f "${dir}"/main.py
rm -f "${dir}"/fake.py

cp "$fake" "$dir/fake2.py"
echo 'import fake2' > "${dir}/main.py"
unset PYTHONDONTWRITEBYTECODE
PYTHONPATH="${dir}" python "${dir}/main.py" > /dev/null
PYTHONPATH="${dir}" python -O "${dir}/main.py"  > /dev/null
# now remove source
rm -f "${dir}"/main.py
rm -f "${dir}"/fake2.py