Skip to content

Commit 770844a

Browse files
committed
Determine year in SQLite URL automatically
1 parent 868a2f5 commit 770844a

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

sqlite/build.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,19 @@ version_dir=$recipe_dir/build/$version
1717
mkdir -p $version_dir
1818
cd $version_dir
1919
src_filename=sqlite-autoconf-$version_int.tar.gz
20-
wget -c https://www.sqlite.org/$year/$src_filename
20+
21+
current_year=$(date +%Y)
22+
min_year=2022
23+
for year in $(seq $current_year -1 $min_year); do
24+
if wget -c https://www.sqlite.org/$year/$src_filename; then
25+
break
26+
fi
27+
done
28+
29+
if [ ! -f $src_filename ]; then
30+
echo "Couldn't find URL for $src_filename" >&2
31+
exit 1
32+
fi
2133

2234
build_dir=$version_dir/$HOST
2335
rm -rf $build_dir

0 commit comments

Comments
 (0)