Skip to content

Commit

Permalink
[icaclient] Add icaclient and refactor
Browse files Browse the repository at this point in the history
Resolves: #785
Signed-off-by: Arif Ali <arif.ali@canonical.com>
  • Loading branch information
arif-ali committed Apr 12, 2023
1 parent dd0dff9 commit 27b54cc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
9 changes: 9 additions & 0 deletions 01-main/packages/icaclient
@@ -0,0 +1,9 @@
URL_PRE=$(curl https://www.citrix.com/downloads/workspace-app/ | grep "Citrix Workspace app.*Linux" | sort -r -k 5 | grep -v -i tech | head -n 1 | cut -d'"' -f2)
URL="http:$(curl https://www.citrix.com/${URL_PRE} | grep ctx-dl-lin | cut -d'"' -f10 | grep icaclient.*${HOST_ARCH}.*deb)"
FILE=$(echo "${URL}" | sed 's/.deb?.*/.deb/g')
FILE=${FILE##*/}
VERSION_PUBLISHED="$(echo "${URL}" | cut -d'_' -f 2)"
PRETTY_NAME="Citrix Workspace App"
WEBSITE="https://www.citrix.com/en-gb/downloads/workspace-app/linux"
SUMMARY="Enables users to access virtual desktops and hosted applications delivered by XenDesktop and XenApp."
DEFVER=1
13 changes: 7 additions & 6 deletions deb-get
Expand Up @@ -219,7 +219,7 @@ function fancy_message() {

function download_deb() {
local URL="${1}"
local FILE="${URL##*/}"
local FILE="${2}"

if ! ${ELEVATE} wget --quiet --continue --show-progress --progress=bar:force:noscroll "${URL}" -O "${CACHE_DIR}/${FILE}"; then
fancy_message error "Failed to download ${URL}. Deleting ${CACHE_DIR}/${FILE}..."
Expand Down Expand Up @@ -294,15 +294,15 @@ function install_ppa() {

function install_deb() {
local URL="${1}"
local FILE="${URL##*/}"
local FILE="${FILE:-${URL##*/}}"
local STATUS=""
((PACKAGE_INSTALLATION_TRIES++))

if ! package_is_installed "${APP}"; then
if ! eula; then
return
fi
if ! download_deb "${URL}"; then
if ! download_deb "${URL}" "${FILE}"; then
return
fi
if ! ${ELEVATE} apt-get -q=2 -o Dpkg::Progress-Fancy="1" -y install "${CACHE_DIR}/${FILE}"; then
Expand All @@ -312,14 +312,14 @@ function install_deb() {
maint_supported_cache
else
if [ "${ACTION}" == "reinstall" ]; then
if ! download_deb "${URL}"; then
if ! download_deb "${URL}" "${FILE}"; then
return
fi
if ! ${ELEVATE} apt-get -q=2 -o Dpkg::Progress-Fancy="1" -y --reinstall --allow-downgrades install "${CACHE_DIR}/${FILE}"; then
return
fi
elif dpkg --compare-versions "${VERSION_PUBLISHED}" gt "${VERSION_INSTALLED}"; then
if ! download_deb "${URL}"; then
if ! download_deb "${URL}" "${FILE}"; then
return
fi
if ! ${ELEVATE} apt-get -q=2 -o Dpkg::Progress-Fancy="1" -y install "${CACHE_DIR}/${FILE}"; then
Expand All @@ -340,7 +340,7 @@ function install_deb() {
function remove_deb() {
local APP="${1}"
local REMOVE="${2:-remove}"
local FILE="${URL##*/}"
local FILE="${FILE:-${URL##*/}}"
local STATUS=""

if package_is_installed "${APP}" || [[ " ${DEPRECATED_INSTALLED[*]} " =~ " ${APP} " ]]; then
Expand Down Expand Up @@ -409,6 +409,7 @@ function validate_deb() {
export PRETTY_NAME=""
export SUMMARY=""
export WEBSITE=""
export FILE=""

# Source the variables
if [ "${APP_SRC}" == "00-builtin" ]; then
Expand Down

0 comments on commit 27b54cc

Please sign in to comment.