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
Vladislav
eepm
Commits
5fb77cf4
Commit
5fb77cf4
authored
May 12, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit packed 3.55.8
parent
4f476535
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
233 additions
and
84 deletions
+233
-84
epm.sh
packed/epm.sh
+222
-77
serv.sh
packed/serv.sh
+11
-7
No files found.
packed/epm.sh
View file @
5fb77cf4
...
@@ -33,7 +33,7 @@ SHAREDIR=$PROGDIR
...
@@ -33,7 +33,7 @@ SHAREDIR=$PROGDIR
# will replaced with /etc/eepm during install
# will replaced with /etc/eepm during install
CONFIGDIR
=
$PROGDIR
/../etc
CONFIGDIR
=
$PROGDIR
/../etc
EPMVERSION
=
"3.55.
7
"
EPMVERSION
=
"3.55.
8
"
# package, single (file), pipe, git
# package, single (file), pipe, git
EPMMODE
=
"package"
EPMMODE
=
"package"
...
@@ -502,13 +502,14 @@ esu()
...
@@ -502,13 +502,14 @@ esu()
else
else
# just shell
# just shell
showcmd
"su -"
showcmd
"su -"
exec
su -
a
=
exec
su -
fi
fi
fi
fi
set_pm_type
set_pm_type
escape_args
()
escape_args
()
{
{
local
output
=
''
local
output
=
''
...
@@ -531,11 +532,11 @@ esu()
...
@@ -531,11 +532,11 @@ esu()
#info "Enter root password:"
#info "Enter root password:"
if
[
-n
"
$*
"
]
;
then
if
[
-n
"
$*
"
]
;
then
[
-n
"
$quiet
"
]
||
showcmd
"su - -c
$escaped
"
[
-n
"
$quiet
"
]
||
showcmd
"su - -c
$escaped
"
exec
su -
-c
"
$escaped
"
a
=
exec
su -
-c
"
$escaped
"
else
else
# just shell
# just shell
showcmd
"su -"
showcmd
"su -"
exec
su -
a
=
exec
su -
fi
fi
fi
fi
...
@@ -559,10 +560,13 @@ regexp_subst()
...
@@ -559,10 +560,13 @@ regexp_subst()
assure_exists
()
assure_exists
()
{
{
local
package
=
"
$2
"
local
package
=
"
$2
"
local
textpackage
=
[
-n
"
$package
"
]
||
package
=
"
$(
__get_package_for_command
"
$1
"
)
"
[
-n
"
$package
"
]
||
package
=
"
$(
__get_package_for_command
"
$1
"
)
"
[
-n
"
$3
"
]
&&
textpackage
=
" >=
$3
"
(
direct
=
''
epm_assure
"
$1
"
$package
$3
)
||
fatal
"Can't assure in '
$1
' command from
$package$textpackage
package"
# ask for install: https://bugzilla.altlinux.org/42240
local
ask
=
''
[
-n
"
$non_interactive
"
]
||
ask
=
1
(
direct
=
''
interactive
=
$ask
epm_assure
"
$1
"
$package
$3
)
||
fatal
}
}
assure_exists_erc
()
assure_exists_erc
()
...
@@ -1424,14 +1428,21 @@ epm_assure()
...
@@ -1424,14 +1428,21 @@ epm_assure()
# can't be used in epm ei case
# can't be used in epm ei case
#docmd epm --auto install $PACKAGE || return
#docmd epm --auto install $PACKAGE || return
(
repack
=
''
non_interactive
=
1
pkg_names
=
"
$PACKAGE
"
pkg_files
=
''
pkg_urls
=
''
epm_install
)
||
return
(
repack
=
''
pkg_names
=
"
$PACKAGE
"
pkg_files
=
''
pkg_urls
=
''
epm_install
)
||
return
# https://bugzilla.altlinux.org/42240
epm_mark_auto
"
$PACKAGE
"
# no check if we don't need a version
# no check if we don't need a version
[
-n
"
$PACKAGEVERSION
"
]
||
return
0
[
-n
"
$PACKAGEVERSION
"
]
||
return
0
# check if we couldn't update and still need update
# check if we couldn't update and still need update
__epm_need_update
$PACKAGE
$PACKAGEVERSION
&&
return
1
__epm_need_update
$PACKAGE
$PACKAGEVERSION
||
return
0
return
0
local
textpackage
[
-n
"
$PACKAGEVERSION
"
]
&&
textpackage
=
" >=
$PACKAGEVERSION
"
warning
"Can't assure in '
$CMD
' command from
$PACKAGE$textpackage
package"
return
1
}
}
# File bin/epm-audit:
# File bin/epm-audit:
...
@@ -1476,23 +1487,35 @@ case $BASEDISTRNAME in
...
@@ -1476,23 +1487,35 @@ case $BASEDISTRNAME in
warning
"Use with caution!"
warning
"Use with caution!"
fi
fi
epm Upgrade
||
fatal
epm Upgrade
||
fatal
info
"Retrieving orphaned packages list ..."
local
PKGLIST
=
$(
__epm_orphan_altrpm
\
local
PKGLIST
=
$(
__epm_orphan_altrpm
\
|
sed
-e
"s/
\.
32bit//g"
\
|
sed
-e
"s/
\.
32bit//g"
\
|
grep
-v
--
"^eepm$"
\
|
grep
-v
--
"^eepm$"
\
|
grep
-v
--
"^distro_info$"
\
|
grep
-v
--
"^distro_info$"
\
|
grep
-v
--
"^kernel"
)
|
grep
-v
--
"^kernel"
)
# TODO: implement for other PMTYPE
info
"Retrieving packages installed via epm play ..."
local
play_installed
=
"
$(
epm play
--list-installed-packages
)
"
local
play_installed
=
"
$(
epm play
--list-installed-packages
)
"
if
[
-n
"
$play_installed
"
]
;
then
if
[
-n
"
$play_installed
"
]
;
then
echo
"Skip follow packages installed via epm play:
$play_installed
"
echo
"Skip follow packages installed via epm play:
$(
echo
$play_installed
| xargs
-n1000
echo
)
"
PKGLIST
=
"
$(
estrlist exclude
"
$play_installed
"
"
$PKGLIST
"
)
"
fi
# TODO: implement for other PMTYPE
local
hold_packages
=
"
$(
epm mark showhold
)
"
if
[
-n
"
$hold_packages
"
]
;
then
echo
"Skip follow packages on hold:
$(
echo
$hold_packages
| xargs
-n1000
echo
)
"
PKGLIST
=
"
$(
estrlist exclude
"
$hold_packages
"
"
$PKGLIST
"
)
"
fi
fi
PKGLIST
=
"
$(
estrlist exclude
"
$play_installed
"
"
$PKGLIST
"
)
"
if
[
-n
"
$PKGLIST
"
]
;
then
if
[
-n
"
$PKGLIST
"
]
;
then
if
[
-z
"
$dryrun
"
]
;
then
if
[
-z
"
$dryrun
"
]
;
then
showcmd epm remove
$dryrun
$force
$PKGLIST
showcmd epm remove
$dryrun
$force
$PKGLIST
confirm_info
"We will remove packages above."
confirm_info
"We will remove packages above."
fi
fi
info
info
docmd epm remove
$dryrun
$force
$(
subst_option non_interactive
--auto
)
$PKGLIST
docmd epm remove
$dryrun
$force
$(
subst_option non_interactive
--auto
)
$PKGLIST
else
else
echo
"There are no orphan packages in the system."
echo
"There are no orphan packages in the system."
...
@@ -2276,13 +2299,66 @@ fi
...
@@ -2276,13 +2299,66 @@ fi
# File bin/epm-check_updated_repo:
# File bin/epm-check_updated_repo:
__epm_check_apt_db_days
()
{
# apt-dpkg
local
pkg
=
"Packages"
[
"
$BASEDISTRNAME
"
=
"alt"
]
&&
pkg
=
"pkglist"
local
pkglists
pkglists
=
$(
find /var/lib/apt/lists
-name
"*_
$pkg
*"
-ctime
+1 2>/dev/null
)
[
-z
"
$pkglists
"
]
&&
return
local
i t
local
ts
=
0
# set ts to newest file ctime
# shellcheck disable=SC2044
for
i
in
$(
find /var/lib/apt/lists/
-name
"*_
$pkg
*"
2>/dev/null
)
;
do
t
=
$(
stat
-c
%Z
"
$i
"
)
[
"
$t
"
-gt
"
$ts
"
]
&&
ts
=
$t
done
if
[
"
$ts
"
-gt
0
]
;
then
# shellcheck disable=SC2017
local
now
=
$(
date
+%s
)
local
days
=
"
$((
(
now
-
ts
)
/
(
60
*
60
*
24
)
))
"
[
"
$days
"
=
"0"
]
&&
return
0
[
"
$days
"
=
"1"
]
&&
echo
"1 day old"
&&
return
1
echo
"
$days
days old"
else
# no any pkglist
echo
"stalled"
fi
return
1
}
__epm_touch_apt_pkg
()
{
# apt-dpkg
local
pkg
=
"Packages"
[
"
$BASEDISTRNAME
"
=
"alt"
]
&&
pkg
=
"pkglist"
# ordinal package file have date of latest upstream change, not latest update, so update fake file
sudorun
touch
"/var/lib/apt/lists/eepm-fake_
$pkg
"
}
__epm_touch_pkg
()
{
case
$PMTYPE
in
apt-
*
)
__epm_touch_apt_pkg
;;
esac
}
__is_repo_info_downloaded
()
__is_repo_info_downloaded
()
{
{
case
$PMTYPE
in
case
$PMTYPE
in
apt-
*
)
apt-
*
)
#if [ -r /var/cache/apt ] ; then
# apt-dpkg
# sudorun test -r /var/cache/apt/pkgcache.bin || return
local
pkg
=
"Packages"
#fi
[
"
$BASEDISTRNAME
"
=
"alt"
]
&&
pkg
=
"pkglist"
local
pkglists
pkglists
=
$(
find /var/lib/apt/lists
-name
"*_
$pkg
*"
2>/dev/null
)
[
-n
"
$pkglists
"
]
||
return
1
;;
;;
*
)
*
)
;;
;;
...
@@ -2294,14 +2370,7 @@ __is_repo_info_uptodate()
...
@@ -2294,14 +2370,7 @@ __is_repo_info_uptodate()
{
{
case
$PMTYPE
in
case
$PMTYPE
in
apt-
*
)
apt-
*
)
# apt-deb do not update lock file date
__epm_check_apt_db_days
>
/dev/null
#if $SUDO test -r /var/lib/apt/lists ; then
local
LOCKFILE
=
/var/lib/apt/lists
sudorun
test
-r
$LOCKFILE
||
return
# if repo older than 1 day, return false
# find print string if file is obsoleted
test
-z
"
$(
find
$LOCKFILE
-maxdepth
0
-mtime
+1
)
"
||
return
#fi
;;
;;
*
)
*
)
;;
;;
...
@@ -2311,14 +2380,19 @@ __is_repo_info_uptodate()
...
@@ -2311,14 +2380,19 @@ __is_repo_info_uptodate()
update_repo_if_needed
()
update_repo_if_needed
()
{
{
# TODO: needs careful testing
local
days
days
=
"
$(
__epm_check_apt_db_days
)
"
&&
return
warning
"APT database is
$days
, please run 'epm update'!"
# TODO: enable __is_repo_info_downloaded
return
return
# check if we need skip update checking
# check if we need skip update checking
if
[
"
$1
"
=
"soft"
]
&&
!
set_sudo nofail
;
then
#
if [ "$1" = "soft" ] && ! set_sudo nofail ; then
# if sudo requires a password, skip autoupdate
#
# if sudo requires a password, skip autoupdate
info
"can't use sudo, so skip repo status checking"
#
info "can't use sudo, so skip repo status checking"
return
1
#
return 1
fi
#
fi
cd
/
||
fatal
cd
/
||
fatal
if
!
__is_repo_info_downloaded
||
!
__is_repo_info_uptodate
;
then
if
!
__is_repo_info_downloaded
||
!
__is_repo_info_uptodate
;
then
...
@@ -2377,11 +2451,11 @@ epm_clean()
...
@@ -2377,11 +2451,11 @@ epm_clean()
case
$PMTYPE
in
case
$PMTYPE
in
apt-rpm
)
apt-rpm
)
sudocmd apt-get clean
sudocmd apt-get clean
$dryrun
[
-n
"
$force
"
]
&&
__remove_alt_apt_cache_file
[
-n
"
$force
"
]
&&
__remove_alt_apt_cache_file
;;
;;
apt-dpkg
)
apt-dpkg
)
sudocmd apt-get clean
sudocmd apt-get clean
$dryrun
[
-n
"
$force
"
]
&&
__remove_deb_apt_cache_file
[
-n
"
$force
"
]
&&
__remove_deb_apt_cache_file
;;
;;
aptitude-dpkg
)
aptitude-dpkg
)
...
@@ -2748,6 +2822,7 @@ __download_pkg_urls()
...
@@ -2748,6 +2822,7 @@ __download_pkg_urls()
[
-z
"
$pkg_urls
"
]
&&
return
[
-z
"
$pkg_urls
"
]
&&
return
for
url
in
$pkg_urls
;
do
for
url
in
$pkg_urls
;
do
local
tmppkg
=
"
$(
mktemp
-d
)
"
||
fatal
"failed mktemp -d"
local
tmppkg
=
"
$(
mktemp
-d
)
"
||
fatal
"failed mktemp -d"
remove_on_exit
"
$tmppkg
"
docmd
chmod
$verbose
a+rX
$tmppkg
docmd
chmod
$verbose
a+rX
$tmppkg
showcmd
cd
$tmppkg
showcmd
cd
$tmppkg
cd
$tmppkg
||
fatal
cd
$tmppkg
||
fatal
...
@@ -2757,11 +2832,10 @@ __download_pkg_urls()
...
@@ -2757,11 +2832,10 @@ __download_pkg_urls()
# download packages
# download packages
if
docmd eget
$latest
"
$url
"
;
then
if
docmd eget
$latest
"
$url
"
;
then
local
i
local
i
for
i
in
*
.
*
;
do
for
i
in
*
;
do
[
-s
"
$tmppkg
/
$i
"
]
||
continue
[
-s
"
$tmppkg
/
$i
"
]
||
continue
chmod
$verbose
a+r
"
$tmppkg
/
$i
"
chmod
$verbose
a+r
"
$tmppkg
/
$i
"
[
-n
"
$pkg_files
"
]
&&
pkg_files
=
"
$pkg_files
$tmppkg
/
$i
"
||
pkg_files
=
"
$tmppkg
/
$i
"
[
-n
"
$pkg_files
"
]
&&
pkg_files
=
"
$pkg_files
$tmppkg
/
$i
"
||
pkg_files
=
"
$tmppkg
/
$i
"
remove_on_exit
"
$tmppkg
/
$i
"
done
done
else
else
warning
"Failed to download
$url
, ignoring"
warning
"Failed to download
$url
, ignoring"
...
@@ -3284,6 +3358,9 @@ epm_full_upgrade()
...
@@ -3284,6 +3358,9 @@ epm_full_upgrade()
"--no-kernel-update"
)
# HELPCMD: skip kernel update during full upgrade
"--no-kernel-update"
)
# HELPCMD: skip kernel update during full upgrade
full_upgrade_no_kernel_update
=
1
full_upgrade_no_kernel_update
=
1
;;
;;
"--no-clean"
)
# HELPCMD: no clean after upgrade
full_upgrade_no_clean
=
1
;;
esac
esac
shift
shift
done
done
...
@@ -3291,11 +3368,11 @@ epm_full_upgrade()
...
@@ -3291,11 +3368,11 @@ epm_full_upgrade()
docmd epm update
||
fatal
"repository updating is failed."
docmd epm update
||
fatal
"repository updating is failed."
[
-n
"
$quiet
"
]
||
echo
[
-n
"
$quiet
"
]
||
echo
docmd epm upgrade
||
fatal
"upgrading of the system is failed."
docmd epm
$dryrun
upgrade
||
fatal
"upgrading of the system is failed."
if
[
-z
"
$full_upgrade_no_kernel_update
"
]
;
then
if
[
-z
"
$full_upgrade_no_kernel_update
"
]
;
then
[
-n
"
$quiet
"
]
||
echo
[
-n
"
$quiet
"
]
||
echo
docmd epm update-kernel
||
fatal
"updating of the kernel is failed."
docmd epm
$dryrun
update-kernel
||
fatal
"updating of the kernel is failed."
fi
fi
# disable epm play --update for non ALT Systems
# disable epm play --update for non ALT Systems
...
@@ -3303,25 +3380,27 @@ epm_full_upgrade()
...
@@ -3303,25 +3380,27 @@ epm_full_upgrade()
if
[
-z
"
$full_upgrade_no_epm_play
"
]
;
then
if
[
-z
"
$full_upgrade_no_epm_play
"
]
;
then
[
-n
"
$quiet
"
]
||
echo
[
-n
"
$quiet
"
]
||
echo
docmd epm play
--update
all
||
fatal
"updating of applications installed via epm play is failed."
docmd epm
$dryrun
play
--update
all
||
fatal
"updating of applications installed via epm play is failed."
fi
fi
if
[
-z
"
$full_upgrade_no_flatpack
"
]
;
then
if
[
-z
"
$full_upgrade_no_flatpack
"
]
;
then
if
is_command flatpak
;
then
if
is_command flatpak
;
then
[
-n
"
$quiet
"
]
||
echo
[
-n
"
$quiet
"
]
||
echo
docmd flatpak update
docmd flatpak update
$(
subst_option non_interactive
--assume-yes
)
$(
subst_option dryrun
--no-deploy
)
fi
fi
fi
fi
if
[
-z
"
$full_upgrade_no_snap
"
]
;
then
if
[
-z
"
$full_upgrade_no_snap
"
]
;
then
if
is_command snap
&&
serv snapd exists
&&
serv snapd status
>
/dev/null
;
then
if
is_command snap
&&
serv snapd exists
&&
serv snapd status
>
/dev/null
;
then
[
-n
"
$quiet
"
]
||
echo
[
-n
"
$quiet
"
]
||
echo
sudocmd snap refresh
sudocmd snap refresh
$(
subst_option dryrun
--list
)
fi
fi
fi
fi
[
-n
"
$quiet
"
]
||
echo
if
[
-z
"
$full_upgrade_no_clean
"
]
;
then
docmd epm clean
[
-n
"
$quiet
"
]
||
echo
docmd epm
$dryrun
clean
fi
}
}
# File bin/epm-history:
# File bin/epm-history:
...
@@ -4025,34 +4104,12 @@ epm_install_files()
...
@@ -4025,34 +4104,12 @@ epm_install_files()
}
}
apt_repo_prepare
()
{
assure_exists apt-repo
[
-n
"
$non_interactive
"
]
||
return
set_sudo
trap
"
$SUDO
rm /etc/apt/apt.conf.d/eepm-apt-noninteractive.conf 2>/dev/null"
EXIT
echo
'APT::Get::Assume-Yes "true";'
|
$SUDO
tee
/etc/apt/apt.conf.d/eepm-apt-noninteractive.conf
>
/dev/null
}
apt_repo_after
()
{
[
-n
"
$non_interactive
"
]
||
return
$SUDO
rm
/etc/apt/apt.conf.d/eepm-apt-noninteractive.conf 2>/dev/null
}
epm_install
()
epm_install
()
{
{
if
[
"
$BASEDISTRNAME
"
=
"alt"
]
;
then
if
[
"
$BASEDISTRNAME
"
=
"alt"
]
;
then
if
tasknumber
"
$pkg_names
"
>
/dev/null
;
then
if
tasknumber
"
$pkg_names
"
>
/dev/null
;
then
local
res
epm_install_alt_tasks
"
$pkg_names
"
# TODO: don't use apt-repo
return
apt_repo_prepare
sudocmd_foreach
"apt-repo test"
$(
tasknumber
$pkg_names
)
res
=
$?
apt_repo_after
return
$res
fi
fi
fi
fi
...
@@ -4096,7 +4153,7 @@ epm_install()
...
@@ -4096,7 +4153,7 @@ epm_install()
return
0
return
0
fi
fi
if
[
-
z
"
$fil
es
"
]
&&
[
-z
"
$direct
"
]
;
then
if
[
-
n
"
$nam
es
"
]
&&
[
-z
"
$direct
"
]
;
then
# it is useful for first time running
# it is useful for first time running
update_repo_if_needed
update_repo_if_needed
fi
fi
...
@@ -4310,6 +4367,38 @@ epm_install_alt_names()
...
@@ -4310,6 +4367,38 @@ epm_install_alt_names()
epm_install_alt_kernel_module
$kmlist
||
return
epm_install_alt_kernel_module
$kmlist
||
return
}
}
apt_repo_prepare
()
{
assure_exists apt-repo
[
-n
"
$non_interactive
"
]
||
return
set_sudo
trap
"
$SUDO
rm /etc/apt/apt.conf.d/eepm-apt-noninteractive.conf 2>/dev/null"
EXIT
echo
'APT::Get::Assume-Yes "true";'
|
$SUDO
tee
/etc/apt/apt.conf.d/eepm-apt-noninteractive.conf
>
/dev/null
}
apt_repo_after
()
{
[
-n
"
$non_interactive
"
]
||
return
$SUDO
rm
/etc/apt/apt.conf.d/eepm-apt-noninteractive.conf 2>/dev/null
}
epm_install_alt_tasks
()
{
local
res
# TODO: don't use apt-repo
apt_repo_prepare
sudocmd_foreach
"apt-repo test"
$(
tasknumber
"
$@
"
)
res
=
$?
apt_repo_after
return
$res
}
# File bin/epm-install-apt-dpkg:
# File bin/epm-install-apt-dpkg:
epm_install_files_apt_dpkg
()
epm_install_files_apt_dpkg
()
...
@@ -4656,6 +4745,8 @@ epm_kernel_update()
...
@@ -4656,6 +4745,8 @@ epm_kernel_update()
{
{
warmup_bases
warmup_bases
update_repo_if_needed
info
"Updating system kernel to the latest version..."
info
"Updating system kernel to the latest version..."
case
$BASEDISTRNAME
in
case
$BASEDISTRNAME
in
...
@@ -5627,6 +5718,7 @@ __list_installed_app()
...
@@ -5627,6 +5718,7 @@ __list_installed_app()
{
{
local
i
local
i
local
tapt
=
"
$(
mktemp
)
"
||
fatal
local
tapt
=
"
$(
mktemp
)
"
||
fatal
remove_on_exit
$tapt
__list_app_packages_table
>
$tapt
__list_app_packages_table
>
$tapt
# get all installed packages and convert it to a apps list
# get all installed packages and convert it to a apps list
for
i
in
$(
epm query
--short
$(
cat
$tapt
|
sed
-e
's| .*$||'
)
2>/dev/null
)
;
do
for
i
in
$(
epm query
--short
$(
cat
$tapt
|
sed
-e
's| .*$||'
)
2>/dev/null
)
;
do
...
@@ -5642,8 +5734,9 @@ __list_installed_packages()
...
@@ -5642,8 +5734,9 @@ __list_installed_packages()
{
{
local
i
local
i
local
tapt
=
"
$(
mktemp
)
"
||
fatal
local
tapt
=
"
$(
mktemp
)
"
||
fatal
remove_on_exit
$tapt
__list_app_packages_table
>
$tapt
__list_app_packages_table
>
$tapt
# get all installed packages
and convert it to a apps list
# get all installed packages
for
i
in
$(
epm query
--short
$(
cat
$tapt
|
sed
-e
's| .*$||'
)
2>/dev/null
)
;
do
for
i
in
$(
epm query
--short
$(
cat
$tapt
|
sed
-e
's| .*$||'
)
2>/dev/null
)
;
do
grep
"^
$i
"
$tapt
|
cut
-f1
-d
" "
grep
"^
$i
"
$tapt
|
cut
-f1
-d
" "
done
done
...
@@ -5678,6 +5771,8 @@ __epm_play_run()
...
@@ -5678,6 +5771,8 @@ __epm_play_run()
# keep EPM_AUTO for non epm code (epm uses EPM_OPTIONS now)
# keep EPM_AUTO for non epm code (epm uses EPM_OPTIONS now)
[
-n
"
$non_interactive
"
]
&&
export
EPM_AUTO
=
"--auto"
[
-n
"
$non_interactive
"
]
&&
export
EPM_AUTO
=
"--auto"
export
EPM_OPTIONS
=
"
$EPM_OPTIONS
$dryrun
"
local
bashopt
=
''
local
bashopt
=
''
[
-n
"
$verbose
"
]
&&
bashopt
=
'-x'
[
-n
"
$verbose
"
]
&&
bashopt
=
'-x'
#info "Running $($script --description 2>/dev/null) ..."
#info "Running $($script --description 2>/dev/null) ..."
...
@@ -5689,14 +5784,18 @@ __epm_play_list_installed()
...
@@ -5689,14 +5784,18 @@ __epm_play_list_installed()
local
i
local
i
if
[
-n
"
$short
"
]
;
then
if
[
-n
"
$short
"
]
;
then
for
i
in
$(
__list_installed_app
)
;
do
for
i
in
$(
__list_installed_app
)
;
do
# skip hidden apps
local
desc
=
"
$(
__get_app_description
$i
)
"
[
-n
"
$desc
"
]
||
continue
echo
"
$i
"
echo
"
$i
"
done
done
exit
exit
fi
fi
[
-n
"
$quiet
"
]
||
echo
"Installed applications:"
[
-n
"
$quiet
"
]
||
echo
"Installed applications:"
for
i
in
$(
__list_installed_app
)
;
do
for
i
in
$(
__list_installed_app
)
;
do
# skip hidden apps
local
desc
=
"
$(
__get_app_description
$i
)
"
local
desc
=
"
$(
__get_app_description
$i
)
"
#
[ -n "$desc" ] || continue
[
-n
"
$desc
"
]
||
continue
[
-n
"
$quiet
"
]
||
echo
-n
" "
[
-n
"
$quiet
"
]
||
echo
-n
" "
printf
"%-20s - %s
\n
"
"
$i
"
"
$desc
"
printf
"%-20s - %s
\n
"
"
$i
"
"
$desc
"
done
done
...
@@ -5939,6 +6038,7 @@ case "$1" in
...
@@ -5939,6 +6038,7 @@ case "$1" in
local
list
local
list
if
[
"
$1
"
=
"all"
]
;
then
if
[
"
$1
"
=
"all"
]
;
then
shift
shift
info
"Retrieving list of installed apps ..."
list
=
"
$(
__list_installed_app
)
"
list
=
"
$(
__list_installed_app
)
"
else
else
list
=
"
$*
"
list
=
"
$*
"
...
@@ -5961,6 +6061,7 @@ case "$1" in
...
@@ -5961,6 +6061,7 @@ case "$1" in
local
list
local
list
if
[
"
$1
"
=
"all"
]
;
then
if
[
"
$1
"
=
"all"
]
;
then
shift
shift
info
"Retrieving list of installed apps ..."
list
=
"
$(
__list_installed_app
)
"
list
=
"
$(
__list_installed_app
)
"
else
else
list
=
"
$*
"
list
=
"
$*
"
...
@@ -8951,6 +9052,7 @@ __epm_repack_to_rpm()
...
@@ -8951,6 +9052,7 @@ __epm_repack_to_rpm()
# for tarballs fix permissions
# for tarballs fix permissions
[
-n
"
$VERSION
"
]
&&
chmod
$verbose
-R
a+rX
$buildroot
/
*
[
-n
"
$VERSION
"
]
&&
chmod
$verbose
-R
a+rX
$buildroot
/
*
# run generic scripts and repack script for the pkg
cd
$buildroot
||
fatal
cd
$buildroot
||
fatal
__fix_spec
$pkgname
$buildroot
$spec
__fix_spec
$pkgname
$buildroot
$spec
__apply_fix_code
"generic"
$buildroot
$spec
$pkgname
$abspkg
__apply_fix_code
"generic"
$buildroot
$spec
$pkgname
$abspkg
...
@@ -9035,15 +9137,18 @@ epm_repo()
...
@@ -9035,15 +9137,18 @@ epm_repo()
# TODO: check for ALT
# TODO: check for ALT
sudocmd apt-repo
$dryrun
clean
sudocmd apt-repo
$dryrun
clean
;;
;;
save
)
save
)
# HELPCMD: save sources lists to a temp place
epm_reposave
"
$@
"
epm_reposave
"
$@
"
;;
;;
restore
)
restore
)
# HELPCMD: restore sources lists from a temp place
epm_reporestore
"
$@
"
epm_reporestore
"
$@
"
;;
;;
reset
)
reset
)
epm_reporeset
"
$@
"
epm_reporeset
"
$@
"
;;
;;
status
)
epm_repostatus
"
$@
"
;;
add
)
# HELPCMD: add package repo (etersoft, autoimports, archive 2017/12/31); run with param to get list
add
)
# HELPCMD: add package repo (etersoft, autoimports, archive 2017/12/31); run with param to get list
epm_addrepo
"
$@
"
epm_addrepo
"
$@
"
;;
;;
...
@@ -9988,7 +10093,7 @@ esac
...
@@ -9988,7 +10093,7 @@ esac
SAVELISTDIR
=
/tmp
/eepm-etc-save
SAVELISTDIR
=
$epm_vardir
/eepm-etc-save
__save_alt_repo_lists
()
__save_alt_repo_lists
()
{
{
assure_root
assure_root
...
@@ -10077,6 +10182,13 @@ esac
...
@@ -10077,6 +10182,13 @@ esac
epm_reporeset
()
epm_reporeset
()
{
{
case
$BASEDISTRNAME
in
alt
)
sudoepm repo
set
$DISTRVERSION
return
;;
esac
case
$PMTYPE
in
case
$PMTYPE
in
winget
)
winget
)
sudocmd winget
source
reset
sudocmd winget
source
reset
...
@@ -10088,6 +10200,29 @@ esac
...
@@ -10088,6 +10200,29 @@ esac
}
}
epm_repostatus
()
{
case
$PMTYPE
in
apt-
*
)
if
[
-n
"
$short
"
]
;
then
local
days
days
=
"
$(
__epm_check_apt_db_days
)
"
&&
return
0
echo
"
$days
"
return
1
else
local
days
days
=
"
$(
__epm_check_apt_db_days
)
"
&&
info
"APT database is actual."
&&
return
0
info
"APT database is
$days
."
return
1
fi
;;
*
)
fatal
"Have no suitable command for
$PMTYPE
"
;;
esac
}
# File bin/epm-requires:
# File bin/epm-requires:
...
@@ -11305,6 +11440,7 @@ get_only_installed_packages()
...
@@ -11305,6 +11440,7 @@ get_only_installed_packages()
__epm_print_warning_for_nonalt_packages
()
__epm_print_warning_for_nonalt_packages
()
{
{
[
-n
"
$dryrun
"
]
&&
return
0
# only ALT
# only ALT
[
"
$BASEDISTRNAME
"
=
"alt"
]
||
return
0
[
"
$BASEDISTRNAME
"
=
"alt"
]
||
return
0
...
@@ -11332,6 +11468,7 @@ __epm_check_vendor()
...
@@ -11332,6 +11468,7 @@ __epm_check_vendor()
{
{
# don't check vendor if there are forced script options
# don't check vendor if there are forced script options
[
-n
"
$scripts$noscripts
"
]
&&
return
[
-n
"
$scripts$noscripts
"
]
&&
return
[
-n
"
$dryrun
"
]
&&
return
0
# only ALT
# only ALT
[
"
$BASEDISTRNAME
"
=
"alt"
]
||
return
0
[
"
$BASEDISTRNAME
"
=
"alt"
]
||
return
0
...
@@ -12162,6 +12299,8 @@ case $PMTYPE in
...
@@ -12162,6 +12299,8 @@ case $PMTYPE in
;;
;;
esac
esac
__epm_touch_pkg
__save_available_packages
__save_available_packages
return
0
return
0
...
@@ -12240,7 +12379,7 @@ epm_upgrade()
...
@@ -12240,7 +12379,7 @@ epm_upgrade()
case
$PMTYPE
in
case
$PMTYPE
in
apt-rpm|apt-dpkg
)
apt-rpm|apt-dpkg
)
local
APTOPTIONS
=
"
$(
subst_option non_interactive
-y
)
$(
subst_option verbose
"-V -o Debug::pkgMarkInstall=1 -o Debug::pkgProblemResolver=1"
)
"
local
APTOPTIONS
=
"
$
dryrun
$
(
subst_option non_interactive
-y
)
$(
subst_option verbose
"-V -o Debug::pkgMarkInstall=1 -o Debug::pkgProblemResolver=1"
)
"
CMD
=
"apt-get
$APTOPTIONS
$noremove
$force_yes
dist-upgrade"
CMD
=
"apt-get
$APTOPTIONS
$noremove
$force_yes
dist-upgrade"
;;
;;
aptitude-dpkg
)
aptitude-dpkg
)
...
@@ -14018,6 +14157,9 @@ while [ -n "$1" ] ; do
...
@@ -14018,6 +14157,9 @@ while [ -n "$1" ] ; do
-O-
)
-O-
)
TARGETFILE
=
"-"
TARGETFILE
=
"-"
;;
;;
-
*
)
fatal
"Unknown option '
$1
', check eget --help."
;;
*
)
*
)
break
break
;;
;;
...
@@ -14919,13 +15061,16 @@ if [ -n "$2" ] ; then
...
@@ -14919,13 +15061,16 @@ if [ -n "$2" ] ; then
else
else
# do not support / at the end without separately specified mask
# do not support / at the end without separately specified mask
if
echo
"
$1
"
|
grep
-q
"/$"
;
then
if
echo
"
$1
"
|
grep
-q
"/$"
;
then
fatal
"Use http://example.com/e/* to download all files in dir"
#fatal "Use http://example.com/e/* to download all files in dir"
URL
=
"
$1
"
MASK
=
""
else
# drop mask part
URL
=
"
$(
dirname
"
$1
"
)
/"
# wildcards allowed only in the last part of path
MASK
=
$(
basename
"
$1
"
)
fi
fi
# drop mask part
URL
=
"
$(
dirname
"
$1
"
)
/"
# wildcards allowed only in the last part of path
MASK
=
$(
basename
"
$1
"
)
fi
fi
# https://www.freeoffice.com/download.php?filename=freeoffice-2021-1062.x86_64.rpm
# https://www.freeoffice.com/download.php?filename=freeoffice-2021-1062.x86_64.rpm
...
@@ -16648,7 +16793,7 @@ Popular commands:
...
@@ -16648,7 +16793,7 @@ Popular commands:
epm play [application] - install the application (run without params to get list of available apps)
epm play [application] - install the application (run without params to get list of available apps)
epm qf (<command>|<path>) - print what package contains this command (file)
epm qf (<command>|<path>) - print what package contains this command (file)
epm sf <name> - search for the name in all files of all packages
epm sf <name> - search for the name in all files of all packages
epm cl <package name> - pint changelog for the package
epm cl <package name> - p
r
int changelog for the package
EOF
EOF
}
}
...
...
packed/serv.sh
View file @
5fb77cf4
...
@@ -33,7 +33,7 @@ SHAREDIR=$PROGDIR
...
@@ -33,7 +33,7 @@ SHAREDIR=$PROGDIR
# will replaced with /etc/eepm during install
# will replaced with /etc/eepm during install
CONFIGDIR
=
$PROGDIR
/../etc
CONFIGDIR
=
$PROGDIR
/../etc
EPMVERSION
=
"3.55.
7
"
EPMVERSION
=
"3.55.
8
"
# package, single (file), pipe, git
# package, single (file), pipe, git
EPMMODE
=
"package"
EPMMODE
=
"package"
...
@@ -500,13 +500,14 @@ esu()
...
@@ -500,13 +500,14 @@ esu()
else
else
# just shell
# just shell
showcmd
"su -"
showcmd
"su -"
exec
su -
a
=
exec
su -
fi
fi
fi
fi
set_pm_type
set_pm_type
escape_args
()
escape_args
()
{
{
local
output
=
''
local
output
=
''
...
@@ -529,11 +530,11 @@ esu()
...
@@ -529,11 +530,11 @@ esu()
#info "Enter root password:"
#info "Enter root password:"
if
[
-n
"
$*
"
]
;
then
if
[
-n
"
$*
"
]
;
then
[
-n
"
$quiet
"
]
||
showcmd
"su - -c
$escaped
"
[
-n
"
$quiet
"
]
||
showcmd
"su - -c
$escaped
"
exec
su -
-c
"
$escaped
"
a
=
exec
su -
-c
"
$escaped
"
else
else
# just shell
# just shell
showcmd
"su -"
showcmd
"su -"
exec
su -
a
=
exec
su -
fi
fi
fi
fi
...
@@ -557,10 +558,13 @@ regexp_subst()
...
@@ -557,10 +558,13 @@ regexp_subst()
assure_exists
()
assure_exists
()
{
{
local
package
=
"
$2
"
local
package
=
"
$2
"
local
textpackage
=
[
-n
"
$package
"
]
||
package
=
"
$(
__get_package_for_command
"
$1
"
)
"
[
-n
"
$package
"
]
||
package
=
"
$(
__get_package_for_command
"
$1
"
)
"
[
-n
"
$3
"
]
&&
textpackage
=
" >=
$3
"
(
direct
=
''
epm_assure
"
$1
"
$package
$3
)
||
fatal
"Can't assure in '
$1
' command from
$package$textpackage
package"
# ask for install: https://bugzilla.altlinux.org/42240
local
ask
=
''
[
-n
"
$non_interactive
"
]
||
ask
=
1
(
direct
=
''
interactive
=
$ask
epm_assure
"
$1
"
$package
$3
)
||
fatal
}
}
assure_exists_erc
()
assure_exists_erc
()
...
...
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