Commit 72b867d0 authored by Vitaly Lipatov's avatar Vitaly Lipatov

add support apt-cyg on Cygwin

parent 04e29385
......@@ -51,6 +51,7 @@ pkgtype()
gentoo) echo "tbz2" ;;
windows) echo "exe" ;;
android) echo "apk" ;;
cygwin) echo "tar.xz" ;;
debian|ubuntu|mint|runtu|mcst) echo "deb" ;;
alt|asplinux|suse|mandriva|rosa|mandrake|pclinux|sled|sles)
echo "rpm" ;;
......@@ -102,6 +103,10 @@ if distro altlinux-release ; then
elif has Citron ; then DISTRIB_RELEASE="2.4"
fi
elif [ `uname -o` = "Cygwin" ] ; then
DISTRIB_ID="Cygwin"
DISTRIB_RELEASE="all"
elif distro gentoo-release ; then
DISTRIB_ID="Gentoo"
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
#PATH=$PATH:/sbin:/usr/sbin
set_pm_type
set_sudo
check_tty
......@@ -66,7 +68,6 @@ print_version()
Usage="Usage: epm [options] <command> [package name(s), package files]..."
Descr="epm - EPM package manager"
set_pm_type
verbose=
quiet=
......
......@@ -23,7 +23,10 @@ epm_download()
case $PMTYPE in
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"
......
......@@ -122,6 +122,10 @@ __epm_filelist_name()
pkgng)
CMD="pkg info -l"
;;
aptcyg)
docmd apt-cyg listfiles $@ | sed -e "s|^|/|g"
return
;;
slackpkg)
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
......
......@@ -102,6 +102,9 @@ case $PMTYPE in
homebrew)
docmd brew info $pkg_names
;;
aptcyg)
docmd apt-cyg show $pkg_names
;;
*)
fatal "Have no suitable command for $PMTYPE"
;;
......
......@@ -169,6 +169,9 @@ epm_install_names()
android)
fatal "We still have no idea how to use package repository, ever if it is F-Droid."
return ;;
aptcyg)
sudocmd apt-cyg install $@
return ;;
*)
fatal "Have no suitable install command for $PMTYPE"
;;
......@@ -394,6 +397,9 @@ epm_print_install_command()
android)
echo "pm install $@"
;;
aptcyg)
echo "apt-cyg install $@"
;;
*)
fatal "Have no suitable appropriate install command for $PMTYPE"
;;
......
......@@ -123,6 +123,9 @@ case $PMTYPE in
docmd $CMD | sed -e "s|^package:||g"
return
;;
aptcyg)
CMD="apt-cyg list"
;;
*)
fatal "Have no suitable query command for $PMTYPE"
;;
......
......@@ -98,6 +98,11 @@ __do_query()
ipkg)
CMD="ipkg files"
;;
aptcyg)
#CMD="apt-cyg packageof"
# do not realized locally
return 1
;;
*)
fatal "Have no suitable query command for $PMTYPE"
;;
......
......@@ -122,6 +122,9 @@ epm_remove_names()
homebrew)
sudocmd brew remove $@
return ;;
aptcyg)
sudocmd apt-cyg remove $@
return ;;
ipkg)
sudocmd ipkg $(subst_option force -force-depends) remove $@
return ;;
......@@ -196,6 +199,9 @@ epm_print_remove_command()
ipkg)
echo "ipkg remove $@"
;;
aptcyg)
echo "apt-cyg remove $@"
;;
*)
fatal "Have no suitable appropriate remove command for $PMTYPE"
;;
......
......@@ -91,6 +91,12 @@ case $PMTYPE in
#CMD="pkg rquery '%dn-%dv'"
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"
;;
......
......@@ -88,6 +88,9 @@ case $PMTYPE in
android)
CMD="pm list packages"
;;
aptcyg)
CMD="apt-cyg searchall"
;;
*)
fatal "Have no suitable search command for $PMTYPE"
;;
......
......@@ -69,6 +69,10 @@ case $PMTYPE in
ipkg)
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"
;;
......
......@@ -250,6 +250,10 @@ set_sudo()
SUDO=""
# skip SUDO if disabled
[ -n "$EPMNOSUDO" ] && return
if [ "$DISTRNAME" = "Cygwin" ] || [ "$DISTRNAME" = "Windows" ] ; then
# skip sudo using on Windows
return
fi
EFFUID=`id -u`
......@@ -435,6 +439,9 @@ case $DISTRNAME in
Android)
CMD="android"
;;
Cygwin)
CMD="aptcyg"
;;
*)
fatal "Have no suitable DISTRNAME $DISTRNAME"
;;
......
......@@ -83,6 +83,9 @@ case $PMTYPE in
# portsnap extract for the first time?
sudocmd portsnap fetch update
;;
aptcyg)
sudocmd apt-cyg update
;;
*)
fatal "Have no suitable update command for $PMTYPE"
;;
......
......@@ -89,6 +89,11 @@ epm_upgrade()
guix)
CMD="guix package -u"
;;
# install does not update
#aptcyg)
# docmd_foreach "epm install" $(epm packages)
# return
# ;;
*)
fatal "Have no suitable command for $PMTYPE"
;;
......
......@@ -47,6 +47,9 @@ case $PMTYPE in
pkgng)
CMD="pkg info -r"
;;
aptcyg)
CMD="apt-cyg rdepends"
;;
*)
fatal "Have no suitable command for $PMTYPE"
;;
......
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