Commit 0bdbb892 authored by Andrey Cherepanov's avatar Andrey Cherepanov

1.5.24-alt0.M70P.1

- Backport new version to p7 branch
parents 32c9e1bb 68caaee8
...@@ -51,6 +51,7 @@ pkgtype() ...@@ -51,6 +51,7 @@ pkgtype()
gentoo) echo "tbz2" ;; gentoo) echo "tbz2" ;;
windows) echo "exe" ;; windows) echo "exe" ;;
android) echo "apk" ;; android) echo "apk" ;;
cygwin) echo "tar.xz" ;;
debian|ubuntu|mint|runtu|mcst) echo "deb" ;; debian|ubuntu|mint|runtu|mcst) echo "deb" ;;
alt|asplinux|suse|mandriva|rosa|mandrake|pclinux|sled|sles) alt|asplinux|suse|mandriva|rosa|mandrake|pclinux|sled|sles)
echo "rpm" ;; echo "rpm" ;;
...@@ -102,6 +103,10 @@ if distro altlinux-release ; then ...@@ -102,6 +103,10 @@ if distro altlinux-release ; then
elif has Citron ; then DISTRIB_RELEASE="2.4" elif has Citron ; then DISTRIB_RELEASE="2.4"
fi fi
elif [ `uname -o` = "Cygwin" ] ; then
DISTRIB_ID="Cygwin"
DISTRIB_RELEASE="all"
elif distro gentoo-release ; then elif distro gentoo-release ; then
DISTRIB_ID="Gentoo" DISTRIB_ID="Gentoo"
MAKEPROFILE=$(readlink $ROOTDIR/etc/portage/make.profile 2>/dev/null) || MAKEPROFILE=$(readlink $ROOTDIR/etc/make.profile) MAKEPROFILE=$(readlink $ROOTDIR/etc/portage/make.profile 2>/dev/null) || MAKEPROFILE=$(readlink $ROOTDIR/etc/make.profile)
......
...@@ -36,6 +36,8 @@ load_helper epm-sh-functions ...@@ -36,6 +36,8 @@ load_helper epm-sh-functions
#PATH=$PATH:/sbin:/usr/sbin #PATH=$PATH:/sbin:/usr/sbin
set_pm_type
set_sudo set_sudo
check_tty check_tty
...@@ -66,7 +68,6 @@ print_version() ...@@ -66,7 +68,6 @@ 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"
set_pm_type
verbose= verbose=
quiet= quiet=
......
...@@ -34,7 +34,8 @@ __is_repo_info_downloaded() ...@@ -34,7 +34,8 @@ __is_repo_info_downloaded()
__is_repo_info_uptodate() __is_repo_info_uptodate()
{ {
case $PMTYPE in case $PMTYPE in
apt-*) apt-rpm)
# apt-deb do not update lock file date
if $SUDO [ -r /var/lib/apt/lists ] ; then if $SUDO [ -r /var/lib/apt/lists ] ; then
local LOCKFILE=/var/lib/apt/lists/lock local LOCKFILE=/var/lib/apt/lists/lock
$SUDO test -r $LOCKFILE || return $SUDO test -r $LOCKFILE || return
......
...@@ -23,7 +23,10 @@ epm_download() ...@@ -23,7 +23,10 @@ epm_download()
case $PMTYPE in case $PMTYPE in
dnf-rpm) dnf-rpm)
sudocmd dnf download $pkg_filename sudocmd dnf download $pkg_filenames
;;
aptcyg)
sudocmd apt-cyg download $pkg_filenames
;; ;;
*) *)
fatal "Have no suitable command for $PMTYPE" fatal "Have no suitable command for $PMTYPE"
......
...@@ -122,6 +122,10 @@ __epm_filelist_name() ...@@ -122,6 +122,10 @@ __epm_filelist_name()
pkgng) pkgng)
CMD="pkg info -l" CMD="pkg info -l"
;; ;;
aptcyg)
docmd apt-cyg listfiles $@ | sed -e "s|^|/|g"
return
;;
slackpkg) slackpkg)
is_installed $@ || fatal "Query filelist for non installed packages does not realized" is_installed $@ || fatal "Query filelist for non installed packages does not realized"
docmd awk 'BEGIN{desk=1}{if(/^FILE LIST:$/){desk=0} else if (desk==0) {print}}' /var/log/packages/${pkg_filenames}* | less docmd awk 'BEGIN{desk=1}{if(/^FILE LIST:$/){desk=0} else if (desk==0) {print}}' /var/log/packages/${pkg_filenames}* | less
......
...@@ -102,6 +102,9 @@ case $PMTYPE in ...@@ -102,6 +102,9 @@ case $PMTYPE in
homebrew) homebrew)
docmd brew info $pkg_names docmd brew info $pkg_names
;; ;;
aptcyg)
docmd apt-cyg show $pkg_names
;;
*) *)
fatal "Have no suitable command for $PMTYPE" fatal "Have no suitable command for $PMTYPE"
;; ;;
......
...@@ -169,6 +169,9 @@ epm_install_names() ...@@ -169,6 +169,9 @@ epm_install_names()
android) android)
fatal "We still have no idea how to use package repository, ever if it is F-Droid." fatal "We still have no idea how to use package repository, ever if it is F-Droid."
return ;; return ;;
aptcyg)
sudocmd apt-cyg install $@
return ;;
*) *)
fatal "Have no suitable install command for $PMTYPE" fatal "Have no suitable install command for $PMTYPE"
;; ;;
...@@ -394,6 +397,9 @@ epm_print_install_command() ...@@ -394,6 +397,9 @@ epm_print_install_command()
android) android)
echo "pm install $@" echo "pm install $@"
;; ;;
aptcyg)
echo "apt-cyg install $@"
;;
*) *)
fatal "Have no suitable appropriate install command for $PMTYPE" fatal "Have no suitable appropriate install command for $PMTYPE"
;; ;;
......
...@@ -24,7 +24,8 @@ __repack_rpm_base() ...@@ -24,7 +24,8 @@ __repack_rpm_base()
assure_exists db_load || fatal assure_exists db_load || fatal
cd /var/lib/rpm || fatal cd /var/lib/rpm || fatal
mv Packages Packages.BACKUP || fatal mv Packages Packages.BACKUP || fatal
db_dump Packages.BACKUP | db_load Packages || fatal # mask dependencies with a=
a= db_dump Packages.BACKUP | a= db_load Packages || fatal
rm Packages.BACKUP rm Packages.BACKUP
} }
......
...@@ -34,6 +34,13 @@ case $PMTYPE in ...@@ -34,6 +34,13 @@ case $PMTYPE in
esac esac
} }
__aptcyg_print_full()
{
#showcmd apt-cyg show
local VERSION=$(apt-cyg show "$1" | grep -m1 "^version: " | sed -e "s|^version: ||g")
echo "$1-$VERSION"
}
# TODO: we have a problem with error status here # TODO: we have a problem with error status here
epm_packages() epm_packages()
{ {
...@@ -123,11 +130,23 @@ case $PMTYPE in ...@@ -123,11 +130,23 @@ case $PMTYPE in
docmd $CMD | sed -e "s|^package:||g" docmd $CMD | sed -e "s|^package:||g"
return return
;; ;;
aptcyg)
CMD="apt-cyg list $pkg_filenames"
if [ -z "$short" ] ; then
showcmd $CMD
for i in $($CMD) ; do
__aptcyg_print_full $i
done
return
fi
;;
*) *)
fatal "Have no suitable query command for $PMTYPE" fatal "Have no suitable query command for $PMTYPE"
;; ;;
esac esac
docmd $CMD docmd $CMD
# FIXME: do not print empty lines, but we will lost error status definitely
# | grep -v "^$"
} }
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2012, 2013 Etersoft # Copyright (C) 2012, 2013, 2015 Etersoft
# Copyright (C) 2012, 2013 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2012, 2013, 2015 Vitaly Lipatov <lav@etersoft.ru>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by
...@@ -31,7 +31,7 @@ _get_grep_exp() ...@@ -31,7 +31,7 @@ _get_grep_exp()
} }
# TODO: combine with -qa (the difference only in return status now) # TODO: combine with -qa (the difference only in return status now)
_query_via_packages_list() _shortquery_via_packages_list()
{ {
local res=0 local res=0
local grepexp local grepexp
...@@ -40,9 +40,11 @@ _query_via_packages_list() ...@@ -40,9 +40,11 @@ _query_via_packages_list()
grepexp=$(_get_grep_exp $firstpkg) grepexp=$(_get_grep_exp $firstpkg)
# Note: we use short=1 here due grep by ^name$
# separate first line for print out command # separate first line for print out command
short=1 pkg_filenames=$firstpkg epm_packages | grep -- "$grepexp" || res=1 short=1 pkg_filenames=$firstpkg epm_packages | grep -- "$grepexp" || res=1
local pkg
for pkg in "$@" ; do for pkg in "$@" ; do
grepexp=$(_get_grep_exp $pkg) grepexp=$(_get_grep_exp $pkg)
short=1 pkg_filenames=$pkg epm_packages 2>/dev/null | grep -- "$grepexp" || res=1 short=1 pkg_filenames=$pkg epm_packages 2>/dev/null | grep -- "$grepexp" || res=1
...@@ -51,6 +53,30 @@ _query_via_packages_list() ...@@ -51,6 +53,30 @@ _query_via_packages_list()
return $res return $res
} }
# Note: modified from _shortquery_via_packages_list
# TODO: non optimal double epm packages call
_query_via_packages_list()
{
local res=0
local grepexp
local firstpkg=$1
shift
grepexp=$(_get_grep_exp $firstpkg)
# Note: we use short=1 here due grep by ^name$
# separate first line for print out command
short=1 pkg_filenames=$firstpkg epm_packages | grep -q -- "$grepexp" && quiet=1 pkg_filenames=$firstpkg epm_packages $firstpkg || res=1
local pkg
for pkg in "$@" ; do
grepexp=$(_get_grep_exp $pkg)
short=1 pkg_filenames=$pkg epm_packages 2>/dev/null | grep -q -- "$grepexp" && quiet=1 pkg_filenames=$pkg epm_packages $pkg || res=1
done
return $res
}
# internal use only, for installed package # internal use only, for installed package
__epm_get_hilevel_nameform() __epm_get_hilevel_nameform()
{ {
...@@ -89,7 +115,7 @@ __epm_get_hilevel_name() ...@@ -89,7 +115,7 @@ __epm_get_hilevel_name()
for i in $@ ; do for i in $@ ; do
local pkg local pkg
# get short form in pkg # get short form in pkg
quiet=1 short=1 pkg=$(__epm_query_name $i) || continue # drop not installed packages quiet=1 pkg=$(__epm_query_shortname $i) || continue # drop not installed packages
# if already short form, skipped # if already short form, skipped
[ "$pkg" = "$i" ] && echo "$i" && continue [ "$pkg" = "$i" ] && echo "$i" && continue
# try get long form or use short form # try get long form or use short form
...@@ -129,12 +155,10 @@ __epm_query_name() ...@@ -129,12 +155,10 @@ __epm_query_name()
case $PMTYPE in case $PMTYPE in
*-rpm) *-rpm)
CMD="rpm -q" CMD="rpm -q"
[ -n "$short" ] && CMD="rpm -q --queryformat %{name}\n"
;; ;;
*-dpkg) *-dpkg)
#docmd dpkg -l $@ | grep "^ii" #docmd dpkg -l $@ | grep "^ii"
CMD="dpkg-query -W --showformat=\${Package}-\${Version}\n" CMD="dpkg-query -W --showformat=\${Package}-\${Version}\n"
[ -n "$short" ] && CMD="dpkg-query -W --showformat=\${Package}\n"
;; ;;
npackd) npackd)
docmd "npackdcl path --package=$@" docmd "npackdcl path --package=$@"
...@@ -162,10 +186,49 @@ __epm_query_name() ...@@ -162,10 +186,49 @@ __epm_query_name()
docmd $CMD $@ docmd $CMD $@
} }
__epm_query_shortname()
{
local CMD
[ -z "$*" ] && return
case $PMTYPE in
*-rpm)
CMD="rpm -q --queryformat %{name}\n"
;;
*-dpkg)
CMD="dpkg-query -W --showformat=\${Package}\n"
;;
npackd)
docmd "npackdcl path --package=$@"
return
;;
conary)
CMD="conary query"
;;
homebrew)
warning "fix query"
return 1
;;
# TODO: need to print name if exists
#pkgng)
# CMD="pkg info -e"
# ;;
# Note: slackpkg info pkgname
*)
# default slow workaround
_shortquery_via_packages_list $@
return
;;
esac
docmd $CMD $@
}
# check if pkg is installed # check if pkg is installed
is_installed() is_installed()
{ {
pkg_filenames="$@" pkg_names="$@" epm_query >/dev/null 2>/dev/null short=1 pkg_filenames="$@" pkg_names="$@" epm_query >/dev/null 2>/dev/null
# broken way to recursive call here (overhead!) # broken way to recursive call here (overhead!)
#epm installed $@ >/dev/null 2>/dev/null #epm installed $@ >/dev/null 2>/dev/null
} }
...@@ -186,5 +249,9 @@ epm_query() ...@@ -186,5 +249,9 @@ epm_query()
__epm_query_file $pkg_files || return __epm_query_file $pkg_files || return
if [ -n "$short" ] ; then
__epm_query_shortname $(print_name $pkg_names) || return
else
__epm_query_name $(print_name $pkg_names) || return __epm_query_name $(print_name $pkg_names) || return
fi
} }
...@@ -98,6 +98,11 @@ __do_query() ...@@ -98,6 +98,11 @@ __do_query()
ipkg) ipkg)
CMD="ipkg files" CMD="ipkg files"
;; ;;
aptcyg)
#CMD="apt-cyg packageof"
# do not realized locally
return 1
;;
*) *)
fatal "Have no suitable query command for $PMTYPE" fatal "Have no suitable query command for $PMTYPE"
;; ;;
......
...@@ -122,6 +122,9 @@ epm_remove_names() ...@@ -122,6 +122,9 @@ epm_remove_names()
homebrew) homebrew)
sudocmd brew remove $@ sudocmd brew remove $@
return ;; return ;;
aptcyg)
sudocmd apt-cyg remove $@
return ;;
ipkg) ipkg)
sudocmd ipkg $(subst_option force -force-depends) remove $@ sudocmd ipkg $(subst_option force -force-depends) remove $@
return ;; return ;;
...@@ -196,6 +199,9 @@ epm_print_remove_command() ...@@ -196,6 +199,9 @@ epm_print_remove_command()
ipkg) ipkg)
echo "ipkg remove $@" echo "ipkg remove $@"
;; ;;
aptcyg)
echo "apt-cyg remove $@"
;;
*) *)
fatal "Have no suitable appropriate remove command for $PMTYPE" fatal "Have no suitable appropriate remove command for $PMTYPE"
;; ;;
......
...@@ -91,6 +91,12 @@ case $PMTYPE in ...@@ -91,6 +91,12 @@ case $PMTYPE in
#CMD="pkg rquery '%dn-%dv'" #CMD="pkg rquery '%dn-%dv'"
CMD="pkg info -d" CMD="pkg info -d"
;; ;;
aptcyg)
#CMD="apt-cyg depends"
# print show version
docmd apt-cyg show $pkg_names | grep "^requires: " | sed "s|^requires: ||g"
return
;;
*) *)
fatal "Have no suitable command for $PMTYPE" fatal "Have no suitable command for $PMTYPE"
;; ;;
......
...@@ -88,6 +88,9 @@ case $PMTYPE in ...@@ -88,6 +88,9 @@ case $PMTYPE in
android) android)
CMD="pm list packages" CMD="pm list packages"
;; ;;
aptcyg)
CMD="apt-cyg searchall"
;;
*) *)
fatal "Have no suitable search command for $PMTYPE" fatal "Have no suitable search command for $PMTYPE"
;; ;;
......
...@@ -69,6 +69,10 @@ case $PMTYPE in ...@@ -69,6 +69,10 @@ case $PMTYPE in
ipkg) ipkg)
CMD="ipkg search" CMD="ipkg search"
;; ;;
aptcyg)
docmd apt-cyg searchall $(echo " $pkg_filenames" | sed -e "s| /| |g")
return
;;
*) *)
fatal "Have no suitable search file command for $PMTYPE" fatal "Have no suitable search file command for $PMTYPE"
;; ;;
......
...@@ -250,6 +250,10 @@ set_sudo() ...@@ -250,6 +250,10 @@ set_sudo()
SUDO="" SUDO=""
# skip SUDO if disabled # skip SUDO if disabled
[ -n "$EPMNOSUDO" ] && return [ -n "$EPMNOSUDO" ] && return
if [ "$DISTRNAME" = "Cygwin" ] || [ "$DISTRNAME" = "Windows" ] ; then
# skip sudo using on Windows
return
fi
EFFUID=`id -u` EFFUID=`id -u`
...@@ -435,6 +439,9 @@ case $DISTRNAME in ...@@ -435,6 +439,9 @@ case $DISTRNAME in
Android) Android)
CMD="android" CMD="android"
;; ;;
Cygwin)
CMD="aptcyg"
;;
*) *)
fatal "Have no suitable DISTRNAME $DISTRNAME" fatal "Have no suitable DISTRNAME $DISTRNAME"
;; ;;
......
...@@ -83,6 +83,9 @@ case $PMTYPE in ...@@ -83,6 +83,9 @@ case $PMTYPE in
# portsnap extract for the first time? # portsnap extract for the first time?
sudocmd portsnap fetch update sudocmd portsnap fetch update
;; ;;
aptcyg)
sudocmd apt-cyg update
;;
*) *)
fatal "Have no suitable update command for $PMTYPE" fatal "Have no suitable update command for $PMTYPE"
;; ;;
......
...@@ -89,6 +89,10 @@ epm_upgrade() ...@@ -89,6 +89,10 @@ epm_upgrade()
guix) guix)
CMD="guix package -u" CMD="guix package -u"
;; ;;
aptcyg)
docmd_foreach "epm install" $(short=1 epm packages)
return
;;
*) *)
fatal "Have no suitable command for $PMTYPE" fatal "Have no suitable command for $PMTYPE"
;; ;;
......
...@@ -47,6 +47,9 @@ case $PMTYPE in ...@@ -47,6 +47,9 @@ case $PMTYPE in
pkgng) pkgng)
CMD="pkg info -r" CMD="pkg info -r"
;; ;;
aptcyg)
CMD="apt-cyg rdepends"
;;
*) *)
fatal "Have no suitable command for $PMTYPE" fatal "Have no suitable command for $PMTYPE"
;; ;;
......
# This spec is backported to ALTLinux p7 automatically by rpmbph script. Do not edit it. # This spec is backported to ALTLinux p7 automatically by rpmbph script. Do not edit it.
# #
Name: eepm Name: eepm
Version: 1.5.23 Version: 1.5.24
Release: alt0.M70P.1 Release: alt0.M70P.1
Summary: Etersoft EPM package manager Summary: Etersoft EPM package manager
...@@ -67,6 +67,15 @@ chmod a+x %buildroot%_datadir/%name/{serv-,epm-}* ...@@ -67,6 +67,15 @@ chmod a+x %buildroot%_datadir/%name/{serv-,epm-}*
%_sysconfdir/bash_completion.d/cerv %_sysconfdir/bash_completion.d/cerv
%changelog %changelog
* Mon Dec 07 2015 Andrey Cherepanov <cas@altlinux.org> 1.5.24-alt0.M70P.1
- Backport new version to p7 branch
* Tue Dec 01 2015 Vitaly Lipatov <lav@altlinux.ru> 1.5.24-alt1
- add support apt-cyg on Cygwin
- drop pks-db requires
- epm-check_updated_rep: do not check on deb systems
- epm-query: fix print package version for other systems
* Sun Nov 22 2015 Vitaly Lipatov <lav@altlinux.ru> 1.5.23-alt0.M70P.1 * Sun Nov 22 2015 Vitaly Lipatov <lav@altlinux.ru> 1.5.23-alt0.M70P.1
- backport to ALTLinux p7 (by rpmbph script) - backport to ALTLinux p7 (by rpmbph script)
......
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