Strategies for finding binary dependencies
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

improve dl-wheels

+12 -7
+12 -7
bin/dl-wheels
··· 1 1 #!/bin/sh -u 2 2 3 3 if [ $# -eq 0 ] || [ $1 == "--help" ]; then 4 - echo "Usage: dl-wheels.sh <wheel_dir> <csv_path>" 5 - echo "Example: dl-wheels.sh /home/me/wheels/ packages.csv" 4 + printf "Usage: dl-wheels.sh <wheel_dir> <csv_path>\n" 5 + printf "Example: dl-wheels.sh /home/me/wheels/ packages.csv\n" 6 6 exit 1 7 7 fi 8 8 9 9 wheel_dir=$(realpath "$1") 10 10 csv_path=$(realpath "$2") 11 + log_dir=$(realpath $(dirname "$2")) 12 + faillog_path="${log_dir}/faillog.txt" 13 + idx=1 11 14 12 15 cd "$wheel_dir" 13 16 14 17 while read name; do 15 - echo "" 16 - echo "——→ ${name}" 18 + printf "\n" 19 + printf "——→ [%04d] %s\n" "${idx}" "${name}" 17 20 name_sanitized="${name//-/_}" 18 21 if ls "${wheel_dir}/${name_sanitized}"* >/dev/null 2>&1; then 19 - echo "→ Wheel already found, skipping ${name}" 22 + printf "→ Wheel already found, skipping %s\n" "${name}" 20 23 else 21 24 pip download --only-binary :all: --no-deps $name 22 25 if [ $? -eq 0 ]; then 23 - echo "→ Downloaded ${name}" 26 + printf "→ Downloaded %s\n" "${name}" 24 27 else 25 - echo "→ Could not download ${name}" 28 + printf "→ Could not download %s\n" "${name}" 29 + printf "%s\n" "${name}" >> "$faillog_path" 26 30 fi 27 31 fi 32 + idx=$((idx+1)) 28 33 done <$csv_path