Skip to content

Commit c9ce8d4

Browse files
committed
chore: minor changes
Signed-off-by: ale5000 <15793015+ale5000-git@users.noreply.github.com>
1 parent fb04275 commit c9ce8d4

File tree

6 files changed

+32
-16
lines changed

6 files changed

+32
-16
lines changed

.vscode/tasks.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"fileLocation": "search",
2626
"pattern": [
2727
{
28-
"regexp": "^([^:]+):(\\d+):\\s+(ERROR|WARNING):\\s+\\[([^\\]]*)\\]\\s+(.*)$",
28+
"regexp": "^([^:]+):(\\d+):\\s+(ERROR|WARNING):\\s+\\[([^\\]]*)\\]\\s+(.*)\\r?$",
2929
"file": 1,
3030
"line": 2,
3131
"severity": 3,
@@ -55,7 +55,7 @@
5555
"fileLocation": "search",
5656
"pattern": [
5757
{
58-
"regexp": "^([^:]+):(\\d+):\\s+(ERROR|WARNING):\\s+\\[([^\\]]*)\\]\\s+(.*)$",
58+
"regexp": "^([^:]+):(\\d+):\\s+(ERROR|WARNING):\\s+\\[([^\\]]*)\\]\\s+(.*)\\r?$",
5959
"file": 1,
6060
"line": 2,
6161
"severity": 3,

build.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ if test -n "${ZIP_SHORT_COMMIT_ID?}"; then
130130
fi
131131

132132
if test "${OPENSOURCE_ONLY:?}" != 'false'; then
133-
if ! is_oss_only_build_enabled; then
133+
if ! conf_is_oss_only_build_enabled; then
134134
echo 'WARNING: The OSS only build is disabled'
135135
set_title 'OSS only build is disabled'
136136

@@ -222,15 +222,15 @@ FILENAME_EXT='.zip'
222222
# Download and verify external application files to ensure package integrity; bundled files will be verified at a later stage
223223
{
224224
if test "${OPENSOURCE_ONLY:?}" = 'false'; then
225-
current_dl_list="$(files_to_download)" || ui_error 'Missing download list' "${LINENO-}" "${FUNCNAME-}"
225+
current_dl_list="$(conf_full_files_to_download)" || ui_error 'Missing download list' "${LINENO-}" "${FUNCNAME-}"
226226
dl_list "${current_dl_list?}" || ui_error 'Failed to download the necessary files' "${LINENO-}" "${FUNCNAME-}"
227227

228228
dl_file 'misc/keycheck' 'keycheck-arm.bin' '2e348074961b78c2cf9e8728910ce7c9596f195a6344ead35e536ccebe18df76' 'github.com/someone755/kerneller/raw/9bb15ca2e73e8b81e412d595b52a176bdeb7c70a/extract/tools/keycheck' ''
229229
else
230230
echo 'Skipped not OSS files!'
231231
fi
232232

233-
current_dl_list="$(oss_files_to_download)" || ui_error 'Missing download list' "${LINENO-}" "${FUNCNAME-}"
233+
current_dl_list="$(conf_oss_files_to_download)" || ui_error 'Missing download list' "${LINENO-}" "${FUNCNAME-}"
234234
dl_list "${current_dl_list?}" || ui_error 'Failed to download the necessary files' "${LINENO-}" "${FUNCNAME-}"
235235

236236
clear_dl_temp_dir || ui_error 'Failed to remove the DL temp dir' "${LINENO-}" "${FUNCNAME-}"
@@ -277,7 +277,7 @@ if test -e "${TEMP_DIR:?}/zip-content/origin/file-list.dat"; then
277277
fi
278278

279279
if test "${OPENSOURCE_ONLY:?}" = 'false'; then
280-
files_to_download | while IFS='|' read -r LOCAL_FILENAME LOCAL_PATH MIN_API MAX_API FINAL_FILENAME INTERNAL_NAME FILE_HASH _; do
280+
conf_full_files_to_download | while IFS='|' read -r LOCAL_FILENAME LOCAL_PATH MIN_API MAX_API FINAL_FILENAME INTERNAL_NAME FILE_HASH _; do
281281
mkdir -p -- "${TEMP_DIR:?}/zip-content/origin/${LOCAL_PATH:?}"
282282
cp -f -- "${BUILD_CACHE_DIR:?}/${LOCAL_PATH:?}/${LOCAL_FILENAME:?}.apk" "${TEMP_DIR:?}/zip-content/origin/${LOCAL_PATH:?}/" || ui_error "Failed to copy to the temp dir the file => '${LOCAL_PATH}/${LOCAL_FILENAME}.apk'" "${LINENO-}" "${FUNCNAME-}"
283283

conf/common.inc.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
#!/usr/bin/env bash
1+
#!/usr/bin/env sh
22
# SPDX-FileCopyrightText: NONE
33
# SPDX-License-Identifier: CC0-1.0
44

5-
is_oss_only_build_enabled()
5+
conf_is_oss_only_build_enabled()
66
{ # 0 => true, 1 => false
77
return 1
88
}
99

10-
oss_files_to_download()
10+
conf_oss_files_to_download()
1111
{
1212
cat << 'EOF'
1313
EOF

conf/full.inc.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#!/usr/bin/env bash
1+
#!/usr/bin/env sh
22
# SPDX-FileCopyrightText: NONE
33
# SPDX-License-Identifier: CC0-1.0
44

5-
files_to_download()
5+
conf_full_files_to_download()
66
{
77
cat << 'EOF'
88
GoogleContactsSyncAdapter12|priv-app|31||GoogleContactsSyncAdapter|com.google.android.syncadapters.contacts|b680052da895d9a198b856162148de78bc5ad550e46d92239ee9c9308c86ee04|www.apkmirror.com/apk/google-inc/google-contacts-sync/google-contacts-sync-12-8361351-release/google-contacts-sync-12-8361351-android-apk-download/|cold1.gofile.io/download/web/e9cee2f5-0c8c-4fe1-9d5a-3cf13ab395f7/GoogleContactsSyncAdapter12.apk

conf/lfs.inc.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22
# SPDX-FileCopyrightText: NONE
33
# SPDX-License-Identifier: CC0-1.0
44

5-
get_mirror_by_sha256()
5+
conf_lfs_get_mirror_by_sha256()
66
{
77
case "${1?}" in
8-
*) ui_error "Unknown hash => ${1?}" ;;
8+
*)
9+
ui_nl
10+
# shellcheck disable=SC3028 # Ignore: In POSIX sh, FUNCNAME is undefined
11+
ui_error "Unknown hash => ${1?}" "${LINENO-}" "${FUNCNAME-}"
12+
;;
913
esac
1014

1115
return 0

lib/common.lib.sh

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,14 @@ beep()
7171
# @see restore_saved_title_if_exist()
7272
ui_error()
7373
{
74-
printf 1>&2 '%s:%s: ERROR: [%s] %s\n' "${4:-"${0##*/}"}" "${2:-0}" "${3:-<main>}" "${1:?}"
74+
local _source_file
75+
case "${3-}" in
76+
conf_lfs_*) _source_file='lfs.inc.sh' ;;
77+
conf_full_*) _source_file='full.inc.sh' ;;
78+
conf_*) _source_file='common.inc.sh' ;;
79+
*) _source_file="${4:-"${0##*/}"}" ;;
80+
esac
81+
printf 1>&2 '%s:%s: ERROR: [%s] %s\n' "${_source_file?}" "${2:-0}" "${3:-<main>}" "${1:?}"
7582

7683
pause_if_needed 0
7784
restore_saved_title_if_exist
@@ -98,6 +105,11 @@ ui_debug()
98105
printf 1>&2 '%s\n' "${1?}"
99106
}
100107

108+
ui_nl()
109+
{
110+
printf 1>&2 '\n'
111+
}
112+
101113
export DL_DEBUG="${DL_DEBUG:-false}"
102114
export http_proxy="${http_proxy-}"
103115
export ftp_proxy="${ftp_proxy-}"
@@ -968,8 +980,8 @@ download_cached_if_lfs_pointer()
968980
local _expected_sha256 _mirror_url
969981

970982
# shellcheck source=/dev/null
971-
command 1> /dev/null -v 'get_mirror_by_sha256' || command . "${MAIN_DIR:?}/conf/lfs.inc.sh" || _ui_error_local "Failed to source 'conf/lfs.inc.sh'" "${LINENO-}" "${FUNCNAME-}"
972-
_mirror_url="$(get_mirror_by_sha256 "${3:?}")" || _ui_error_local "Failed to get the mirror" "${LINENO-}" "${FUNCNAME-}"
983+
command 1> /dev/null -v 'conf_lfs_get_mirror_by_sha256' || command . "${MAIN_DIR:?}/conf/lfs.inc.sh" || _ui_error_local "Failed to source 'conf/lfs.inc.sh'" "${LINENO-}" "${FUNCNAME-}"
984+
_mirror_url="$(conf_lfs_get_mirror_by_sha256 "${3:?}")" || _ui_error_local "Failed to get the mirror" "${LINENO-}" "${FUNCNAME-}"
973985

974986
_expected_sha256=$(grep -m 1 -e '^oid sha256:' -- "${2:?}/${1:?}" | cut -d ':' -f 2 -s) || _ui_error_local "Failed to extract the SHA256 hash from the LFS pointer" "${LINENO-}" "${FUNCNAME-}"
975987
dl_file 'LFS' "${_expected_sha256:?}" "${3:?}" "${_mirror_url:?}" ''

0 commit comments

Comments
 (0)