remove opkg-part
This commit is contained in:
parent
7a77d03c7e
commit
cfce4ae53c
117
update_psa_impl
117
update_psa_impl
@ -35,6 +35,9 @@ update_psa() {
|
|||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
rm -f "$OPKG_CMDS_TMP"
|
||||||
|
rm -f "$GIT_PULL_TMP"
|
||||||
|
|
||||||
update_psa_activated # message to ISMAS
|
update_psa_activated # message to ISMAS
|
||||||
|
|
||||||
local try_update_count=0
|
local try_update_count=0
|
||||||
@ -73,62 +76,76 @@ update_psa() {
|
|||||||
|
|
||||||
# no backup necessary as saved in git-repo
|
# no backup necessary as saved in git-repo
|
||||||
|
|
||||||
local changed_files=$(changed_file_names)
|
# local changed_files=$(changed_file_names)
|
||||||
|
|
||||||
if ! check_hardware_compatibility "$files_to_copy" ; then
|
if [[ ! -z $GIT_PULL_TMP ]]; then
|
||||||
local __r=$?
|
# TODO
|
||||||
log_error "$func:${LINENO}: json/ini-files not fit for PSA"
|
if ! check_hardware_compatibility "$files_to_copy" ; then
|
||||||
revert_customer_repository
|
local __r=$?
|
||||||
exit $__r
|
log_error "$func:${LINENO}: json/ini-files not fit for PSA"
|
||||||
|
revert_customer_repository
|
||||||
|
exit $__r
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# check if the opkg-command-file has been changed during 'git pull'
|
|
||||||
if grep -qE ".*opkg_commands.*?" <<< $changed_files; then
|
|
||||||
# read opkg_cmds: each line respresents an opkg-command
|
|
||||||
readarray opkg_commands < <(cat $OPKG_CMDS_PSA_FILE)
|
|
||||||
for opkg_c in "${opkg_commands[@]}"; do
|
|
||||||
if grep -qE "^\s*[#]+.*$" <<< $opkg_c; then
|
|
||||||
continue # found comment line
|
|
||||||
fi
|
|
||||||
|
|
||||||
# package manipulation commands without package:
|
if [[ ! -z "$OPKG_CMDS_TMP" ]]; then
|
||||||
local cwp="update|upgrade|clean"
|
local commands="$(cat ${OPKG_CMDS_TMP} | tr '\n' '; ')"
|
||||||
# informational commands without package:
|
log_info "$func:${LINENO}: executed opkg commands"
|
||||||
cwp="${cwp}|list|list-installed|list-upgradable"
|
update_psa_install_opkg_packages $UPDATE_ISMAS_PROGRESS \
|
||||||
|
$RC_SUCCESS "$commands"
|
||||||
if grep -qE "^.*\s+($cwp)\s+.*$" <<< $opkg_c; then
|
|
||||||
local p=$(printf '%s' "$opkg_c" | awk '{ print $NF }')
|
|
||||||
local opkg_output=()
|
|
||||||
if ! exec_opkg_info "$p" opkg_output; then
|
|
||||||
log_error "$func:${LINENO}: opkg info $opkg_c failed"
|
|
||||||
revert_customer_repository ; exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! check_md5_for_opkg_packages opkg_output; then
|
|
||||||
log_error "$func:${LINENO}: "\
|
|
||||||
"wrong md5sum for opkg packages"
|
|
||||||
revert_customer_repository ; exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# perform a dry-run and check if everything might work as expected.
|
|
||||||
if ! exec_opkg_noaction $opkg_c; then
|
|
||||||
log_error "$func:${LINENO}: "\
|
|
||||||
"opkg --noaction $opkg_c failed"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Actually execute the opkg command
|
|
||||||
if ! exec_opkg $opkg_c; then
|
|
||||||
log_error "$func:${LINENO}: exec_opkg $opkg_c failed"
|
|
||||||
fallback_to_previous_version
|
|
||||||
revert_customer_repository ; exit 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
else
|
else
|
||||||
log_info "$func:${LINENO}: no opkg commands to execute"
|
log_info "$func:${LINENO}: no opkg commands to execute"
|
||||||
update_psa_install_opkg_packages $UPDATE_ISMAS_PROGRESS \
|
update_psa_install_opkg_packages $UPDATE_ISMAS_PROGRESS \
|
||||||
$RC_SUCCESS "no opkg commands to execute"
|
$RC_SUCCESS "no opkg commands to execute"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# check if the opkg-command-file has been changed during 'git pull'
|
||||||
|
#if grep -qE ".*opkg_commands.*?" <<< $changed_files; then
|
||||||
|
# # read opkg_cmds: each line respresents an opkg-command
|
||||||
|
# readarray opkg_commands < <(cat $OPKG_CMDS_PSA_FILE)
|
||||||
|
# for opkg_c in "${opkg_commands[@]}"; do
|
||||||
|
# if grep -qE "^\s*[#]+.*$" <<< $opkg_c; then
|
||||||
|
# continue # found comment line
|
||||||
|
# fi
|
||||||
|
|
||||||
|
# # package manipulation commands without package:
|
||||||
|
# local cwp="update|upgrade|clean"
|
||||||
|
# # informational commands without package:
|
||||||
|
# cwp="${cwp}|list|list-installed|list-upgradable"
|
||||||
|
|
||||||
|
# if grep -qE "^.*\s+($cwp)\s+.*$" <<< $opkg_c; then
|
||||||
|
# local p=$(printf '%s' "$opkg_c" | awk '{ print $NF }')
|
||||||
|
# local opkg_output=()
|
||||||
|
# if ! exec_opkg_info "$p" opkg_output; then
|
||||||
|
# log_error "$func:${LINENO}: opkg info $opkg_c failed"
|
||||||
|
# revert_customer_repository ; exit 1
|
||||||
|
# fi
|
||||||
|
|
||||||
|
# if ! check_md5_for_opkg_packages opkg_output; then
|
||||||
|
# log_error "$func:${LINENO}: "\
|
||||||
|
# "wrong md5sum for opkg packages"
|
||||||
|
# revert_customer_repository ; exit 1
|
||||||
|
# fi
|
||||||
|
# fi
|
||||||
|
#
|
||||||
|
# # perform a dry-run and check if everything might work as expected.
|
||||||
|
# if ! exec_opkg_noaction $opkg_c; then
|
||||||
|
# log_error "$func:${LINENO}: "\
|
||||||
|
# "opkg --noaction $opkg_c failed"
|
||||||
|
# fi
|
||||||
|
|
||||||
|
# # Actually execute the opkg command
|
||||||
|
# if ! exec_opkg $opkg_c; then
|
||||||
|
# log_error "$func:${LINENO}: exec_opkg $opkg_c failed"
|
||||||
|
# fallback_to_previous_version
|
||||||
|
# revert_customer_repository ; exit 1
|
||||||
|
# fi
|
||||||
|
# done
|
||||||
|
#else
|
||||||
|
# log_info "$func:${LINENO}: no opkg commands to execute"
|
||||||
|
# update_psa_install_opkg_packages $UPDATE_ISMAS_PROGRESS \
|
||||||
|
# $RC_SUCCESS "no opkg commands to execute"
|
||||||
|
#fi
|
||||||
|
|
||||||
# Cleanup.
|
# Cleanup.
|
||||||
#if ! cleanup_previous_version; then
|
#if ! cleanup_previous_version; then
|
||||||
|
Loading…
Reference in New Issue
Block a user