Commit 94fe0c77 authored by Vitaly Lipatov's avatar Vitaly Lipatov

commit packed 3.64.14

parent adc79b30
...@@ -34,7 +34,7 @@ SHAREDIR="$PROGDIR" ...@@ -34,7 +34,7 @@ SHAREDIR="$PROGDIR"
# will replaced with /etc/eepm during install # will replaced with /etc/eepm during install
CONFIGDIR="$PROGDIR/../etc" CONFIGDIR="$PROGDIR/../etc"
export EPMVERSION="3.64.13" export EPMVERSION="3.64.14"
# package, single (file), pipe, git # package, single (file), pipe, git
EPMMODE="package" EPMMODE="package"
...@@ -1166,24 +1166,6 @@ __epm_addrepo_rhel() ...@@ -1166,24 +1166,6 @@ __epm_addrepo_rhel()
return 0 return 0
} }
__epm_addrepo_etersoft_addon()
{
epm install --skip-installed apt-conf-etersoft-common apt-conf-etersoft-hold || fatal
# TODO: ignore only error code 22 (skipped) || fatal
local pb="$DISTRVERSION/branch"
[ "$DISTRVERSION" = "Sisyphus" ] && pb="$DISTRVERSION"
# FIXME
[ -n "$DISTRVERSION" ] || fatal "Empty DISTRVERSION"
docmd epm repo add "rpm [etersoft] $ETERSOFTPUBURL/Etersoft LINUX@Etersoft/$pb/noarch addon"
docmd epm repo add "rpm [etersoft] $ETERSOFTPUBURL/Etersoft LINUX@Etersoft/$pb/$DISTRARCH addon"
if [ "$DISTRARCH" = "x86_64" ] ; then
docmd epm repo add "rpm [etersoft] $ETERSOFTPUBURL/Etersoft LINUX@Etersoft/$pb/x86_64-i586 addon"
fi
}
__get_sign() __get_sign()
{ {
local repo="$1" local repo="$1"
...@@ -1205,16 +1187,20 @@ get_archlist() ...@@ -1205,16 +1187,20 @@ get_archlist()
esac esac
} }
normalize_date()
{
echo "$1" | sed -e 's|-|/|g' | grep -E "^20[0-3][0-9]/[01][0-9]/[0-3][0-9]$" || fatal "use follow date format: 2017/01/31 or 2017-01-31"
}
__epm_addrepo_add_alt_repo() __epm_addrepo_add_alt_repo()
{ {
local branch="$1" local branch="$1"
local repourl="$2" local repourl="$2"
local comp="$3" local comp="$3"
local sign local sign="$4"
sign="$(__get_sign $repo)" [ -n "$sign" ] || sign="$(__get_sign $branch)"
[ -n "$comp" ] || comp="classic"
[ -n "$comp" ] | comp="classic"
local i local i
for i in $(get_archlist) ; do for i in $(get_archlist) ; do
...@@ -1223,6 +1209,19 @@ __epm_addrepo_add_alt_repo() ...@@ -1223,6 +1209,19 @@ __epm_addrepo_add_alt_repo()
} }
__epm_addrepo_etersoft_addon()
{
epm install --skip-installed apt-conf-etersoft-common apt-conf-etersoft-hold || fatal
# TODO: ignore only error code 22 (skipped) || fatal
local repo="$1"
local repopart
[ "$repo" = "sisyphus" ] && repopart="Sisyphus" || repopart="$repo/branch"
__epm_addrepo_add_alt_repo "$repo" "$ETERSOFTPUBURL/Etersoft LINUX@Etersoft/$repopart" "addon"
}
__epm_addrepo_main_alt_repo() __epm_addrepo_main_alt_repo()
{ {
local repo="$1" local repo="$1"
...@@ -1238,14 +1237,14 @@ __epm_addrepo_main_alt_repo() ...@@ -1238,14 +1237,14 @@ __epm_addrepo_main_alt_repo()
__epm_addrepo_altlinux_short() __epm_addrepo_altlinux_short()
{ {
[ -n "$1" ] || fatal "only for rpm repo" [ "$1" = "rpm" ] || fatal "only for rpm repo"
local url="$2" local url="$2"
local REPO_NAME="$3" local repo="$3"
local arch local arch
arch="$(basename "$url")" arch="$(basename "$url")"
url="$(dirname "$url")" url="$(dirname "$url")"
docmd epm repo add "rpm $url $arch $REPO_NAME" docmd epm repo add "rpm $url $arch $repo"
} }
...@@ -1254,6 +1253,7 @@ __epm_addrepo_altlinux_url() ...@@ -1254,6 +1253,7 @@ __epm_addrepo_altlinux_url()
local url="$1" local url="$1"
local arch local arch
local base local base
local repo
# apt supports 302 redirect only since apt 0.7.21 (14th April 2009) # apt supports 302 redirect only since apt 0.7.21 (14th April 2009)
url="$(eget --get-real-url $url)" url="$(eget --get-real-url $url)"
...@@ -1261,9 +1261,9 @@ __epm_addrepo_altlinux_url() ...@@ -1261,9 +1261,9 @@ __epm_addrepo_altlinux_url()
# URL to path/RPMS.addon # URL to path/RPMS.addon
base="$(basename "$url")" base="$(basename "$url")"
if echo "$base" | grep -q "^RPMS\." ; then if echo "$base" | grep -q "^RPMS\." ; then
REPO_NAME="$(echo $base | sed -e 's|.*\.||')" repo="$(echo $base | sed -e 's|.*\.||')"
url="$(dirname $url)" url="$(dirname $url)"
__epm_addrepo_altlinux_short rpm "$url" "$REPO_NAME" __epm_addrepo_altlinux_short rpm "$url" "$repo"
return return
fi fi
...@@ -1320,22 +1320,35 @@ Examples: ...@@ -1320,22 +1320,35 @@ Examples:
return return
} }
__epm_addrepo_apt() __add_line_to_file()
{ {
local file="$1"
local line="$2"
local sc="sudocmd"
[ -n "$verbose" ] || sc="sudorun"
# add empty line if needed
[ -z "$(tail -n1 "$file")" ] || echo "" | $sc tee -a "$file" >/dev/null
echo "$line" | $sc tee -a "$file" >/dev/null
}
__epm_addrepo_to_file()
{
local file="$1"
shift
local repo="$*" local repo="$*"
epm --quiet repo list | grep -q -F "$repo" && return 0 if [ -z "$force" ] ; then
# skip if repo is already in the list
epm --quiet repo list "$repo" >/dev/null && return
fi
if [ -n "$dryrun" ] ; then if [ -n "$dryrun" ] ; then
echo "$repo" echo "$repo"
return return
fi fi
local sc="sudocmd" __add_line_to_file "$file" "$repo"
[ -z "$quiet" ] || sc="sudorun"
[ -z "$(tail -n1 /etc/apt/sources.list)" ] || echo "" | $sc tee -a /etc/apt/sources.list
echo "$repo" | $sc tee -a /etc/apt/sources.list
} }
...@@ -1348,8 +1361,8 @@ __epm_addrepo_altlinux() ...@@ -1348,8 +1361,8 @@ __epm_addrepo_altlinux()
return return
fi fi
# 'rpm protocol:/path/to/repo component' # 'rpm protocol:/path/to/repo/arch component' (no sign, arch in the URL)
if [ "$1" = "rpm" ] && [ -n "$2" ] && [ -n "$3" ] && [ -z "$4" ] ; then if [ "$1" = "rpm" ] && is_url "$2" && [ -n "$3" ] && [ -z "$4" ] ; then
__epm_addrepo_altlinux_short "$@" __epm_addrepo_altlinux_short "$@"
return return
fi fi
...@@ -1373,9 +1386,9 @@ __epm_addrepo_altlinux() ...@@ -1373,9 +1386,9 @@ __epm_addrepo_altlinux()
etersoft) etersoft)
# TODO: return when Etersoft improved its repos # TODO: return when Etersoft improved its repos
#info "add Etersoft's addon repo" #info "add Etersoft's addon repo"
#__epm_addrepo_etersoft_addon #__epm_addrepo_etersoft_addon $branch
epm repo add $branch epm repo add $branch
epm repofix etersoft epm repo change etersoft
return 0 return 0
;; ;;
basealt|alt|altsp) basealt|alt|altsp)
...@@ -1383,7 +1396,7 @@ __epm_addrepo_altlinux() ...@@ -1383,7 +1396,7 @@ __epm_addrepo_altlinux()
;; ;;
yandex) yandex)
epm repo add $branch epm repo add $branch
epm repofix yandex epm repo change yandex
return 0 return 0
;; ;;
autoimports) autoimports)
...@@ -1400,8 +1413,9 @@ __epm_addrepo_altlinux() ...@@ -1400,8 +1413,9 @@ __epm_addrepo_altlinux()
;; ;;
esac esac
epm repo addkey cronbuild "DE73F3444C163CCD751AC483B584C633278EB305" "Cronbuild Service <cronbuild@altlinux.org>" epm repo addkey cronbuild "DE73F3444C163CCD751AC483B584C633278EB305" "Cronbuild Service <cronbuild@altlinux.org>"
epm repo add "rpm [cronbuild] $http://autoports.altlinux.org/pub ALTLinux/autoports/$DISTRVERSION/$DISTRARCH autoports" for i in $DISTRARCH noarch ; do
epm repo add "rpm [cronbuild] $http://autoports.altlinux.org/pub ALTLinux/autoports/$DISTRVERSION/noarch autoports" epm repo add "rpm [cronbuild] $http://autoports.altlinux.org/pub ALTLinux/autoports/$branch/$i autoports"
done
return 0 return 0
;; ;;
altlinuxclub) altlinuxclub)
...@@ -1413,17 +1427,17 @@ __epm_addrepo_altlinux() ...@@ -1413,17 +1427,17 @@ __epm_addrepo_altlinux()
korinf) korinf)
local http="http" local http="http"
epm installed apt-https && http="https" epm installed apt-https && http="https"
epm repo add "rpm $http://download.etersoft.ru/pub Korinf/ALTLinux/$DISTRVERSION main" epm repo add "rpm $http://download.etersoft.ru/pub Korinf/$DISTRARCH/$DISTRNAME/$DISTRVERSION main"
return 0 return 0
;; ;;
deferred) deferred)
[ "$DISTRVERSION" = "Sisyphus" ] || fatal "Etersoft Sisyphus Deferred supported only for ALT Sisyphus." [ "$DISTRVERSION" = "Sisyphus" ] || fatal "Etersoft Sisyphus Deferred supported only for ALT Sisyphus based systems."
epm repo add "http://download.etersoft.ru/pub/Etersoft/Sisyphus/Deferred" __epm_addrepo_add_alt_repo "$branch" "https://download.etersoft.ru/pub Etersoft/Sisyphus/Deferred" "classic"
return 0 return 0
;; ;;
deferred.org) deferred.org)
[ "$DISTRVERSION" = "Sisyphus" ] || fatal "Etersoft Sisyphus Deferred supported only for ALT Sisyphus." [ "$DISTRVERSION" = "Sisyphus" ] || fatal "Etersoft Sisyphus Deferred supported only for ALT Sisyphus based systems."
epm repo add "http://mirror.eterfund.org/download.etersoft.ru/pub/Etersoft/Sisyphus/Deferred" __epm_addrepo_add_alt_repo "$branch" "http://mirror.eterfund.org/pub Etersoft/Sisyphus/Deferred" "classic"
return 0 return 0
;; ;;
archive) archive)
...@@ -1431,17 +1445,15 @@ __epm_addrepo_altlinux() ...@@ -1431,17 +1445,15 @@ __epm_addrepo_altlinux()
branch="$2" branch="$2"
shift shift
fi fi
datestr="$2" datestr="$(normalize_date $2)"
echo "$datestr" | grep -Eq "^20[0-2][0-9]/[01][0-9]/[0-3][0-9]$" || fatal "use follow date format: 2017/01/31"
__epm_addrepo_add_alt_repo "$branch" "$ALTLINUXPUBURL archive/$branch/date/$datestr" "classic"
__epm_addrepo_add_alt_repo "$branch $ALTLINUXPUBURL archive/$branch/date/$datestr" "classic"
return 0 return 0
;; ;;
esac esac
if tasknumber "$repo" >/dev/null ; then if tasknumber "$repo" >/dev/null ; then
#sudocmd_foreach "apt-repo $dryrun add" $(tasknumber "$repo")
for i in $repo ; do for i in $repo ; do
epm repo add "https://git.altlinux.org/tasks/$i/build/repo" epm repo add "https://git.altlinux.org/tasks/$i/build/repo"
done done
...@@ -1449,7 +1461,7 @@ __epm_addrepo_altlinux() ...@@ -1449,7 +1461,7 @@ __epm_addrepo_altlinux()
fi fi
case "$repo" in case "$repo" in
c10f3|c10f2|c10f1|c9f2|c9f1|c9) c10f*|c9f*|c9)
__epm_addrepo_main_alt_repo "$repo" __epm_addrepo_main_alt_repo "$repo"
return return
;; ;;
...@@ -1459,11 +1471,6 @@ __epm_addrepo_altlinux() ...@@ -1459,11 +1471,6 @@ __epm_addrepo_altlinux()
;; ;;
esac esac
if [ -z "$force" ] ; then
# don't add again
epm repo list --quiet | grep -q -F "$repo" && return 0
fi
if echo "$repo" | grep -q "https://" ; then if echo "$repo" | grep -q "https://" ; then
local mh="$(echo /usr/lib*/apt/methods/https)" local mh="$(echo /usr/lib*/apt/methods/https)"
assure_exists $mh apt-https assure_exists $mh apt-https
...@@ -1471,13 +1478,11 @@ __epm_addrepo_altlinux() ...@@ -1471,13 +1478,11 @@ __epm_addrepo_altlinux()
# when add correct sources.list string # when add correct sources.list string
if echo "$repo" | grep "^rpm " ; then if echo "$repo" | grep "^rpm " ; then
__epm_addrepo_apt "$repo" __epm_addrepo_to_file /etc/apt/sources.list "$repo"
return return
fi fi
# TODO: rewrite this fallback fatal "Can't recognize how to add $repo, please report it"
assure_exists apt-repo
sudocmd apt-repo $dryrun add "$repo"
} }
...@@ -1501,7 +1506,7 @@ __epm_addrepo_astra() ...@@ -1501,7 +1506,7 @@ __epm_addrepo_astra()
astra-1.7_x86-64) astra-1.7_x86-64)
# TODO epm repo change http / https # TODO epm repo change http / https
epm install --skip-installed apt-transport-https ca-certificates || fatal epm install --skip-installed apt-transport-https ca-certificates || fatal
if epm repo list | grep "dl.astralinux.ru/astra/stable/1.7_x86-64" ; then if epm repo list "dl.astralinux.ru/astra/stable/1.7_x86-64" ; then
fatal "Astra repo is already in the list" fatal "Astra repo is already in the list"
fi fi
# https://wiki.astralinux.ru/pages/viewpage.action?pageId=158598882 # https://wiki.astralinux.ru/pages/viewpage.action?pageId=158598882
...@@ -1512,6 +1517,16 @@ __epm_addrepo_astra() ...@@ -1512,6 +1517,16 @@ __epm_addrepo_astra()
epm repo add "deb [arch-=i386] https://dl.astralinux.ru/astra/stable/1.7_x86-64/repository-extended/ 1.7_x86-64 astra-ce" epm repo add "deb [arch-=i386] https://dl.astralinux.ru/astra/stable/1.7_x86-64/repository-extended/ 1.7_x86-64 astra-ce"
return return
;; ;;
astra-1.8_x86-64)
# TODO epm repo change http / https
epm install --skip-installed apt-transport-https ca-certificates || fatal
if epm repo list "dl.astralinux.ru/astra/stable/$reponame" ; then
fatal "Astra repo is already in the list"
fi
epm repo add "deb [arch-=i386] https://dl.astralinux.ru/astra/stable/$reponame/main-repository/ $reponame main contrib non-free non-free-firmware"
epm repo add "deb [arch-=i386] https://dl.astralinux.ru/astra/stable/$reponame/extended-repository/ $reponame main contrib non-free non-free-firmware"
return
;;
astra-orel) astra-orel)
# TODO epm repo change http / https # TODO epm repo change http / https
epm install --skip-installed apt-transport-https ca-certificates || fatal epm install --skip-installed apt-transport-https ca-certificates || fatal
...@@ -1525,9 +1540,7 @@ __epm_addrepo_astra() ...@@ -1525,9 +1540,7 @@ __epm_addrepo_astra()
;; ;;
esac esac
#echo "Use workaround for AstraLinux ..." __epm_addrepo_to_file /etc/apt/sources.list "$repo"
# aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for AstraLinuxCE/orel
__epm_addrepo_apt "$repo"
return return
} }
...@@ -1535,9 +1548,7 @@ __epm_addrepo_alpine() ...@@ -1535,9 +1548,7 @@ __epm_addrepo_alpine()
{ {
local repo="$1" local repo="$1"
is_url "$repo" || fatal "Only URL is supported" is_url "$repo" || fatal "Only URL is supported"
epm --quiet repo list | grep -q -F "$repo" && return 0 __epm_addrepo_to_file /etc/apk/repositories "$repo"
echo "$repo" | sudocmd tee -a /etc/apk/repositories
} }
__epm_addrepo_deb() __epm_addrepo_deb()
...@@ -1581,10 +1592,17 @@ __epm_addrepo_deb() ...@@ -1581,10 +1592,17 @@ __epm_addrepo_deb()
return return
fi fi
# FIXME: quotes in showcmd/sudocmd if is_command apt-add-repository ; then
showcmd apt-add-repository "$repo" # FIXME: quotes in showcmd/sudocmd
sudorun apt-add-repository "$repo" showcmd apt-add-repository "$repo"
info "Check file /etc/apt/sources.list if needed" sudorun apt-add-repository "$repo"
info "Check file /etc/apt/sources.list if needed"
return
else
warning "apt-add-repository is not installed, use file /etc/apt/sources.list directly"
__epm_addrepo_to_file /etc/apt/sources.list "$repo"
fi
} }
epm_addrepo() epm_addrepo()
...@@ -10144,7 +10162,8 @@ __epm_removerepo_apt() ...@@ -10144,7 +10162,8 @@ __epm_removerepo_apt()
[ -s "$i" ] || continue [ -s "$i" ] || continue
# touch file only when it is needed # touch file only when it is needed
grep -q -F "$repo" $i || continue grep -q -F "$repo" $i || continue
$sc sed -i -e "s|.*$(sed_escape "$repo").*||" $i
$sc sed -i -e "\|$(sed_escape "$repo")|d" $i
done done
} }
...@@ -10167,9 +10186,9 @@ __epm_removerepo_alt_grepremove() ...@@ -10167,9 +10186,9 @@ __epm_removerepo_alt_grepremove()
# ^rpm means full string # ^rpm means full string
if ! rhas "$rl" "^rpm" ; then if ! rhas "$rl" "^rpm" ; then
rl="$(__epm_grep_repo_list "$rl" 2>/dev/null)" rl="$(__epm_grep_repo_list $rl 2>/dev/null)"
if [ -z "$rl" ] ; then if [ -z "$rl" ] ; then
[ -n "$verbose" ] && warning 'Can'\''t find '$rl' in the repos (see # epm repolist output)' [ -n "$verbose" ] && warning 'Can'\''t find '$*' in the repos (see # epm repolist output)'
return 1 return 1
fi fi
fi fi
...@@ -10228,7 +10247,7 @@ __epm_removerepo_alt() ...@@ -10228,7 +10247,7 @@ __epm_removerepo_alt()
if echo "$*" | grep -q "^rpm" ; then if echo "$*" | grep -q "^rpm" ; then
__epm_removerepo_apt "$*" __epm_removerepo_apt "$*"
else else
info "removing all source.list" info "removing with grep by '$*'"
__epm_removerepo_alt_grepremove "$*" __epm_removerepo_alt_grepremove "$*"
fi fi
;; ;;
...@@ -11617,24 +11636,26 @@ epm_repocreate() ...@@ -11617,24 +11636,26 @@ epm_repocreate()
__print_apt_sources_list() __print_apt_sources_list()
{ {
local regexp="$1" local grepflags="$1"
shift local regexp="$2"
shift 2
local i local i
for i in $@ ; do for i in $@ ; do
test -r "$i" || continue test -r "$i" || continue
grep -v -- "^.*#" $i grep -v -- "^.*#" $i
done | grep -v -- "^ *\$" | grep -E "$regexp" done | grep -v -- "^ *\$" | grep $grepflags "$regexp"
} }
__print_apt_sources_list_full() __print_apt_sources_list_full()
{ {
local regexp="$1" local grepflags="$1"
shift local regexp="$2"
shift 2
local i local i
for i in $@ ; do for i in $@ ; do
test -r "$i" || continue test -r "$i" || continue
grep -- "^[[:space:]]*#*[[:space:]]*rpm" $i grep -- "^[[:space:]]*#*[[:space:]]*rpm" $i
done | grep -v -- "^ *\$" | grep -E "$regexp" done | grep -v -- "^ *\$" | grep $grepflags "$regexp"
} }
__print_apt_sources_list_list() __print_apt_sources_list_list()
...@@ -11655,28 +11676,30 @@ __info_cyan() ...@@ -11655,28 +11676,30 @@ __info_cyan()
__print_apt_sources_list_verbose() __print_apt_sources_list_verbose()
{ {
local regexp="$1" local grepflags="$1"
shift local regexp="$2"
shift 2
local i local i
local res=1 local res=1
for i in $@ ; do for i in $@ ; do
test -r "$i" || continue test -r "$i" || continue
grep -v -- "^.*#" $i | grep -v -- "^ *\$" | grep -q . && __info_cyan "$i:" || continue grep -v -- "^.*#" $i | grep -v -- "^ *\$" | grep -q . && __info_cyan "$i:" || continue
grep -v -- "^.*#" $i | grep -v -- "^ *\$" | sed -e 's|^| |' | grep -E --color "$regexp" && res=0 grep -v -- "^.*#" $i | grep -v -- "^ *\$" | sed -e 's|^| |' | grep $grepflags --color "$regexp" && res=0
done done
return $res return $res
} }
__print_apt_sources_list_verbose_full() __print_apt_sources_list_verbose_full()
{ {
local regexp="$1" local grepflags="$1"
shift local regexp="$2"
shift 2
local i local i
local res=1 local res=1
for i in $@ ; do for i in $@ ; do
test -r "$i" || continue test -r "$i" || continue
grep -- "^[[:space:]]*#*[[:space:]]*rpm" $i | grep -v -- "^ *\$" | grep -q . && echo && __info_cyan "$i:" || continue grep -- "^[[:space:]]*#*[[:space:]]*rpm" $i | grep -v -- "^ *\$" | grep -q . && echo && __info_cyan "$i:" || continue
grep -- "^[[:space:]]*#*[[:space:]]*rpm" $i | grep -v -- "^ *\$" | sed -e 's|^| |' -e "s|\(.*#.*\)|$(set_color $WHITE)\1$(restore_color)|" | grep -E --color "$regexp" && res=0 grep -- "^[[:space:]]*#*[[:space:]]*rpm" $i | grep -v -- "^ *\$" | sed -e 's|^| |' -e "s|\(.*#.*\)|$(set_color $WHITE)\1$(restore_color)|" | grep $grepflags --color "$regexp" && res=0
done done
return $res return $res
} }
...@@ -11685,26 +11708,35 @@ print_apt_sources_list() ...@@ -11685,26 +11708,35 @@ print_apt_sources_list()
{ {
local LISTS='/etc/apt/sources.list /etc/apt/sources.list.d/*.list' local LISTS='/etc/apt/sources.list /etc/apt/sources.list.d/*.list'
[ -n "$1" ] && echo "$*" | grep -q "\.[*?]" && warning "Only glob symbols * and ? are supported. Don't use regexp here!" local flagall=''
if [ "$1" = "-a" ] || [ "$1" = "--all" ] ; then if [ "$1" = "-a" ] || [ "$1" = "--all" ] ; then
flagall='--all'
shift shift
local wc=$(__convert_glob__to_regexp "$*") fi
local wc="$*"
local grepflags=""
if echo "$wc" | grep -q -E "^(deb|rpm) " ; then
grepflags="-F"
else
echo "$wc" | grep -q "\.[*?]" && warning "Only glob symbols * and ? are supported. Don't use regexp here!"
wc="$(__convert_glob__to_regexp "$wc")"
grepflags="-E"
fi
if [ -n "$flagall" ] ; then
if [ -n "$quiet" ] ; then if [ -n "$quiet" ] ; then
__print_apt_sources_list_full "$wc" $LISTS __print_apt_sources_list_full "$grepflags" "$wc" $LISTS
else else
__print_apt_sources_list_verbose_full "$wc" $LISTS __print_apt_sources_list_verbose_full "$grepflags" "$wc" $LISTS
fi fi
return return
fi fi
local wc=$(__convert_glob__to_regexp "$*")
if [ -n "$quiet" ] ; then if [ -n "$quiet" ] ; then
__print_apt_sources_list "$wc" $LISTS __print_apt_sources_list "$grepflags" "$wc" $LISTS
else else
__print_apt_sources_list_verbose "$wc" $LISTS __print_apt_sources_list_verbose "$grepflags" "$wc" $LISTS
fi fi
} }
...@@ -15845,6 +15877,16 @@ get_virt() ...@@ -15845,6 +15877,16 @@ get_virt()
echo "$VIRT" && return echo "$VIRT" && return
fi fi
if [ "$UID" = 0 ] ; then
if grep -q "docker" /proc/1/environ; then
echo "docker" && return
elif grep -q "lxc" /proc/1/environ; then
echo "lxc" && return
elif grep -q "libpod" /proc/1/environ; then
echo "podman" && return
fi
fi
# TODO: use virt-what under root # TODO: use virt-what under root
# inspired by virt_what # inspired by virt_what
......
...@@ -34,7 +34,7 @@ SHAREDIR=$PROGDIR ...@@ -34,7 +34,7 @@ SHAREDIR=$PROGDIR
# will replaced with /etc/eepm during install # will replaced with /etc/eepm during install
CONFIGDIR=$PROGDIR/../etc CONFIGDIR=$PROGDIR/../etc
EPMVERSION="3.64.13" EPMVERSION="3.64.14"
# package, single (file), pipe, git # package, single (file), pipe, git
EPMMODE="package" EPMMODE="package"
...@@ -2737,6 +2737,16 @@ get_virt() ...@@ -2737,6 +2737,16 @@ get_virt()
echo "$VIRT" && return echo "$VIRT" && return
fi fi
if [ "$UID" = 0 ] ; then
if grep -q "docker" /proc/1/environ; then
echo "docker" && return
elif grep -q "lxc" /proc/1/environ; then
echo "lxc" && return
elif grep -q "libpod" /proc/1/environ; then
echo "podman" && return
fi
fi
# TODO: use virt-what under root # TODO: use virt-what under root
# inspired by virt_what # inspired by virt_what
......
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