Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eepm
Commits
aa988408
Commit
aa988408
authored
Apr 10, 2024
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm play common: move update checking to a separate function
parent
742410c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
28 deletions
+34
-28
common.sh
play.d/common.sh
+34
-28
No files found.
play.d/common.sh
View file @
aa988408
...
@@ -306,6 +306,38 @@ is_repacked_packages()
...
@@ -306,6 +306,38 @@ is_repacked_packages()
done
done
}
}
check_for_product_update
()
{
# HACK: check version only by first package (we assume all packages have the same version)
pkgver
=
"
$(
epm print version
for
package
$PKGNAME
|
head
-n1
)
"
latestpkgver
=
"
$(
get_latest_version
$PKGNAME
)
"
# ignore update if have no latest package version or the latest package version no more than installed one
[
-n
"
$pkgver
"
]
||
return
if
[
-z
"
$latestpkgver
"
]
;
then
echo
"Can't get info about latest version of
$PKGNAME
, so skip updating installed version
$pkgver
."
exit
fi
# latestpkgver <= $pkgver
if
[
-z
"
$force
"
]
&&
[
"
$(
epm print compare package version
$latestpkgver
$pkgver
)
"
!=
"1"
]
;
then
if
[
"
$latestpkgver
"
=
"
$pkgver
"
]
;
then
echo
"Latest available version of
$PKGNAME
$latestpkgver
is already installed."
else
echo
"Latest available version of
$PKGNAME
:
$latestpkgver
, but you have a newer version installed:
$pkgver
."
fi
exit
fi
#echo "Updating $PKGNAME from $pkgver to the latest available version (equal to $latestpkgver or newer) ..."
if
[
-n
"
$force
"
]
;
then
echo
"Updating
$PKGNAME
from
$pkgver
to latest available version ..."
else
echo
"Updating
$PKGNAME
from
$pkgver
to
$latestpkgver
version ..."
VERSION
=
"
$latestpkgver
"
fi
}
case
"
$1
"
in
case
"
$1
"
in
"--description"
)
"--description"
)
...
@@ -371,33 +403,7 @@ case "$1" in
...
@@ -371,33 +403,7 @@ case "$1" in
exit
exit
fi
fi
# HACK: check version only by first package (we assume all packages have the same version)
check_for_product_update
pkgver
=
"
$(
epm print version
for
package
$PKGNAME
|
head
-n1
)
"
latestpkgver
=
"
$(
get_latest_version
$PKGNAME
)
"
# ignore update if have no latest package version or the latest package version no more than installed one
if
[
-n
"
$pkgver
"
]
;
then
if
[
-z
"
$latestpkgver
"
]
;
then
echo
"Can't get info about latest version of
$PKGNAME
, so skip updating installed version
$pkgver
."
exit
fi
# latestpkgver <= $pkgver
if
[
-z
"
$force
"
]
&&
[
"
$(
epm print compare package version
$latestpkgver
$pkgver
)
"
!=
"1"
]
;
then
if
[
"
$latestpkgver
"
=
"
$pkgver
"
]
;
then
echo
"Latest available version of
$PKGNAME
$latestpkgver
is already installed."
else
echo
"Latest available version of
$PKGNAME
:
$latestpkgver
, but you have a newer version installed:
$pkgver
."
fi
exit
fi
#echo "Updating $PKGNAME from $pkgver to the latest available version (equal to $latestpkgver or newer) ..."
if
[
-n
"
$force
"
]
;
then
echo
"Updating
$PKGNAME
from
$pkgver
to latest available version ..."
else
echo
"Updating
$PKGNAME
from
$pkgver
to
$latestpkgver
version ..."
VERSION
=
"
$latestpkgver
"
fi
fi
# pass to run play code
# pass to run play code
;;
;;
"--run"
)
"--run"
)
...
@@ -423,7 +429,7 @@ if [ -z "$VERSION" ] && [ -z "$force" ] && [ -n "$EGET_IPFS_DB" ] ; then
...
@@ -423,7 +429,7 @@ if [ -z "$VERSION" ] && [ -z "$force" ] && [ -n "$EGET_IPFS_DB" ] ; then
fi
fi
if
[
-z
"
$VERSION
"
]
&&
[
-z
"
$force
"
]
;
then
if
[
-z
"
$VERSION
"
]
&&
[
-z
"
$force
"
]
;
then
# by default use known version to install
# by default use
latest
known version to install
VERSION
=
"
$(
get_latest_version
$PKGNAME
)
"
VERSION
=
"
$(
get_latest_version
$PKGNAME
)
"
fi
fi
...
...
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