Commit 05d85c8c authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm play.d/common.sh: fix --force to override the same version

parent 6afd5b20
#!/bin/sh #!/bin/sh
# kind of hack: inheritance --force from main epm
echo "$EPM_OPTIONS" | grep -q -- "--force" && force="--force"
fatal() fatal()
{ {
echo "FATAL: $*" >&2 echo "FATAL: $*" >&2
...@@ -119,28 +122,29 @@ case "$1" in ...@@ -119,28 +122,29 @@ case "$1" in
exit exit
fi fi
# latestpkgver <= $pkgver # latestpkgver <= $pkgver
if [ "$(epm print compare package version $latestpkgver $pkgver)" != "1" ] ; then if [ -z "$force" ] && [ "$(epm print compare package version $latestpkgver $pkgver)" != "1" ] ; then
echo "Latest available version of $PKGNAME: $latestpkgver. Installed version: $pkgver." echo "Latest available version of $PKGNAME: $latestpkgver. Installed version: $pkgver."
exit exit
fi fi
# kind of hack if [ -n "$force" ] ; then
if echo "$EPM_OPTIONS" | grep -q -- "--force" ; then
echo "Updating $PKGNAME from $pkgver to latest available version ..." echo "Updating $PKGNAME from $pkgver to latest available version ..."
else else
echo "Updating $PKGNAME from $pkgver to $latestpkgver version ..." echo "Updating $PKGNAME from $pkgver to $latestpkgver version ..."
VERSION="$latestpkgver" VERSION="$latestpkgver"
fi fi
fi fi
# pass to run play code
;; ;;
"--run") "--run")
# just pass # just pass to run play code
;; ;;
*) *)
fatal "Unknown command '$1'. Use this script only via epm play." fatal "Unknown command '$1'. Use this script only via epm play."
;; ;;
esac esac
# --update/--run
# support direct run the script # support direct run the script
if [ -x "../bin/epm" ] ; then if [ -x "../bin/epm" ] ; then
...@@ -185,8 +189,7 @@ is_repacked_package() ...@@ -185,8 +189,7 @@ is_repacked_package()
epm status --installed $pkg || return 0 epm status --installed $pkg || return 0
# kind of hack [ -n "$force" ] && return 0
echo "$EPM_OPTIONS" | grep -q -- "--force" && return
if epm status --original $pkg ; then if epm status --original $pkg ; then
echo "Package $pkg is already installed from ALT repository." echo "Package $pkg is already installed from ALT repository."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment