Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eepm
Commits
81cc098b
Commit
81cc098b
authored
Apr 15, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm: implement list-available
parent
bfaff105
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
142 additions
and
0 deletions
+142
-0
epm
bin/epm
+4
-0
epm-list_available
bin/epm-list_available
+138
-0
No files found.
bin/epm
View file @
81cc098b
...
...
@@ -276,6 +276,10 @@ check_command()
;;
-qa
|
qa|-l|list|ls|packages|list-installed|li
)
# HELPCMD: print list of installed package(s)
epm_cmd
=
packages
# it is too hard operation, so just list name is very short for it
list-available
)
# HELPCMD: print list of all available packages
epm_cmd
=
list_available
direct_args
=
1
;;
programs
)
# HELPCMD: print list of installed GUI program(s) (they have .desktop files)
epm_cmd
=
programs
...
...
bin/epm-list_available
0 → 100644
View file @
81cc098b
#!/bin/sh
#
# Copyright (C) 2023 Etersoft
# Copyright (C) 2023 Vitaly Lipatov <lav@etersoft.ru>
#
# 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
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
load_helper epm-sh-warmup
__aptcyg_print_full
()
{
#showcmd apt-cyg show
local
VERSION
=
$(
apt-cyg show
"
$1
"
|
grep
-m1
"^version: "
|
sed
-e
"s|^version: ||g"
)
echo
"
$1
-
$VERSION
"
}
__fo_pfn
()
{
grep
-v
"^$"
|
grep
--
"
$pkg_filenames
"
}
epm_list_available
()
{
if
[
-n
"
$1
"
]
;
then
# list --available with args is the same as search
load_helper epm-search
epm_search
"
$@
"
return
fi
case
$PMTYPE
in
apt-
*
)
warmup_dpkgbase
# TODO: use apt list
if
[
-n
"
$short
"
]
;
then
docmd apt-cache search
.
|
sed
-e
"s| .*||g"
else
docmd apt-cache search
.
fi
;;
dnf-
*
)
warmup_rpmbase
if
[
-n
"
$short
"
]
;
then
docmd dnf list
--available
|
sed
-e
"s| .*||g"
else
docmd dnf list
--available
fi
;;
yum-
*
)
warmup_rpmbase
if
[
-n
"
$short
"
]
;
then
docmd yum list
--available
|
sed
-e
"s| .*||g"
else
docmd yum list
--available
fi
;;
packagekit
)
# see for filter list: pkcon get-filters
# TODO: implement --short
docmd pkcon get-packages
-p
|
sed
-e
"s| (.*||g"
-e
"s|.* ||"
;;
snappy
)
docmd snappy find
.
;;
snap
)
docmd snap find
.
;;
appget
)
docmd appget search
.
;;
winget
)
docmd winget search
.
;;
emerge
)
docmd eix
--world
;;
termux-pkg
)
docmd pkg list-all
;;
npackd
)
CMD
=
"npackdcl list"
;;
eopkg
)
CMD
=
"eopkg list-available"
;;
chocolatey
)
CMD
=
"chocolatey search ."
;;
slackpkg
)
CMD
=
"slackpkg search ."
;;
homebrew
)
docmd brew search
.
;;
opkg
)
CMD
=
"opkg list-available"
;;
apk
)
CMD
=
"apk list --available"
;;
appget
)
CMD
=
"appget search"
;;
winget
)
CMD
=
"winget search"
;;
xbps
)
CMD
=
"xbps-query -l -R"
showcmd
$CMD
if
[
-n
"
$short
"
]
;
then
$CMD
|
sed
-e
"s|^ii ||g"
-e
"s| .*||g"
-e
"s|
\(
.*
\)
-.*|
\1
|g"
| __fo_pfn
else
$CMD
|
sed
-e
"s|^ii ||g"
-e
"s| .*||g"
| __fo_pfn
fi
return
0
;;
*
)
fatal
"Have no suitable query command for
$PMTYPE
"
;;
esac
docmd
$CMD
| __fo_pfn
# FIXME: we print empty lines, but will lost error status
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment