aboutsummaryrefslogtreecommitdiff
path: root/subprojects/freeamo/src/get-licenses
diff options
context:
space:
mode:
Diffstat (limited to 'subprojects/freeamo/src/get-licenses')
-rw-r--r--subprojects/freeamo/src/get-licenses32
1 files changed, 28 insertions, 4 deletions
diff --git a/subprojects/freeamo/src/get-licenses b/subprojects/freeamo/src/get-licenses
index 79b6da4..4298962 100644
--- a/subprojects/freeamo/src/get-licenses
+++ b/subprojects/freeamo/src/get-licenses
@@ -23,10 +23,23 @@ cd "build/json/search-pages" || exit
function get-licenses--download {
# API: Add "last_license" to the search pages - https://github.com/mozilla/addons-server/issues/8945
-
+
output_file="$output_file_1";
- pv__size="$(wc -l < "$output_file")"
+
+ if [ "$debug" = true ]; then
+
+ pv__size=$(cat "$output_file" | head -n 3 | wc -l)
+
+ else
+
+ pv__size="$(wc -l < "$output_file")"
+
+ fi
+
source "$run_path/src/main_functions"
+
+ echo "Download $pv__size current_versions files that contain license information."
+
while IFS= read -r table; do
@@ -44,7 +57,7 @@ function get-licenses--download {
# echo -e "#==================
#Entry $line (of $total): $name\n"
- # Do now download the same license files over and over
+ # Do not download the same license files over and over
wget -nc -q "https://addons.mozilla.org/api/v3/addons/addon/$slug/versions/$current_version__id/" -O "$run_path/build/json/current_versions/$current_version__id.json"
fi
@@ -58,10 +71,21 @@ function get-licenses--download {
function get-licenses--filter {
output_file="$output_file_1";
- pv__size="$(wc -l < "$output_file")"
+
+ if [ "$debug" = true ]; then
+
+ pv__size=$(cat "$output_file" | head -n 3 | wc -l)
+
+ else
+
+ pv__size="$(wc -l < "$output_file")"
+
+ fi
+
source "$run_path/src/main_functions"
rm -f "$run_path/build/index-search-pages--free-licenses.txt"
+ echo "Filter free licenses for $pv__size entries."
while IFS= read -r table; do