Commit 0610433d authored by Vitaly Lipatov's avatar Vitaly Lipatov

commit packed 3.55.4

parent 047cb386
...@@ -33,7 +33,7 @@ SHAREDIR=$PROGDIR ...@@ -33,7 +33,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.55.3" EPMVERSION="3.55.4"
# package, single (file), pipe, git # package, single (file), pipe, git
EPMMODE="package" EPMMODE="package"
...@@ -517,7 +517,6 @@ assure_exists_erc() ...@@ -517,7 +517,6 @@ assure_exists_erc()
disabled_eget() disabled_eget()
{ {
local EGET
# use internal eget only if exists # use internal eget only if exists
if [ -s $SHAREDIR/tools_eget ] ; then if [ -s $SHAREDIR/tools_eget ] ; then
( EGET_BACKEND=$eget_backend $CMDSHELL $SHAREDIR/tools_eget "$@" ) ( EGET_BACKEND=$eget_backend $CMDSHELL $SHAREDIR/tools_eget "$@" )
...@@ -525,6 +524,7 @@ disabled_eget() ...@@ -525,6 +524,7 @@ disabled_eget()
fi fi
fatal "Internal error: missed tools_eget" fatal "Internal error: missed tools_eget"
local EGET
# FIXME: we need disable output here, eget can be used for get output # FIXME: we need disable output here, eget can be used for get output
assure_exists eget eget 3.3 >/dev/null assure_exists eget eget 3.3 >/dev/null
# run external command, not the function # run external command, not the function
...@@ -5867,6 +5867,7 @@ pkg_names=$(__epm_get_hilevel_name $pkg_names) ...@@ -5867,6 +5867,7 @@ pkg_names=$(__epm_get_hilevel_name $pkg_names)
case $PMTYPE in case $PMTYPE in
apt-*) apt-*)
# FIXME: returns TRUE ever on missed package
docmd apt-cache policy $pkg_names docmd apt-cache policy $pkg_names
;; ;;
packagekit) packagekit)
...@@ -7302,6 +7303,10 @@ get_fix_release_pkg() ...@@ -7302,6 +7303,10 @@ get_fix_release_pkg()
echo "apt-conf-$TO" echo "apt-conf-$TO"
# apt-conf-sisyphus and apt-conf-branch conflicts # apt-conf-sisyphus and apt-conf-branch conflicts
epm installed apt-conf-branch && echo "apt-conf-branch-" epm installed apt-conf-branch && echo "apt-conf-branch-"
#for i in apt apt-rsync libapt libpackagekit-glib librpm7 packagekit rpm synaptic realmd libldap2 ; do
# epm installed $i && echo "$i"
#done
else else
epm installed apt-conf-branch && echo "apt-conf-branch" && epm installed apt-conf-sisyphus && echo "apt-conf-sisyphus-" epm installed apt-conf-branch && echo "apt-conf-branch" && epm installed apt-conf-sisyphus && echo "apt-conf-sisyphus-"
fi fi
...@@ -8074,6 +8079,8 @@ epm_remove() ...@@ -8074,6 +8079,8 @@ epm_remove()
return return
fi fi
# TODO: add support for --no-scripts to all cases
if [ "$BASEDISTRNAME" = "alt" ] ; then if [ "$BASEDISTRNAME" = "alt" ] ; then
if tasknumber "$pkg_names" >/dev/null ; then if tasknumber "$pkg_names" >/dev/null ; then
assure_exists apt-repo assure_exists apt-repo
...@@ -8358,6 +8365,7 @@ __epm_have_repack_rule() ...@@ -8358,6 +8365,7 @@ __epm_have_repack_rule()
# skip repacking on non ALT systems # skip repacking on non ALT systems
[ "$BASEDISTRNAME" = "alt" ] || return 1 [ "$BASEDISTRNAME" = "alt" ] || return 1
# skip for packages built with repack
local packager="$(epm print field Packager for "$1" 2>/dev/null)" local packager="$(epm print field Packager for "$1" 2>/dev/null)"
[ "$packager" = "EPM <support@etersoft.ru>" ] && return 1 [ "$packager" = "EPM <support@etersoft.ru>" ] && return 1
[ "$packager" = "EPM <support@eepm.ru>" ] && return 1 [ "$packager" = "EPM <support@eepm.ru>" ] && return 1
...@@ -11122,43 +11130,6 @@ get_only_installed_packages() ...@@ -11122,43 +11130,6 @@ get_only_installed_packages()
estrlist exclude "$(echo "$installlist" | (skip_installed='yes' filter_out_installed_packages))" "$installlist" estrlist exclude "$(echo "$installlist" | (skip_installed='yes' filter_out_installed_packages))" "$installlist"
} }
__convert_pkgallowscripts_to_regexp()
{
local tmpalf="$(mktemp)" || fatal
# copied from eget's filter_glob
# check man glob
# remove commentы and translate glob to regexp
grep -v "^[[:space:]]*#" "$1" | grep -v "^[[:space:]]*$" | sed -e "s|\*|.*|g" -e "s|?|.|g" -e "s|^|^|" -e "s|$|\$|" >$tmpalf
echo "$tmpalf"
}
__epm_package_ok_scripts()
{
local pkg="$1"
local alf="$CONFIGDIR/pkgallowscripts.list"
[ -s "$alf" ] || return 1
local name
name="$(epm print field Name for "$pkg" 2>/dev/null)"
[ -n "$name" ] || return 1
local tmpalf=$(__convert_pkgallowscripts_to_regexp "$alf")
echo "$name" | grep -q -f $tmpalf
local res=$?
rm $tmpalf
return $res
}
__epm_vendor_ok_scripts()
{
local vendor="$1"
local alf="$CONFIGDIR/vendorallowscripts.list"
[ -s "$alf" ] || return 1
[ -n "$vendor" ] || return 1
local tmpalf=$(__convert_pkgallowscripts_to_regexp "$alf")
echo "$vendor" | grep -q -f $tmpalf
local res=$?
rm $tmpalf
return $res
}
__epm_print_warning_for_nonalt_packages() __epm_print_warning_for_nonalt_packages()
{ {
...@@ -11196,10 +11167,11 @@ __epm_check_vendor() ...@@ -11196,10 +11167,11 @@ __epm_check_vendor()
local i local i
for i in $* ; do for i in $* ; do
bi="$(basename $i)"
if ! epm_status_validate "$i" ; then if ! epm_status_validate "$i" ; then
# it is missed package probably (package remove case) # it is missed package probably (package remove case)
if is_installed "$i" ; then if is_installed "$i" ; then
warning "Can't get any info for $i package. Scripts are DISABLED for package $i. Use --scripts if you need run scripts from such packages." warning "Can't get any info for $i package. Scripts are DISABLED for package $bi. Use --scripts if you need run scripts from such packages."
fi fi
noscripts="--noscripts" noscripts="--noscripts"
continue continue
...@@ -11209,7 +11181,7 @@ __epm_check_vendor() ...@@ -11209,7 +11181,7 @@ __epm_check_vendor()
vendor="$(epm print field Vendor for "$i")" vendor="$(epm print field Vendor for "$i")"
if [ -z "$vendor" ] ; then if [ -z "$vendor" ] ; then
warning "Can't get info about vendor for $i package. Scripts are DISABLED for package $i. Use --scripts if you need run scripts from such packages." warning "Can't get info about vendor for $i package. Scripts are DISABLED for package $bi. Use --scripts if you need run scripts from such packages."
noscripts="--noscripts" noscripts="--noscripts"
continue continue
fi fi
...@@ -11218,19 +11190,20 @@ __epm_check_vendor() ...@@ -11218,19 +11190,20 @@ __epm_check_vendor()
epm_status_repacked "$i" && continue epm_status_repacked "$i" && continue
if __epm_vendor_ok_scripts "$vendor" ; then if __epm_vendor_ok_scripts "$vendor" ; then
warning "Scripts are ENABLED for package $i from outside vendor '$vendor' (this vendor is listed in $CONFIGDIR/vendorallowscripts.list). Use --noscripts if you need disable scripts in such packages." warning "Scripts are ENABLED for package $bi from outside vendor '$vendor' (this vendor is listed in $CONFIGDIR/vendorallowscripts.list). Use --noscripts if you need disable scripts in such packages."
continue continue
fi fi
if __epm_package_ok_scripts "$i" ; then if __epm_package_ok_scripts "$i" ; then
warning "Scripts are ENABLED for package $i from outside vendor '$vendor' (the package is listed in $CONFIGDIR/pkgallowscripts.list). Use --noscripts if you need disable scripts in such packages." warning "Scripts are ENABLED for package $bi from outside vendor '$vendor' (the package is listed in $CONFIGDIR/pkgallowscripts.list). Use --noscripts if you need disable scripts in such packages."
continue continue
fi fi
warning "Scripts are DISABLED for package $i from outside vendor '$vendor'. Use --scripts if you need run scripts from such packages." warning "Scripts are DISABLED for package $bi from outside vendor '$vendor'. Use --scripts if you need run scripts from such packages."
noscripts="--noscripts" noscripts="--noscripts"
done done
} }
# File bin/epm-sh-warmup: # File bin/epm-sh-warmup:
is_warmup_allowed() is_warmup_allowed()
...@@ -11596,6 +11569,54 @@ epm_stats() ...@@ -11596,6 +11569,54 @@ epm_stats()
# File bin/epm-status: # File bin/epm-status:
__convert_pkgallowscripts_to_regexp()
{
local tmpalf="$(mktemp)" || fatal
# copied from eget's filter_glob
# check man glob
# remove commentы and translate glob to regexp
grep -v "^[[:space:]]*#" "$1" | grep -v "^[[:space:]]*$" | sed -e "s|\*|.*|g" -e "s|?|.|g" -e "s|^|^|" -e "s|$|\$|" >$tmpalf
echo "$tmpalf"
}
__epm_package_name_ok_scripts()
{
local name="$1"
local alf="$CONFIGDIR/pkgallowscripts.list"
[ -s "$alf" ] || return 1
[ -n "$name" ] || return 1
local tmpalf=$(__convert_pkgallowscripts_to_regexp "$alf")
echo "$name" | grep -q -f $tmpalf
local res=$?
rm $tmpalf
return $res
}
__epm_package_ok_scripts()
{
local pkg="$1"
local name
# TODO: improve epm print name and use it here
name="$(epm print field Name for "$pkg" 2>/dev/null)"
[ -n "$name" ] || return 1
__epm_package_name_ok_scripts "$name"
}
__epm_vendor_ok_scripts()
{
local vendor="$1"
local alf="$CONFIGDIR/vendorallowscripts.list"
[ -s "$alf" ] || return 1
[ -n "$vendor" ] || return 1
local tmpalf=$(__convert_pkgallowscripts_to_regexp "$alf")
echo "$vendor" | grep -q -f $tmpalf
local res=$?
rm $tmpalf
return $res
}
epm_status_installable() epm_status_installable()
{ {
local pkg="$1" local pkg="$1"
...@@ -11607,6 +11628,18 @@ epm_status_installable() ...@@ -11607,6 +11628,18 @@ epm_status_installable()
fi fi
} }
epm_status_certified()
{
local pkg="$1"
__epm_package_ok_scripts "$pkg" && return
local vendor
vendor="$(epm print field Vendor for "$pkg" 2>/dev/null)"
[ -n "$vendor" ] || return
__epm_vendor_ok_scripts "$vendor" && return
}
epm_status_validate() epm_status_validate()
{ {
local pkg="$1" local pkg="$1"
...@@ -11663,7 +11696,7 @@ epm_status_repacked() ...@@ -11663,7 +11696,7 @@ epm_status_repacked()
[ "$packager" = "EPM <support@eepm.ru>" ] && return 0 [ "$packager" = "EPM <support@eepm.ru>" ] && return 0
;; ;;
*) *)
fatal "Unsupported $DISTRNAME" fatal "Unsupported $BASEDISTRNAME"
;; ;;
esac esac
return 1 return 1
...@@ -11689,7 +11722,7 @@ epm_status_thirdparty() ...@@ -11689,7 +11722,7 @@ epm_status_thirdparty()
echo "$distribution" | grep -q "^ALT" || return 0 echo "$distribution" | grep -q "^ALT" || return 0
;; ;;
*) *)
fatal "Unsupported $DISTRNAME" fatal "Unsupported $BASEDISTRNAME"
;; ;;
esac esac
return 1 return 1
...@@ -11705,7 +11738,9 @@ Usage: epm status [options] <package> ...@@ -11705,7 +11738,9 @@ Usage: epm status [options] <package>
Options: Options:
--installed check if <package> is installed --installed check if <package> is installed
--installable check if <package> can be installed from the repo
--original check if <package> is from distro repo --original check if <package> is from distro repo
--certified check if <package> is certified that it can be installed without repacking
--thirdparty check if <package> from a third-party source (didn't packed for this distro) --thirdparty check if <package> from a third-party source (didn't packed for this distro)
--repacked check if <package> was repacked with epm repack --repacked check if <package> was repacked with epm repack
--validate check if <package> is accessible (we can get a fields from it) --validate check if <package> is accessible (we can get a fields from it)
...@@ -11738,6 +11773,10 @@ epm_status() ...@@ -11738,6 +11773,10 @@ epm_status()
epm_status_original "$@" epm_status_original "$@"
return return
;; ;;
--certified|--allowed-scripts)
epm_status_certified "$@"
return
;;
--third-party|--thirdparty|--thirdpart) --third-party|--thirdparty|--thirdpart)
epm_status_thirdparty "$@" epm_status_thirdparty "$@"
return return
......
...@@ -33,7 +33,7 @@ SHAREDIR=$PROGDIR ...@@ -33,7 +33,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.55.3" EPMVERSION="3.55.4"
# package, single (file), pipe, git # package, single (file), pipe, git
EPMMODE="package" EPMMODE="package"
...@@ -515,7 +515,6 @@ assure_exists_erc() ...@@ -515,7 +515,6 @@ assure_exists_erc()
disabled_eget() disabled_eget()
{ {
local EGET
# use internal eget only if exists # use internal eget only if exists
if [ -s $SHAREDIR/tools_eget ] ; then if [ -s $SHAREDIR/tools_eget ] ; then
( EGET_BACKEND=$eget_backend $CMDSHELL $SHAREDIR/tools_eget "$@" ) ( EGET_BACKEND=$eget_backend $CMDSHELL $SHAREDIR/tools_eget "$@" )
...@@ -523,6 +522,7 @@ disabled_eget() ...@@ -523,6 +522,7 @@ disabled_eget()
fi fi
fatal "Internal error: missed tools_eget" fatal "Internal error: missed tools_eget"
local EGET
# FIXME: we need disable output here, eget can be used for get output # FIXME: we need disable output here, eget can be used for get output
assure_exists eget eget 3.3 >/dev/null assure_exists eget eget 3.3 >/dev/null
# run external command, not the function # run external command, not the function
......
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