1
0
mirror of https://github.com/j-a-n/raspberrymatic-addon-rmupdate.git synced 2023-10-10 11:37:40 +00:00

Upload and install addon from file

This commit is contained in:
Jan Schneider
2018-01-29 00:04:12 +01:00
parent d3b87c5dfc
commit 6fa4ba262e
3 changed files with 119 additions and 44 deletions

View File

@@ -971,14 +971,19 @@ proc ::rmupdate::install_addon {{addon_id ""} {download_url ""}} {
set_running_installation "Addon ${addon_id}"
write_log 3 "Downloading addon from ${download_url}."
set archive_file "/tmp/${addon_id}.tar.gz"
if {[file exists $archive_file]} {
file delete $archive_file
set archive_file ""
regexp {^file://(.*)$} $download_url match archive_file
if { [info exists archive_file] && $archive_file != "" } {
write_log 3 "Installing addon from local file ${archive_file}."
} else {
write_log 3 "Downloading addon from ${download_url}."
set archive_file "/tmp/${addon_id}.tar.gz"
if {[file exists $archive_file]} {
file delete $archive_file
}
exec /usr/bin/wget "${download_url}" --no-check-certificate --quiet --output-document=$archive_file
}
exec /usr/bin/wget "${download_url}" --no-check-certificate --quiet --output-document=$archive_file
write_log 3 "Extracting archive ${archive_file}."
set tmp_dir "/tmp/rmupdate_addon_install_${addon_id}"
if {[file exists $tmp_dir]} {