Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
xnviewmp-install
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
install
xnviewmp-install
Commits
d7f8dffc
Commit
d7f8dffc
authored
Oct 27, 2020
by
Claude
👌🏽
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'QA' into 'master'
QA See merge request
!9
parents
4f01b633
4f760819
Pipeline
#5659
passed with stage
in 12 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
21 deletions
+24
-21
.gitlab-ci.yml
.gitlab-ci.yml
+1
-1
xnviewmp-install.sh
xnviewmp-install.sh
+23
-20
No files found.
.gitlab-ci.yml
View file @
d7f8dffc
#
#
rawtherapee
-install:.gitlab-ci.yml
#
xnviewmp
-install:.gitlab-ci.yml
#
# see https://docs.gitlab.com/ce/ci/yaml/README.html
#
...
...
xnviewmp-install.sh
View file @
d7f8dffc
...
...
@@ -17,12 +17,14 @@ function usage {
Install XnViewMP on Mint for Debian based linux.
Usage:
$(
basename
"
$0
"
)
--help
$(
basename
"
$0
"
)
--list
$(
basename
"
$0
"
)
--list-fullname
$(
basename
"
$0
"
)
--install [--home DIR] [--version VER|--last-default-version]
Actions
Actions:
-h, --help Display this message and exit.
-l, --list List version number available on server
--list-fullname
...
...
@@ -33,6 +35,7 @@ Actions
If you dont run command using root, then sudo will be use.
Options:
--home DIR Set download directory
(default value: '
$(
compute_DEFAULT_DEB_FILES_INSTALL_HOME
)
')
-V VER, --version VER
...
...
@@ -46,7 +49,7 @@ EOF
# P: get_required_next_param
# Usage: varname="$( P "$@" )" && shift
function
P
{
if
[
[
$#
-gt
0
]
]
&&
!
[[
"
$1
"
=
~ ^--.
*
]]
;
then
if
[
"$#"
-gt
0
]
&&
!
[[
"
$1
"
=
~ ^--.
*
]]
;
then
echo
"
$1
"
return
0
fi
...
...
@@ -156,14 +159,14 @@ function remove_xnview {
function
update_or_install_nxview_if_needed
{
local
-r
url
=
"
$1
"
local
-r
download_directory
=
"
$2
"
local
-r
param_
download_directory
=
"
$2
"
local
-r
local_filename
=
"
$3
"
if
[
!
-d
"
${
download_directory
}
"
]
;
then
${
SUDO_IF_NEEDED
}
mkdir
-p
"
${
download_directory
}
"
if
[
!
-d
"
${
param_
download_directory
}
"
]
;
then
${
SUDO_IF_NEEDED
}
mkdir
-p
"
${
param_
download_directory
}
"
fi
pushd
"
${
download_directory
}
"
>
/dev/null
||
exit
1
pushd
"
${
param_
download_directory
}
"
>
/dev/null
||
exit
1
if
[
-f
"
${
local_filename
}
"
]
;
then
echo
"File '
$(
realpath
"
${
local_filename
}
"
)
' already present, skip download."
>
&2
||
exit
1
...
...
@@ -237,7 +240,7 @@ function download_and_install_if_needed {
nxview_arch="
$(
get_arch_for_xnview
)
" || exit 1
case "
${
nxview_version
}
" in
case "
${
param_
nxview_version
}
" in
'currentlast')
local tag= # no version in filename, use download date to have new name (so file will be downloaded and install at every run).
...
...
@@ -252,7 +255,7 @@ function download_and_install_if_needed {
;;
*)
local -r fullversion="
${
nxview_version
}
-linux
${
nxview_arch
}
" # 090-linux-x64
local -r fullversion="
${
param_
nxview_version
}
-linux
${
nxview_arch
}
" # 090-linux-x64
filename="
$(
build_output_filename
''
"
${
fullversion
}
"
)
" || exit 1
url="
$(
get_specific_xnviewmp_version
"
${
fullversion
}
"
)
"
...
...
@@ -261,18 +264,18 @@ function download_and_install_if_needed {
update_or_install_nxview_if_needed
\
"
${
url
}
"
\
"
${
download_directory
:-
$(
compute_DEFAULT_DEB_FILES_INSTALL_HOME
)
}
"
\
"
${
param_
download_directory
:-
$(
compute_DEFAULT_DEB_FILES_INSTALL_HOME
)
}
"
\
"
${
filename
}
" || exit 1
}
function main {
local url=
local download_directory=
local nxview_version='latest'
local action='--install'
local param_download_directory=
local param_nxview_version='latest'
local param=
while [
$#
-gt 0 ] ; do
local
param="
$1
"
while [
"
$#"
-gt
0
]
;
do
param
=
"
$1
"
shift
case
"
${
param
}
"
in
...
...
@@ -295,26 +298,26 @@ function main {
'-i'
|
'--install'
)
action
=
'--install'
;;
'--home'
)
download_directory="
$(
P
"
$@
"
)
" && shift
param_
download_directory
=
"
$(
P
"
$@
"
)
"
&&
shift
;;
'-V'
|
'--version'
)
nxview_version="
$(
P
"
$@
"
)
" && shift
param_
nxview_version
=
"
$(
P
"
$@
"
)
"
&&
shift
;;
'-L0'
|
'--last-default-version'
)
nxview_version='currentlast'
param_
nxview_version
=
'currentlast'
;;
*)
# unknown option
echo "
Un
defined parameter
'${param}'
.
" >&2
*
)
echo
"Un
known option:
'
${
param
}
'."
>
&2
usage
>
&2
exit
1
;;
esac
done
if [ -z "
${
nxview_version
}
" ] ; then
if
[
-z
"
${
param_
nxview_version
}
"
]
;
then
echo
'A version number is expected when using option --version.'
>
&2
usage
>
&2
exit
1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment