Commit cab5bce8 authored by Vitaly Lipatov's avatar Vitaly Lipatov

commit packed 3.23.0

parent 9fc37763
...@@ -585,6 +585,12 @@ set_distro_info() ...@@ -585,6 +585,12 @@ set_distro_info()
DISTRARCH=$($DISTRVENDOR --distro-arch) DISTRARCH=$($DISTRVENDOR --distro-arch)
fi fi
DISTRCONTROL="$($DISTRVENDOR -y)" DISTRCONTROL="$($DISTRVENDOR -y)"
# TODO: improve BIGTMPDIR conception
# https://bugzilla.mozilla.org/show_bug.cgi?id=69938
# https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05s15.html
# https://geekpeach.net/ru/%D0%BA%D0%B0%D0%BA-systemd-tmpfiles-%D0%BE%D1%87%D0%B8%D1%89%D0%B0%D0%B5%D1%82-tmp-%D0%B8%D0%BB%D0%B8-var-tmp-%D0%B7%D0%B0%D0%BC%D0%B5%D0%BD%D0%B0-tmpwatch-%D0%B2-centos-rhel-7
[ -n "$BIGTMPDIR" ] || [ -d "/var/tmp" ] && BIGTMPDIR="/var/tmp" || BIGTMPDIR="/tmp"
} }
set_pm_type() set_pm_type()
...@@ -3103,14 +3109,6 @@ __epm_check_if_src_rpm() ...@@ -3103,14 +3109,6 @@ __epm_check_if_src_rpm()
done done
} }
__epm_check_if_needed_repack()
{
local pkgname="$(epm print name from "$1")"
local repackcode="$CONFIGDIR/repack.d/$pkgname.sh"
[ -x "$repackcode" ] || return
warning "There is repack rule for $pkgname package. It is better install this package via 'epm --repack install' or 'epm play'."
}
__epm_if_command_path() __epm_if_command_path()
{ {
is_dirpath "$1" && rhas "$1" "bin/" is_dirpath "$1" && rhas "$1" "bin/"
...@@ -6456,6 +6454,17 @@ esac ...@@ -6456,6 +6454,17 @@ esac
# File bin/epm-repack: # File bin/epm-repack:
__epm_check_if_needed_repack()
{
# FIXME: use real way (for any archive)
# FIXME: from вроде не существует и не работает
local pkgname="$(epm print name from "$1")"
local repackcode="$CONFIGDIR/repack.d/$pkgname.sh"
[ -x "$repackcode" ] || return
warning "There is repack rule for $pkgname package. It is better install this package via 'epm --repack install' or 'epm play'."
}
__epm_split_by_pkg_type() __epm_split_by_pkg_type()
{ {
local type="$1" local type="$1"
...@@ -6483,7 +6492,7 @@ __epm_repack_to_deb() ...@@ -6483,7 +6492,7 @@ __epm_repack_to_deb()
repacked_pkgs='' repacked_pkgs=''
local TDIR=$(mktemp -d) local TDIR=$(mktemp -d --tmpdir=$BIGTMPDIR)
for pkg in $pkgs ; do for pkg in $pkgs ; do
abspkg="$(realpath "$pkg")" abspkg="$(realpath "$pkg")"
...@@ -6567,7 +6576,7 @@ __fix_spec() ...@@ -6567,7 +6576,7 @@ __fix_spec()
subst "s|Summary: *$|Summary: $pkgname (was empty Summary after alien)|" $spec subst "s|Summary: *$|Summary: $pkgname (was empty Summary after alien)|" $spec
subst "s|^\(Version: .*\)~.*|\1|" $spec subst "s|^\(Version: .*\)~.*|\1|" $spec
subst "s|^Release: |Release: alt1.repacked.with.epm.|" $spec subst "s|^Release: |Release: alt1.repacked.with.epm.|" $spec
subst "s|^Distribution:.*||" $SPEC subst "s|^Distribution:.*||" $spec
subst "s|^\((Converted from a\) \(.*\) \(package.*\)|(Repacked from binary \2 package with epm $EPMVERSION)\n\1 \2 \3|" $spec subst "s|^\((Converted from a\) \(.*\) \(package.*\)|(Repacked from binary \2 package with epm $EPMVERSION)\n\1 \2 \3|" $spec
#" hack for highlight #" hack for highlight
} }
...@@ -6654,15 +6663,22 @@ __prepare_source_package() ...@@ -6654,15 +6663,22 @@ __prepare_source_package()
__set_version_pkgname $alpkg __set_version_pkgname $alpkg
if [ -n "$VERSION" ] ; then if [ -n "$VERSION" ] ; then
# TODO: don't use erc for detect type? then we potentially can skip install it
assure_exists erc || fatal assure_exists erc || fatal
pkgtype="$(a= erc type $alpkg)" pkgtype="$(a= erc type $alpkg)"
[ -n "$PKGNAME" ] || PKGNAME=$(basename $alpkg .$pkgtype) local newalpkg
newalpkg=$PKGNAME-$VERSION.$pkgtype
#[ -n "$PKGNAME" ] || PKGNAME=$(basename $alpkg .$pkgtype)
if [ "$pkgtype" = "tar" ] || [ "$pkgtype" = "tar.gz" ] || [ "$pkgtype" = "tgz" ] ; then if [ "$pkgtype" = "tar" ] || [ "$pkgtype" = "tar.gz" ] || [ "$pkgtype" = "tgz" ] ; then
mv $alpkg $newalpkg
: :
else else
newalpkg=$(basename $alpkg .$pkgtype).tar newalpkg=$PKGNAME-$VERSION.tar
#newalpkg=$(basename $alpkg .$pkgtype).tar
assure_exists erc || fatal assure_exists erc || fatal
a= erc repack $alpkg $newalpkg || fatal a= erc repack $alpkg $newalpkg || fatal
fi
if [ "$alpkg" != "$newalpkg" ] ; then
rm -f $verbose $alpkg rm -f $verbose $alpkg
alpkg=$newalpkg alpkg=$newalpkg
fi fi
...@@ -6673,17 +6689,26 @@ __prepare_source_package() ...@@ -6673,17 +6689,26 @@ __prepare_source_package()
__epm_repack_to_rpm() __epm_repack_to_rpm()
{ {
local pkgs="$*" local pkgs="$*"
case $DISTRNAME in #case $DISTRNAME in
ALTLinux|ALTServer) # ALTLinux|ALTServer)
;; # ;;
*) # *)
assure_distr ALTLinux "install --repack for rpm target" # assure_distr ALTLinux "install --repack for rpm target"
;; # ;;
esac #esac
# install epm-repack for static (package based) dependencies # Note: install epm-repack for static (package based) dependencies
assure_exists alien || fatal assure_exists alien || fatal
assure_exists /usr/bin/rpmbuild rpm-build || fatal
# TODO: check for all systems
case $PKGFORMAT in
rpm)
assure_exists /usr/bin/rpmbuild rpm-build || fatal
;;
deb)
assure_exists /usr/bin/rpmbuild rpm || fatal
;;
esac
# TODO: improve # TODO: improve
if echo "$pkgs" | grep -q "\.deb" ; then if echo "$pkgs" | grep -q "\.deb" ; then
...@@ -6693,7 +6718,7 @@ __epm_repack_to_rpm() ...@@ -6693,7 +6718,7 @@ __epm_repack_to_rpm()
fi fi
local pkg local pkg
export HOME=$(mktemp -d) export HOME=$(mktemp -d --tmpdir=$BIGTMPDIR)
__create_rpmmacros __create_rpmmacros
local alpkg local alpkg
...@@ -6730,7 +6755,7 @@ __epm_repack_to_rpm() ...@@ -6730,7 +6755,7 @@ __epm_repack_to_rpm()
[ -s "$spec" ] || fatal "can't find spec" [ -s "$spec" ] || fatal "can't find spec"
mv $spec $tmpbuilddir || fatal mv $spec $tmpbuilddir || fatal
spec="$tmpbuilddir/$(basename "$spec")" spec="$tmpbuilddir/$(basename "$spec")"
__set_name_version $spec $PKGNAME $VERSION #__set_name_version $spec $PKGNAME $VERSION
local pkgname="$(grep "^Name: " $spec | sed -e "s|Name: ||g" | head -n1)" local pkgname="$(grep "^Name: " $spec | sed -e "s|Name: ||g" | head -n1)"
# for tarballs fix permissions # for tarballs fix permissions
...@@ -6790,7 +6815,17 @@ __epm_repack() ...@@ -6790,7 +6815,17 @@ __epm_repack()
__epm_repack_to_rpm "$@" || return __epm_repack_to_rpm "$@" || return
;; ;;
deb) deb)
__epm_repack_to_deb "$@" || return # FIXME: only one package in $@ is supported
#local pkgname="$(epm print name from "$@")"
__set_version_pkgname "$1"
local repackcode="$CONFIGDIR/repack.d/$PKGNAME.sh"
if [ -x "$repackcode" ] ; then
__epm_repack_to_rpm "$@" || return
[ -n "$repacked_pkgs" ] || return
__epm_repack_to_deb $repacked_pkgs
else
__epm_repack_to_deb "$@" || return
fi
;; ;;
*) *)
fatal "$PKGFORMAT is not supported for repack yet" fatal "$PKGFORMAT is not supported for repack yet"
...@@ -9983,11 +10018,17 @@ Base distro (vendor) name (-s|-n): $(pkgvendor) ...@@ -9983,11 +10018,17 @@ Base distro (vendor) name (-s|-n): $(pkgvendor)
EOF EOF
} }
case "$2" in
-*)
echo "Unsupported option $2" >&2
exit 1
;;
esac
case $1 in case "$1" in
-h|--help) -h|--help)
echo "distro_info v$PROGVERSION - distro information retriever" echo "distro_info v$PROGVERSION - distro information retriever"
echo "Usage: distro_info [options] [args]" echo "Usage: distro_info [options] [SystemName/Version]"
echo "Options:" echo "Options:"
echo " -a - print hardware architecture (--distro-arch for distro depended name)" echo " -a - print hardware architecture (--distro-arch for distro depended name)"
echo " -b - print size of arch bit (32/64)" echo " -b - print size of arch bit (32/64)"
...@@ -9999,9 +10040,9 @@ case $1 in ...@@ -9999,9 +10040,9 @@ case $1 in
echo " -h - this help" echo " -h - this help"
echo " -m - print system memory size (in MB)" echo " -m - print system memory size (in MB)"
echo " -o - print base OS name" echo " -o - print base OS name"
echo " -p [SystemName] - print type of the packaging system" echo " -p - print type of the packaging system"
echo " -g [SystemName] - print name of the packaging system" echo " -g - print name of the packaging system"
echo " -s|-n [SystemName] - print base name of the distro (vendor name) (ubuntu for all Ubuntu family, alt for all ALT family) (as _vendor macros in rpm)" echo " -s|-n - print base name of the distro (vendor name) (ubuntu for all Ubuntu family, alt for all ALT family) (see _vendor macros in rpm)"
echo " -y - print running service manager" echo " -y - print running service manager"
echo " --pretty - print pretty distro name" echo " --pretty - print pretty distro name"
echo " -v - print version of distro" echo " -v - print version of distro"
...@@ -10080,6 +10121,10 @@ case $1 in ...@@ -10080,6 +10121,10 @@ case $1 in
override_distrib "$2" override_distrib "$2"
print_name_version print_name_version
;; ;;
-*)
echo "Unsupported option $1" >&2
exit 1
;;
*) *)
override_distrib "$1" override_distrib "$1"
print_total_info print_total_info
...@@ -11080,7 +11125,7 @@ Examples: ...@@ -11080,7 +11125,7 @@ Examples:
print_version() print_version()
{ {
echo "EPM package manager version 3.22.3 https://wiki.etersoft.ru/Epm" echo "EPM package manager version 3.23.0 https://wiki.etersoft.ru/Epm"
echo "Running on $($DISTRVENDOR -e) ('$PMTYPE' package manager uses '$PKGFORMAT' package format)" echo "Running on $($DISTRVENDOR -e) ('$PMTYPE' package manager uses '$PKGFORMAT' package format)"
echo "Copyright (c) Etersoft 2012-2021" echo "Copyright (c) Etersoft 2012-2021"
echo "This program may be freely redistributed under the terms of the GNU AGPLv3." echo "This program may be freely redistributed under the terms of the GNU AGPLv3."
...@@ -11090,7 +11135,7 @@ print_version() ...@@ -11090,7 +11135,7 @@ print_version()
Usage="Usage: epm [options] <command> [package name(s), package files]..." Usage="Usage: epm [options] <command> [package name(s), package files]..."
Descr="epm - EPM package manager" Descr="epm - EPM package manager"
EPMVERSION=3.22.3 EPMVERSION=3.23.0
verbose=$EPM_VERBOSE verbose=$EPM_VERBOSE
quiet= quiet=
nodeps= nodeps=
......
...@@ -576,6 +576,12 @@ set_distro_info() ...@@ -576,6 +576,12 @@ set_distro_info()
DISTRARCH=$($DISTRVENDOR --distro-arch) DISTRARCH=$($DISTRVENDOR --distro-arch)
fi fi
DISTRCONTROL="$($DISTRVENDOR -y)" DISTRCONTROL="$($DISTRVENDOR -y)"
# TODO: improve BIGTMPDIR conception
# https://bugzilla.mozilla.org/show_bug.cgi?id=69938
# https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch05s15.html
# https://geekpeach.net/ru/%D0%BA%D0%B0%D0%BA-systemd-tmpfiles-%D0%BE%D1%87%D0%B8%D1%89%D0%B0%D0%B5%D1%82-tmp-%D0%B8%D0%BB%D0%B8-var-tmp-%D0%B7%D0%B0%D0%BC%D0%B5%D0%BD%D0%B0-tmpwatch-%D0%B2-centos-rhel-7
[ -n "$BIGTMPDIR" ] || [ -d "/var/tmp" ] && BIGTMPDIR="/var/tmp" || BIGTMPDIR="/tmp"
} }
set_pm_type() set_pm_type()
...@@ -2054,11 +2060,17 @@ Base distro (vendor) name (-s|-n): $(pkgvendor) ...@@ -2054,11 +2060,17 @@ Base distro (vendor) name (-s|-n): $(pkgvendor)
EOF EOF
} }
case "$2" in
-*)
echo "Unsupported option $2" >&2
exit 1
;;
esac
case $1 in case "$1" in
-h|--help) -h|--help)
echo "distro_info v$PROGVERSION - distro information retriever" echo "distro_info v$PROGVERSION - distro information retriever"
echo "Usage: distro_info [options] [args]" echo "Usage: distro_info [options] [SystemName/Version]"
echo "Options:" echo "Options:"
echo " -a - print hardware architecture (--distro-arch for distro depended name)" echo " -a - print hardware architecture (--distro-arch for distro depended name)"
echo " -b - print size of arch bit (32/64)" echo " -b - print size of arch bit (32/64)"
...@@ -2070,9 +2082,9 @@ case $1 in ...@@ -2070,9 +2082,9 @@ case $1 in
echo " -h - this help" echo " -h - this help"
echo " -m - print system memory size (in MB)" echo " -m - print system memory size (in MB)"
echo " -o - print base OS name" echo " -o - print base OS name"
echo " -p [SystemName] - print type of the packaging system" echo " -p - print type of the packaging system"
echo " -g [SystemName] - print name of the packaging system" echo " -g - print name of the packaging system"
echo " -s|-n [SystemName] - print base name of the distro (vendor name) (ubuntu for all Ubuntu family, alt for all ALT family) (as _vendor macros in rpm)" echo " -s|-n - print base name of the distro (vendor name) (ubuntu for all Ubuntu family, alt for all ALT family) (see _vendor macros in rpm)"
echo " -y - print running service manager" echo " -y - print running service manager"
echo " --pretty - print pretty distro name" echo " --pretty - print pretty distro name"
echo " -v - print version of distro" echo " -v - print version of distro"
...@@ -2151,6 +2163,10 @@ case $1 in ...@@ -2151,6 +2163,10 @@ case $1 in
override_distrib "$2" override_distrib "$2"
print_name_version print_name_version
;; ;;
-*)
echo "Unsupported option $1" >&2
exit 1
;;
*) *)
override_distrib "$1" override_distrib "$1"
print_total_info print_total_info
...@@ -2262,7 +2278,7 @@ print_version() ...@@ -2262,7 +2278,7 @@ print_version()
local on_text="(host system)" local on_text="(host system)"
local virt="$($DISTRVENDOR -i)" local virt="$($DISTRVENDOR -i)"
[ "$virt" = "(unknown)" ] || [ "$virt" = "(host system)" ] || on_text="(under $virt)" [ "$virt" = "(unknown)" ] || [ "$virt" = "(host system)" ] || on_text="(under $virt)"
echo "Service manager version 3.22.3 https://wiki.etersoft.ru/Epm" echo "Service manager version 3.23.0 https://wiki.etersoft.ru/Epm"
echo "Running on $($DISTRVENDOR -e) $on_text with $SERVICETYPE" echo "Running on $($DISTRVENDOR -e) $on_text with $SERVICETYPE"
echo "Copyright (c) Etersoft 2012-2021" echo "Copyright (c) Etersoft 2012-2021"
echo "This program may be freely redistributed under the terms of the GNU AGPLv3." echo "This program may be freely redistributed under the terms of the GNU AGPLv3."
......
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