Commit a602a579 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm: mark commands with direct args: no pkg_* vars will filled

parent 135a696b
...@@ -105,6 +105,7 @@ pkg_dirs= ...@@ -105,6 +105,7 @@ pkg_dirs=
pkg_names= pkg_names=
pkg_urls= pkg_urls=
quoted_args= quoted_args=
direct_args=
# load system wide config # load system wide config
[ -f /etc/eepm/eepm.conf ] && . /etc/eepm/eepm.conf [ -f /etc/eepm/eepm.conf ] && . /etc/eepm/eepm.conf
...@@ -152,9 +153,11 @@ case $PROGNAME in ...@@ -152,9 +153,11 @@ case $PROGNAME in
;; ;;
epmrl) # HELPSHORT: alias for epm repo list epmrl) # HELPSHORT: alias for epm repo list
epm_cmd=repolist epm_cmd=repolist
direct_args=1
;; ;;
epmu) # HELPSHORT: alias for epm update epmu) # HELPSHORT: alias for epm update
epm_cmd=update epm_cmd=update
direct_args=1
;; ;;
epm|upm|eepm) # HELPSHORT: other aliases for epm command epm|upm|eepm) # HELPSHORT: other aliases for epm command
;; ;;
...@@ -210,15 +213,18 @@ check_command() ...@@ -210,15 +213,18 @@ check_command()
;; ;;
check|fix|verify) # HELPCMD: check local package base integrity and fix it check|fix|verify) # HELPCMD: check local package base integrity and fix it
epm_cmd=check epm_cmd=check
direct_args=1
;; ;;
dedup) # HELPCMD: remove unallowed duplicated pkgs (after upgrade crash) dedup) # HELPCMD: remove unallowed duplicated pkgs (after upgrade crash)
epm_cmd=dedup epm_cmd=dedup
direct_args=1
;; ;;
-cl|cl|changelog) # HELPCMD: show changelog for package -cl|cl|changelog) # HELPCMD: show changelog for package
epm_cmd=changelog epm_cmd=changelog
;; ;;
-qi|qi|info|show) # HELPCMD: print package detail info -qi|qi|info|show) # HELPCMD: print package detail info
epm_cmd=info epm_cmd=info
direct_args=1
;; ;;
requires|deplist|depends|req|depends-on) # HELPCMD: print package requires requires|deplist|depends|req|depends-on) # HELPCMD: print package requires
epm_cmd=requires epm_cmd=requires
...@@ -240,6 +246,7 @@ check_command() ...@@ -240,6 +246,7 @@ check_command()
;; ;;
programs) # HELPCMD: print list of installed GUI program(s) (they have .desktop files) programs) # HELPCMD: print list of installed GUI program(s) (they have .desktop files)
epm_cmd=programs epm_cmd=programs
direct_args=1
;; ;;
assure) # HELPCMD: <command> [package] [version]: install package if command does not exist assure) # HELPCMD: <command> [package] [version]: install package if command does not exist
epm_cmd=assure epm_cmd=assure
...@@ -251,44 +258,56 @@ check_command() ...@@ -251,44 +258,56 @@ check_command()
# HELPCMD: PART: Repository control: # HELPCMD: PART: Repository control:
update) # HELPCMD: update remote package repository databases update) # HELPCMD: update remote package repository databases
epm_cmd=update epm_cmd=update
direct_args=1
;; ;;
addrepo|ar) # HELPCMD: add package repo (etersoft, autoimports, archive 2017/12/31); run with param to get list addrepo|ar) # HELPCMD: add package repo (etersoft, autoimports, archive 2017/12/31); run with param to get list
epm_cmd=addrepo epm_cmd=addrepo
direct_args=1
;; ;;
repolist|sl|rl|listrepo|repo-list) # HELPCMD: print repo list repolist|sl|rl|listrepo|repo-list) # HELPCMD: print repo list
epm_cmd=repolist epm_cmd=repolist
direct_args=1
;; ;;
repofix) # HELPCMD: <mirror>: fix paths in sources lists (ALT Linux only). use repofix etersoft/yandex/basealt for rewrite URL to the specified server repofix) # HELPCMD: <mirror>: fix paths in sources lists (ALT Linux only). use repofix etersoft/yandex/basealt for rewrite URL to the specified server
epm_cmd=repofix epm_cmd=repofix
direct_args=1
;; ;;
removerepo|rr) # HELPCMD: remove package repo (shortcut for epm repo remove) removerepo|rr) # HELPCMD: remove package repo (shortcut for epm repo remove)
epm_cmd=removerepo epm_cmd=removerepo
direct_args=1
;; ;;
repo) # HELPCMD: manipulate with repository list (run epm repo --help to help) repo) # HELPCMD: manipulate with repository list (run epm repo --help to help)
epm_cmd=repo epm_cmd=repo
direct_args=1
;; ;;
full-upgrade) # HELPCMD: update all system packages and kernel full-upgrade) # HELPCMD: update all system packages and kernel
epm_cmd=full_upgrade epm_cmd=full_upgrade
direct_args=1
;; ;;
release-upgrade|upgrade-release|upgrade-system|release-switch|release-downgrade) # HELPCMD: upgrade/switch whole system to the release in arg (default: next (latest) release) release-upgrade|upgrade-release|upgrade-system|release-switch|release-downgrade) # HELPCMD: upgrade/switch whole system to the release in arg (default: next (latest) release)
epm_cmd=release_upgrade epm_cmd=release_upgrade
direct_args=1
;; ;;
kernel-update|kernel-upgrade|update-kernel|upgrade-kernel) # HELPCMD: update system kernel to the last repo version kernel-update|kernel-upgrade|update-kernel|upgrade-kernel) # HELPCMD: update system kernel to the last repo version
epm_cmd=kernel_update epm_cmd=kernel_update
direct_args=1
;; ;;
remove-old-kernels|remove-old-kernel) # HELPCMD: remove old system kernels (exclude current or last two kernels) remove-old-kernels|remove-old-kernel) # HELPCMD: remove old system kernels (exclude current or last two kernels)
epm_cmd=remove_old_kernels epm_cmd=remove_old_kernels
direct_args=1
;; ;;
# HELPCMD: PART: Other commands: # HELPCMD: PART: Other commands:
clean) # HELPCMD: clean local package cache clean) # HELPCMD: clean local package cache
epm_cmd=clean epm_cmd=clean
direct_args=1
;; ;;
restore) # HELPCMD: install (restore) packages need for the project (f.i. by requirements.txt) restore) # HELPCMD: install (restore) packages need for the project (f.i. by requirements.txt)
epm_cmd=restore epm_cmd=restore
;; ;;
autoremove|package-cleanup) # HELPCMD: auto remove unneeded package(s) Supports args for ALT: [--direct [libs|python|perl|libs-devel]] autoremove|package-cleanup) # HELPCMD: auto remove unneeded package(s) Supports args for ALT: [--direct [libs|python|perl|libs-devel]]
epm_cmd=autoremove epm_cmd=autoremove
direct_args=1
;; ;;
mark) # HELPCMD: mark package as manually or automatically installed (see epm mark --help) mark) # HELPCMD: mark package as manually or automatically installed (see epm mark --help)
epm_cmd=mark epm_cmd=mark
...@@ -298,12 +317,15 @@ check_command() ...@@ -298,12 +317,15 @@ check_command()
;; ;;
upgrade|dist-upgrade) # HELPCMD: performs upgrades of package software distributions upgrade|dist-upgrade) # HELPCMD: performs upgrades of package software distributions
epm_cmd=upgrade epm_cmd=upgrade
direct_args=1
;; ;;
Upgrade) # HELPCMD: force update package base, then run upgrade Upgrade) # HELPCMD: force update package base, then run upgrade
epm_cmd=Upgrade epm_cmd=Upgrade
direct_args=1
;; ;;
downgrade) # HELPCMD: downgrade [all] packages to the repo state downgrade) # HELPCMD: downgrade [all] packages to the repo state
epm_cmd=downgrade epm_cmd=downgrade
direct_args=1
;; ;;
download) # HELPCMD: download package(s) file to the current dir download) # HELPCMD: download package(s) file to the current dir
epm_cmd=download epm_cmd=download
...@@ -314,9 +336,11 @@ check_command() ...@@ -314,9 +336,11 @@ check_command()
;; ;;
audit) # HELPCMD: audits installed packages against known vulnerabilities audit) # HELPCMD: audits installed packages against known vulnerabilities
epm_cmd=audit epm_cmd=audit
direct_args=1
;; ;;
#checksystem) # HELPCMD: check system for known errors (package management related) #checksystem) # HELPCMD: check system for known errors (package management related)
# epm_cmd=checksystem # epm_cmd=checksystem
# direct_args=1
# ;; # ;;
site|url) # HELPCMD: open package's site in a browser (use -p for open packages.altlinux.org site) site|url) # HELPCMD: open package's site in a browser (use -p for open packages.altlinux.org site)
epm_cmd=site epm_cmd=site
...@@ -326,15 +350,18 @@ check_command() ...@@ -326,15 +350,18 @@ check_command()
;; ;;
print) # HELPCMD: print various info, run epm print help for details print) # HELPCMD: print various info, run epm print help for details
epm_cmd=print epm_cmd=print
direct_args=1
;; ;;
repack) # HELPCMD: repack rpm to local compatibility repack) # HELPCMD: repack rpm to local compatibility
epm_cmd=repack epm_cmd=repack
;; ;;
prescription|recipe) # HELPCMD: run prescription (a script to achieving the goal), run without args to get list prescription|recipe) # HELPCMD: run prescription (a script to achieving the goal), run without args to get list
epm_cmd=prescription epm_cmd=prescription
direct_args=1
;; ;;
play) # HELPCMD: install the application from the official site (run without args to get list) play) # HELPCMD: install the application from the official site (run without args to get list)
epm_cmd=play epm_cmd=play
direct_args=1
;; ;;
-V|checkpkg|integrity) # HELPCMD: check package file integrity (checksum) -V|checkpkg|integrity) # HELPCMD: check package file integrity (checksum)
epm_cmd=checkpkg epm_cmd=checkpkg
...@@ -447,12 +474,18 @@ for opt in $EPM_OPTIONS ; do ...@@ -447,12 +474,18 @@ for opt in $EPM_OPTIONS ; do
done done
FLAGENDOPTS= FLAGENDOPTS=
# NOTE: can't use while read here: set vars inside
for opt in "$@" ; do for opt in "$@" ; do
[ "$opt" = "--" ] && FLAGENDOPTS=1 && continue [ "$opt" = "--" ] && FLAGENDOPTS=1 && continue
if [ -z "$FLAGENDOPTS" ] ; then if [ -z "$FLAGENDOPTS" ] ; then
check_command "$opt" && continue check_command "$opt" && continue
check_option "$opt" && continue check_option "$opt" && continue
fi fi
if [ -n "$direct_args" ] ; then
quoted_args="$quoted_args \"$opt\""
FLAGENDOPTS=1
continue
fi
# Note: will parse all params separately (no package names with spaces!) # Note: will parse all params separately (no package names with spaces!)
check_filenames "$opt" check_filenames "$opt"
done done
......
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