Skip to content

Commit 1e15243

Browse files
committed
minor output-related fixes
1 parent ca6e218 commit 1e15243

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
55

66
PKG_NAME:=adblock-fast
77
PKG_VERSION:=1.2.0
8-
PKG_RELEASE:=10
8+
PKG_RELEASE:=12
99
PKG_MAINTAINER:=Stan Grishin <[email protected]>
1010
PKG_LICENSE:=AGPL-3.0-or-later
1111

files/etc/init.d/adblock-fast

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,8 @@ load_network() {
742742
sleep 1
743743
done
744744
json add error 'errorNoWanGateway'
745-
output_error "$(get_text 'errorNoWanGateway')"; return 1;
745+
output_error "$(get_text 'errorNoWanGateway')"
746+
return 1
746747
}
747748

748749
detect_file_type() {
@@ -996,7 +997,6 @@ load_environment() {
996997
if ! mkdir -p "${i%/*}"; then
997998
if [ "$param" != 'quiet' ]; then
998999
json add error 'errorOutputDirCreate' "$i"
999-
output_error "$(get_text 'errorOutputDirCreate' "$i")"
10001000
fi
10011001
fi
10021002
done
@@ -1180,7 +1180,6 @@ resolver() {
11801180
if ! adb_file 'test'; then
11811181
json set status 'statusFail'
11821182
json add error 'errorOutputFileCreate' "$outputFile"
1183-
output_error "$(get_text 'errorOutputFileCreate' "$outputFile")"
11841183
return 1
11851184
fi
11861185
output 1 "Cycling $resolver_name "
@@ -1223,7 +1222,6 @@ resolver() {
12231222
output_fail
12241223
json set status 'statusFail'
12251224
json add error 'errorDNSReload'
1226-
output_error "$(get_text 'errorDNSReload')"
12271225
return 1
12281226
fi
12291227
;;
@@ -1282,7 +1280,6 @@ resolver() {
12821280
output_fail
12831281
json set status 'statusFail'
12841282
json add error 'errorNoHeartbeat'
1285-
output_error "$(get_text 'errorNoHeartbeat')"
12861283
return 1
12871284
;;
12881285
revert)
@@ -1299,7 +1296,6 @@ resolver() {
12991296
output_fail
13001297
json set status 'statusFail'
13011298
json add error 'errorDNSReload'
1302-
output_error "$(get_text 'errorDNSReload')"
13031299
return 1
13041300
fi
13051301
;;
@@ -1324,7 +1320,6 @@ resolver() {
13241320
else
13251321
json set status 'statusFail'
13261322
json add error 'errorNoOutputFile' "$outputFile"
1327-
output_error "$(get_text 'errorNoOutputFile' "$outputFile")"
13281323
return 1
13291324
fi
13301325
;;
@@ -1379,6 +1374,7 @@ adb_file() {
13791374
return $?
13801375
;;
13811376
create_gzip)
1377+
[ -s "$outputFile" ] || return 1
13821378
rm -f "$outputGzip" >/dev/null 2>/dev/null
13831379
R_TMP="$(mktemp -q -t "${packageName}_tmp.XXXXXXXX")"
13841380
if gzip < "$outputFile" > "$R_TMP"; then
@@ -1409,8 +1405,6 @@ adb_file() {
14091405
process_file_url_wrapper() {
14101406
if [ "$2" != '0' ]; then
14111407
json add error 'errorConfigValidationFail'
1412-
output_error "$(get_text 'errorConfigValidationFail')"
1413-
output "Please check if the '$packageConfigFile' contains correct values for config options."
14141408
fi
14151409
if [ "$parallel_downloads" -gt 0 ]; then
14161410
process_file_url "$1" &
@@ -1557,7 +1551,6 @@ download_lists() {
15571551
config_foreach _config_calculate_sizes 'file_url'
15581552
if [ $((free_mem)) -lt $((total_sizes * 2)) ]; then
15591553
json add error 'errorTooLittleRam' "$free_mem"
1560-
output_error "$(get_text 'errorTooLittleRam' "$free_mem")"
15611554
return 1
15621555
else
15631556
return 0
@@ -1922,7 +1915,6 @@ start_service() {
19221915
output_okn
19231916
else
19241917
output_failn
1925-
json add error 'errorRestoreCompressedCache'
19261918
output_error "$(get_text 'errorRestoreCompressedCache')"
19271919
action='download'
19281920
fi
@@ -1938,7 +1930,6 @@ start_service() {
19381930
resolver 'on_start'
19391931
else
19401932
output_failn
1941-
json add error 'errorRestoreCache'
19421933
output_error "$(get_text 'errorRestoreCache')"
19431934
action='download'
19441935
fi
@@ -1949,7 +1940,6 @@ start_service() {
19491940
if [ -z "$blocked_url" ] && [ -z "$blocked_domain" ]; then
19501941
json set status 'statusFail'
19511942
json add error 'errorNothingToDo'
1952-
output_error "$(get_text 'errorNothingToDo')"
19531943
else
19541944
if ! adb_file 'test' || adb_file 'test_cache' || adb_file 'test_gzip'; then
19551945
output 1 "Force-reloading $serviceName...\n"
@@ -2219,7 +2209,7 @@ service_triggers() {
22192209

22202210
service_started() {
22212211
local start_time end_time elapsed step_title
2222-
if [ -n "$compressed_cache" ] && ! adb_file 'test_gzip'; then
2212+
if [ -n "$compressed_cache" ] && ! adb_file 'test_gzip' && adb_file 'test'; then
22232213
start_time=$(date +%s)
22242214
step_title="Creating ${dns} compressed cache"
22252215
output 1 "${step_title} "

0 commit comments

Comments
 (0)