Commit 675c1be6 authored by Vitaly Lipatov's avatar Vitaly Lipatov

fix epm repo --help

parent a4fc45b0
...@@ -259,7 +259,7 @@ check_command() ...@@ -259,7 +259,7 @@ check_command()
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
;; ;;
removerepo|rr) # HELPCMD: remove package repo removerepo|rr) # HELPCMD: remove package repo (shortcut for epm repo remove)
epm_cmd=removerepo epm_cmd=removerepo
;; ;;
repo) # HELPCMD: manipulate with repository list (run epm repo --help to help) repo) # HELPCMD: manipulate with repository list (run epm repo --help to help)
......
...@@ -22,22 +22,6 @@ __check_command_in_path() ...@@ -22,22 +22,6 @@ __check_command_in_path()
PATH=$PATH:/sbin:/usr/sbin which "$1" 2>/dev/null PATH=$PATH:/sbin:/usr/sbin which "$1" 2>/dev/null
} }
# copied from strings
# CHECKME: the same like estrlist has ?
# Note: used egrep! write '[0-9]+(first|two)', not '[0-9]\+...'
rhas()
{
echo "$1" | grep -E -q -- "$2"
}
# copied from strings
is_dirpath()
{
[ "$1" = "." ] && return $?
rhas "$1" "/"
}
__epm_need_update() __epm_need_update()
{ {
local PACKAGE="$1" local PACKAGE="$1"
......
...@@ -26,7 +26,7 @@ epm_repo() ...@@ -26,7 +26,7 @@ epm_repo()
shift shift
case $CMD in case $CMD in
"-h"|"--help"|help) # HELPCMD: help "-h"|"--help"|help) # HELPCMD: help
get_help HELPCMD epm-repo get_help HELPCMD $SHAREDIR/epm-repo
;; ;;
""|list) # HELPCMD: list packages ""|list) # HELPCMD: list packages
load_helper epm-repolist load_helper epm-repolist
......
...@@ -181,6 +181,21 @@ isnumber() ...@@ -181,6 +181,21 @@ isnumber()
echo "$*" | filter_strip_spaces | grep -q "^[0-9]\+$" echo "$*" | filter_strip_spaces | grep -q "^[0-9]\+$"
} }
# copied from strings
# CHECKME: the same like estrlist has ?
# Note: used egrep! write '[0-9]+(first|two)', not '[0-9]\+...'
rhas()
{
echo "$1" | grep -E -q -- "$2"
}
# copied from strings
is_dirpath()
{
[ "$1" = "." ] && return $?
rhas "$1" "/"
}
filter_strip_spaces() filter_strip_spaces()
{ {
# possible use just # possible use just
...@@ -452,7 +467,9 @@ get_help() ...@@ -452,7 +467,9 @@ get_help()
return return
fi fi
local F="$0" local F="$0"
[ -n "$2" ] && F="$(dirname $0)/$2" if [ -n "$2" ] ; then
is_dirpath "$2" && F="$2" || F="$(dirname $0)/$2"
fi
cat "$F" | grep -- "# $1" | while read -r n ; do cat "$F" | grep -- "# $1" | while read -r n ; do
if echo "$n" | grep -q "# $1: PART: " ; then if echo "$n" | grep -q "# $1: PART: " ; then
......
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