Commit f613b72f authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm install: don't disable rpm scripts for packages from /etc/eepm/pkgallowscripts.list

parent 60a944bf
......@@ -23,6 +23,7 @@ install:
mkdir -p $(DESTDIR)$(sysconfdir)/eepm/
cp -a etc/eepm.conf $(DESTDIR)$(sysconfdir)/eepm/
cp -a etc/*.list $(DESTDIR)$(sysconfdir)/eepm/
mkdir -p $(DESTDIR)$(mandir)/man1
cp -a `ls -1 man/*` $(DESTDIR)$(mandir)/man1/
......
......@@ -67,6 +67,31 @@ get_only_installed_packages()
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
}
# Args: package names. Set noscripts for outside packages.
__epm_check_vendor()
{
......@@ -87,7 +112,11 @@ __epm_check_vendor()
vendor="$(epm print field Vendor for "$i" 2>/dev/null)"
# TODO: check GPG
[ "$vendor" = "ALT Linux Team" ] && continue
warning "Scripts are disabled for package $i from outside vendor '$vendor'. Use --scripts if you need run scripts from such packages."
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."
continue
fi
warning "Scripts are DISABLED for package $i from outside vendor '$vendor'. Use --scripts if you need run scripts from such packages."
noscripts="--noscripts"
done
}
......@@ -115,6 +115,7 @@ rm -v %buildroot%_bindir/yum
%dir %_sysconfdir/eepm/prescription.d/
%config(noreplace) %_sysconfdir/eepm/eepm.conf
%config(noreplace) %_sysconfdir/eepm/serv.conf
%config(noreplace) %_sysconfdir/eepm/*.list
%config(noreplace) %_sysconfdir/eepm/repack.d/*
%config(noreplace) %_sysconfdir/eepm/play.d/*
%config(noreplace) %_sysconfdir/eepm/prescription.d/*
......
# Place here foreign packages with enough quality to relax with repacking
# Packages with this names epm will install with scripts by default
myoffice-*
cprocsp-*
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