[LIT] Add JSONMetricValue type to wrap types supported by the json encoder.
[oota-llvm.git] / utils / lit / utils / check-sdist
1 #!/bin/sh
2
3 if [ $# = 1 ]; then
4     cd $1
5 fi
6
7 # Create a list of all the files in the source tree, excluding various things we
8 # know don't belong.
9 echo "Creating current directory contents list."
10 find . | \
11     grep -v '^\./.gitignore' | \
12     grep -v '^\./dist' | \
13     grep -v '^\./utils' | \
14     grep -v '^\./venv' | \
15     grep -v '^\./notes.txt' | \
16     grep -v '^\./lit.egg-info' | \
17     grep -v '^\./lit/ExampleTests' | \
18     grep -v '/Output' | \
19     grep -v '__pycache__' | \
20     grep -v '.pyc$' | grep -v '~$' | \
21     sort > /tmp/lit_source_files.txt
22
23 # Create the source distribution.
24 echo "Creating source distribution."
25 rm -rf lit.egg-info dist
26 python setup.py sdist > /tmp/lit_sdist_log.txt
27
28 # Creating list of files in source distribution.
29 echo "Creating source distribution file list."
30 tar zft dist/lit*.tar.gz | \
31     sed -e 's#lit-[0-9.dev]*/#./#' | \
32     sed -e 's#/$##' | \
33     grep -v '^\./PKG-INFO' | \
34     grep -v '^\./setup.cfg' | \
35     grep -v '^\./lit.egg-info' | \
36     sort > /tmp/lit_sdist_files.txt
37
38 # Diff the files.
39 echo "Running diff..."
40 if (diff /tmp/lit_source_files.txt /tmp/lit_sdist_files.txt); then
41     echo "Diff is clean!"
42 else
43     echo "error: there were differences in the source lists!"
44     exit 1
45 fi