File: check-sdist

package info (click to toggle)
llvm-toolchain-9 1%3A9.0.1-16.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 882,388 kB
  • sloc: cpp: 4,167,636; ansic: 714,256; asm: 457,610; python: 155,927; objc: 65,094; sh: 42,856; lisp: 26,908; perl: 7,786; pascal: 7,722; makefile: 6,881; ml: 5,581; awk: 3,648; cs: 2,027; xml: 888; javascript: 381; ruby: 156
file content (45 lines) | stat: -rwxr-xr-x 1,243 bytes parent folder | download | duplicates (38)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh

if [ $# = 1 ]; then
    cd $1
fi

# Create a list of all the files in the source tree, excluding various things we
# know don't belong.
echo "Creating current directory contents list."
find . | \
    grep -v '^\./.gitignore' | \
    grep -v '^\./dist' | \
    grep -v '^\./utils' | \
    grep -v '^\./venv' | \
    grep -v '^\./notes.txt' | \
    grep -v '^\./lit.egg-info' | \
    grep -v '^\./lit/ExampleTests' | \
    grep -v '/Output' | \
    grep -v '__pycache__' | \
    grep -v '.pyc$' | grep -v '~$' | \
    sort > /tmp/lit_source_files.txt

# Create the source distribution.
echo "Creating source distribution."
rm -rf lit.egg-info dist
python setup.py sdist > /tmp/lit_sdist_log.txt

# Creating list of files in source distribution.
echo "Creating source distribution file list."
tar zft dist/lit*.tar.gz | \
    sed -e 's#lit-[0-9.dev]*/#./#' | \
    sed -e 's#/$##' | \
    grep -v '^\./PKG-INFO' | \
    grep -v '^\./setup.cfg' | \
    grep -v '^\./lit.egg-info' | \
    sort > /tmp/lit_sdist_files.txt

# Diff the files.
echo "Running diff..."
if (diff /tmp/lit_source_files.txt /tmp/lit_sdist_files.txt); then
    echo "Diff is clean!"
else
    echo "error: there were differences in the source lists!"
    exit 1
fi