File tree Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change 13
13
exit 1
14
14
else
15
15
source " ${ROOT} /bin/dist-functions"
16
- check_file " ${DIST} /neo4j-driver-${VERSION} .tar.gz"
17
- check_file " ${DIST} /neo4j-${VERSION} .tar.gz"
16
+ for PACKAGE in " neo4j-driver" " neo4j" ; do
17
+ NORMALIZED_PACKAGE=" $( normalize_dist_name " $PACKAGE " ) "
18
+ if ! (check_file " ${DIST} /${NORMALIZED_PACKAGE} -${VERSION} .tar.gz" \
19
+ || check_file " ${DIST} /${PACKAGE} -${VERSION} .tar.gz" ); then
20
+ STATUS=1
21
+ fi
22
+ done
18
23
fi
19
24
20
25
exit ${STATUS}
Original file line number Diff line number Diff line change @@ -24,16 +24,23 @@ function set_version
24
24
sed -i ' s/^version = .*/version = "' $1 ' "/g' neo4j/meta.py
25
25
}
26
26
27
+ # distribution normalization according to PEP 625 https://peps.python.org/pep-0625/
28
+ function normalize_dist_name
29
+ {
30
+ echo $1 | sed ' s/[._-]\+/_/g' | tr ' [:upper:]' ' [:lower:]'
31
+ }
32
+
27
33
function check_file
28
34
{
29
35
FILE=$1
30
- echo -n " Checking file $( basename ${FILE} ) ... "
36
+ echo -n " Checking file $( basename " ${FILE} " ) ... "
31
37
if [ -f " ${FILE} " ]
32
38
then
33
39
echo " OK"
40
+ return 0
34
41
else
35
42
echo " missing"
36
- STATUS= 1
43
+ return 1
37
44
fi
38
45
}
39
46
@@ -76,9 +83,13 @@ function set_metadata_and_setup
76
83
77
84
# Create source distribution
78
85
find . -name * .pyc -delete
79
- rm -rf ${ROOT} /* .egg-info 2> /dev/null
86
+ rm -rf " ${ROOT} /*.egg-info" 2> /dev/null
80
87
python setup.py $*
81
- check_file " ${DIST} /${PACKAGE} -${VERSION} .tar.gz"
88
+ NORMALIZED_PACKAGE=" $( normalize_dist_name $PACKAGE ) "
89
+ if ! (check_file " ${DIST} /${NORMALIZED_PACKAGE} -${VERSION} .tar.gz" \
90
+ || check_file " ${DIST} /${PACKAGE} -${VERSION} .tar.gz" ); then
91
+ STATUS=1
92
+ fi
82
93
83
94
trap - EXIT
84
95
cleanup
You can’t perform that action at this time.
0 commit comments