File tree 1 file changed +26
-0
lines changed 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 12
12
set -eou pipefail
13
13
shopt -s globstar
14
14
15
+ # Function copied from manywheel/build_common.sh
16
+ make_wheel_record () {
17
+ FPATH=$1
18
+ if echo $FPATH | grep RECORD > /dev/null 2>&1 ; then
19
+ # if the RECORD file, then
20
+ echo " $FPATH ,,"
21
+ else
22
+ HASH=$( openssl dgst -sha256 -binary $FPATH | openssl base64 | sed -e ' s/+/-/g' | sed -e ' s/\//_/g' | sed -e ' s/=//g' )
23
+ FSIZE=$( ls -nl $FPATH | awk ' {print $5}' )
24
+ echo " $FPATH ,sha256=$HASH ,$FSIZE "
25
+ fi
26
+ }
27
+
15
28
OUTPUT_DIR=${OUTPUT_DIR:- $(pwd)}
16
29
17
30
tmp_dir=" $( mktemp -d) "
@@ -49,6 +62,19 @@ for whl_file in "$@"; do
49
62
# Example: torch-1.8.0+cpu.dist-info => torch-1.8.0.dist-info
50
63
mv " ${dist_info_folder} " " ${dirname_dist_info_folder} /${basename_dist_info_folder/ ${version_with_suffix} / ${version_no_suffix} } "
51
64
cd " ${whl_dir} "
65
+
66
+ # copied from manywheel/build_common.sh
67
+ # regenerate the RECORD file with new hashes
68
+ record_file=" ${dirname_dist_info_folder} /${basename_dist_info_folder/ ${version_with_suffix} / ${version_no_suffix} } /RECORD"
69
+ if [[ -e $record_file ]]; then
70
+ echo " Generating new record file $record_file "
71
+ rm -f $record_file
72
+ # generate records for folders in wheel
73
+ find * -type f | while read fname; do
74
+ echo $( make_wheel_record $fname ) >> $record_file
75
+ done
76
+ fi
77
+
52
78
zip -qr " ${new_whl_file} " .
53
79
)
54
80
done
You can’t perform that action at this time.
0 commit comments