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
1170c4ac
Commit
1170c4ac
authored
Apr 26, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm install: separate code for print only command (--show-command-only)
parent
e120bd24
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
143 additions
and
121 deletions
+143
-121
epm-install
bin/epm-install
+2
-121
epm-install-print-command
bin/epm-install-print-command
+141
-0
No files found.
bin/epm-install
View file @
1170c4ac
...
...
@@ -564,126 +564,6 @@ epm_install_files()
epm_install_names
$files
}
epm_print_install_command
()
{
# print out low level command by default (wait --low-level for control it)
#[ -z "$1" ] && return
[
-z
"
$1
"
]
&&
[
-n
"
$pkg_names
"
]
&&
return
case
$PMTYPE
in
*
-rpm
)
echo
"rpm -Uvh --force
$nodeps
$*
"
;;
*
-dpkg
)
echo
"dpkg -i
$*
"
;;
pkgsrc
)
echo
"pkg_add
$*
"
;;
pkgng
)
echo
"pkg add
$*
"
;;
emerge
)
# need be placed in /usr/portage/packages/somewhere
echo
"emerge --usepkg
$*
"
;;
pacman
)
echo
"pacman -U --noconfirm
$nodeps
$*
"
;;
slackpkg
)
echo
"/sbin/installpkg
$*
"
;;
npackd
)
echo
"npackdcl add --package=
$*
"
;;
opkg
)
echo
"opkg install
$*
"
;;
eopkg
)
echo
"eopkg install
$*
"
;;
android
)
echo
"pm install
$*
"
;;
termux-pkg
)
echo
"pkg install
$*
"
;;
aptcyg
)
echo
"apt-cyg install
$*
"
;;
tce
)
echo
"tce-load -wi
$*
"
;;
xbps
)
echo
"xbps-install -y
$*
"
;;
appget|winget
)
echo
"
$PMTYPE
install -s
$*
"
;;
homebrew
)
# FIXME: sudo and quote
echo
"brew install
$*
"
;;
*
)
fatal
"Have no suitable appropriate install command for
$PMTYPE
"
;;
esac
}
epm_print_install_names_command
()
{
# check for pkg_files to support print out command without pkg names in args
#[ -z "$1" ] && [ -n "$pkg_files" ] && return
[
-z
"
$1
"
]
&&
return
case
$PMTYPE
in
apt-rpm
)
echo
"apt-get -y --force-yes -o APT::Install::VirtualVersion=true -o APT::Install::Virtual=true
$APTOPTIONS
install
$*
"
return
;;
apt-dpkg
)
# this command not for complex use. ACCEPT_EULA=y DEBIAN_FRONTEND=noninteractive
echo
"apt-get -y --force-yes -o APT::Install::VirtualVersion=true -o APT::Install::Virtual=true
$APTOPTIONS
install
$*
"
return
;;
aptitude-dpkg
)
echo
"aptitude -y install
$*
"
return
;;
yum-rpm
)
echo
"yum -y
$YUMOPTIONS
install
$*
"
return
;;
dnf-rpm
)
echo
"dnf -y
$YUMOPTIONS
--allowerasing install
$*
"
return
;;
urpm-rpm
)
echo
"urpmi --auto
$URPMOPTIONS
$*
"
return
;;
zypper-rpm
)
echo
"zypper --non-interactive
$ZYPPEROPTIONS
install
$*
"
return
;;
packagekit
)
echo
"pkcon --noninteractive
$*
"
return
;;
pacman
)
echo
"pacman -S --noconfirm
$*
"
return
;;
choco
)
echo
"choco install
$*
"
return
;;
nix
)
echo
"nix-env --install
$*
"
return
;;
eopkg
)
echo
"eopkg install
$*
"
return
;;
termux-pkg
)
echo
"pkg install
$*
"
return
;;
appget|winget
)
echo
"
$PMTYPE
install
$*
"
return
;;
*
)
fatal
"Have no suitable appropriate install command for
$PMTYPE
"
;;
esac
}
# apt-repo with non_interactive support
apt_repo_prepare
()
...
...
@@ -719,7 +599,8 @@ epm_install()
if
[
-n
"
$show_command_only
"
]
;
then
# TODO: handle pkg_urls too
epm_print_install_command
$pkg_files
load_helper epm-install-print-command
epm_print_install_files_command
$pkg_files
epm_print_install_names_command
$pkg_names
return
fi
...
...
bin/epm-install-print-command
0 → 100644
View file @
1170c4ac
#!/bin/sh
#
# Copyright (C) 2012-2020 Etersoft
# Copyright (C) 2012-2020 Vitaly Lipatov <lav@etersoft.ru>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
epm_print_install_files_command
()
{
# print out low level command by default (wait --low-level for control it)
#[ -z "$1" ] && return
[
-z
"
$1
"
]
&&
[
-n
"
$pkg_names
"
]
&&
return
case
$PMTYPE
in
*
-rpm
)
echo
"rpm -Uvh --force
$nodeps
$*
"
;;
*
-dpkg
)
echo
"dpkg -i
$*
"
;;
pkgsrc
)
echo
"pkg_add
$*
"
;;
pkgng
)
echo
"pkg add
$*
"
;;
emerge
)
# need be placed in /usr/portage/packages/somewhere
echo
"emerge --usepkg
$*
"
;;
pacman
)
echo
"pacman -U --noconfirm
$nodeps
$*
"
;;
slackpkg
)
echo
"/sbin/installpkg
$*
"
;;
npackd
)
echo
"npackdcl add --package=
$*
"
;;
opkg
)
echo
"opkg install
$*
"
;;
eopkg
)
echo
"eopkg install
$*
"
;;
android
)
echo
"pm install
$*
"
;;
termux-pkg
)
echo
"pkg install
$*
"
;;
aptcyg
)
echo
"apt-cyg install
$*
"
;;
tce
)
echo
"tce-load -wi
$*
"
;;
xbps
)
echo
"xbps-install -y
$*
"
;;
appget|winget
)
echo
"
$PMTYPE
install -s
$*
"
;;
homebrew
)
# FIXME: sudo and quote
echo
"brew install
$*
"
;;
*
)
fatal
"Have no suitable appropriate install command for
$PMTYPE
"
;;
esac
}
epm_print_install_names_command
()
{
# check for pkg_files to support print out command without pkg names in args
#[ -z "$1" ] && [ -n "$pkg_files" ] && return
[
-z
"
$1
"
]
&&
return
case
$PMTYPE
in
apt-rpm
)
echo
"apt-get -y --force-yes -o APT::Install::VirtualVersion=true -o APT::Install::Virtual=true
$APTOPTIONS
install
$*
"
return
;;
apt-dpkg
)
# this command not for complex use. ACCEPT_EULA=y DEBIAN_FRONTEND=noninteractive
echo
"apt-get -y --force-yes -o APT::Install::VirtualVersion=true -o APT::Install::Virtual=true
$APTOPTIONS
install
$*
"
return
;;
aptitude-dpkg
)
echo
"aptitude -y install
$*
"
return
;;
yum-rpm
)
echo
"yum -y
$YUMOPTIONS
install
$*
"
return
;;
dnf-rpm
)
echo
"dnf -y
$YUMOPTIONS
--allowerasing install
$*
"
return
;;
urpm-rpm
)
echo
"urpmi --auto
$URPMOPTIONS
$*
"
return
;;
zypper-rpm
)
echo
"zypper --non-interactive
$ZYPPEROPTIONS
install
$*
"
return
;;
packagekit
)
echo
"pkcon --noninteractive
$*
"
return
;;
pacman
)
echo
"pacman -S --noconfirm
$*
"
return
;;
choco
)
echo
"choco install
$*
"
return
;;
nix
)
echo
"nix-env --install
$*
"
return
;;
eopkg
)
echo
"eopkg install
$*
"
return
;;
termux-pkg
)
echo
"pkg install
$*
"
return
;;
appget|winget
)
echo
"
$PMTYPE
install
$*
"
return
;;
*
)
fatal
"Have no suitable appropriate install command for
$PMTYPE
"
;;
esac
}
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