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
7a2f045b
Commit
7a2f045b
authored
May 14, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit packed 3.56.0
parent
70dff585
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
216 additions
and
162 deletions
+216
-162
epm.sh
packed/epm.sh
+182
-155
serv.sh
packed/serv.sh
+34
-7
No files found.
packed/epm.sh
View file @
7a2f045b
...
@@ -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.5
5.8
"
EPMVERSION
=
"3.5
6.0
"
# package, single (file), pipe, git
# package, single (file), pipe, git
EPMMODE
=
"package"
EPMMODE
=
"package"
...
@@ -47,9 +47,14 @@ fi
...
@@ -47,9 +47,14 @@ fi
load_helper
()
load_helper
()
{
{
local
shieldname
=
"loaded
$(
echo
"
$1
"
|
sed
-e
's|-||g'
)
"
# already loaded
eval
"test -n
\"\$
$shieldname
\"
"
&&
debug
"Already loaded
$1
"
&&
return
local
CMD
=
"
$SHAREDIR
/
$1
"
local
CMD
=
"
$SHAREDIR
/
$1
"
# do not use fatal() here, it can be initial state
# do not use fatal() here, it can be initial state
[
-r
"
$CMD
"
]
||
{
echo
"FATAL: Have no
$CMD
helper file"
;
exit
1
;
}
[
-r
"
$CMD
"
]
||
{
echo
"FATAL: Have no
$CMD
helper file"
;
exit
1
;
}
eval
"
$shieldname
=1"
# shellcheck disable=SC1090
# shellcheck disable=SC1090
.
$CMD
.
$CMD
}
}
...
@@ -274,7 +279,7 @@ subst_option()
...
@@ -274,7 +279,7 @@ subst_option()
store_output
()
store_output
()
{
{
# use make_temp_file from etersoft-build-utils
# use make_temp_file from etersoft-build-utils
RC_STDOUT
=
"
$(
mktemp
)
"
RC_STDOUT
=
"
$(
mktemp
)
"
||
fatal
local
CMDSTATUS
=
$RC_STDOUT
.pipestatus
local
CMDSTATUS
=
$RC_STDOUT
.pipestatus
echo
1
>
$CMDSTATUS
echo
1
>
$CMDSTATUS
#RC_STDERR=$(mktemp)
#RC_STDERR=$(mktemp)
...
@@ -305,7 +310,7 @@ epm()
...
@@ -305,7 +310,7 @@ epm()
# run epm again to full initialization
# run epm again to full initialization
local
bashopt
=
''
local
bashopt
=
''
[
-n
"
$
verbose
"
]
&&
bashopt
=
'-x'
[
-n
"
$
debug
"
]
&&
bashopt
=
'-x'
$CMDSHELL
$bashopt
$PROGDIR
/
$PROGNAME
--inscript
"
$@
"
$CMDSHELL
$bashopt
$PROGDIR
/
$PROGNAME
--inscript
"
$@
"
}
}
...
@@ -315,7 +320,7 @@ sudoepm()
...
@@ -315,7 +320,7 @@ sudoepm()
[
"
$EPMMODE
"
=
"pipe"
]
&&
fatal
"Can't use sudo epm call from the piped script"
[
"
$EPMMODE
"
=
"pipe"
]
&&
fatal
"Can't use sudo epm call from the piped script"
local
bashopt
=
''
local
bashopt
=
''
[
-n
"
$
verbose
"
]
&&
bashopt
=
'-x'
[
-n
"
$
debug
"
]
&&
bashopt
=
'-x'
sudorun
$CMDSHELL
$bashopt
$PROGDIR
/
$PROGNAME
--inscript
"
$@
"
sudorun
$CMDSHELL
$bashopt
$PROGDIR
/
$PROGNAME
--inscript
"
$@
"
}
}
...
@@ -331,6 +336,18 @@ fatal()
...
@@ -331,6 +336,18 @@ fatal()
exit
1
exit
1
}
}
debug
()
{
[
-n
"
$debug
"
]
||
return
if
[
-z
"
$TEXTDOMAIN
"
]
;
then
set_color
$YELLOW
>
&2
echo
-n
"WARNING: "
>
&2
restore_color
>
&2
echo
"
$*
"
>
&2
fi
}
warning
()
warning
()
{
{
if
[
-z
"
$TEXTDOMAIN
"
]
;
then
if
[
-z
"
$TEXTDOMAIN
"
]
;
then
...
@@ -592,15 +609,21 @@ disabled_eget()
...
@@ -592,15 +609,21 @@ disabled_eget()
$EGET
"
$@
"
$EGET
"
$@
"
}
}
disabled_erc
()
{
__epm_assure_7zip
()
{
# install 7zip in any case (can be used)
# install 7zip in any case (can be used)
if
is_command 7z
||
is_command 7za
||
is_command 7zr
||
is_command 7zz
;
then
if
is_command 7z
||
is_command 7za
||
is_command 7zr
||
is_command 7zz
;
then
:
:
else
else
epm
install
p7zip
epm
install
p7zip
fi
fi
}
disabled_erc
()
{
__epm_assure_7zip
# use internal eget only if exists
# use internal eget only if exists
if
[
-s
$SHAREDIR
/tools_erc
]
;
then
if
[
-s
$SHAREDIR
/tools_erc
]
;
then
...
@@ -878,6 +901,7 @@ subst()
...
@@ -878,6 +901,7 @@ subst()
fi
fi
check_core_commands
()
check_core_commands
()
{
{
#which which >/dev/null || fatal "Can't find which command (which or debianutils package is missed?)"
#which which >/dev/null || fatal "Can't find which command (which or debianutils package is missed?)"
...
@@ -1358,7 +1382,8 @@ esac
...
@@ -1358,7 +1382,8 @@ esac
__check_command_in_path
()
__check_command_in_path
()
{
{
PATH
=
$PATH
:/sbin:/usr/sbin print_command_path
"
$1
"
# with hack for sudo case
(
PATH
=
$PATH
:/sbin:/usr/sbin print_command_path
"
$1
"
)
}
}
__epm_need_update
()
__epm_need_update
()
...
@@ -2247,7 +2272,9 @@ epm_checkpkg()
...
@@ -2247,7 +2272,9 @@ epm_checkpkg()
__alt_fix_triggers
()
__alt_fix_triggers
()
{
{
local
TDIR
=
"
$(
mktemp
-d
)
"
local
TDIR
TDIR
=
"
$(
mktemp
-d
)
"
||
fatal
remote_on_exit
$TDIR
assure_exists
time
assure_exists
time
touch
$TDIR
/added
touch
$TDIR
/added
for
ft
in
$(
ls
/usr/lib/rpm/
*
.filetrigger |
sort
)
;
do
for
ft
in
$(
ls
/usr/lib/rpm/
*
.filetrigger |
sort
)
;
do
...
@@ -2821,8 +2848,8 @@ __download_pkg_urls()
...
@@ -2821,8 +2848,8 @@ __download_pkg_urls()
local
url
local
url
[
-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
remove_on_exit
"
$tmppkg
"
tmppkg
=
"
$(
mktemp
-d
)
"
||
fatal
docmd
chmod
$verbose
a+rX
$tmppkg
docmd
chmod
$verbose
a+rX
$tmppkg
showcmd
cd
$tmppkg
showcmd
cd
$tmppkg
cd
$tmppkg
||
fatal
cd
$tmppkg
||
fatal
...
@@ -2897,7 +2924,8 @@ __epm_print_url_alt_check()
...
@@ -2897,7 +2924,8 @@ __epm_print_url_alt_check()
{
{
local
pkg
=
$1
local
pkg
=
$1
shift
shift
local
tm
=
"
$(
mktemp
)
"
local
tm
tm
=
"
$(
mktemp
)
"
||
fatal
assure_exists curl
assure_exists curl
quiet
=
1
quiet
=
1
local
buildtime
=
$(
paoapi packages/
$pkg
| get_pao_var buildtime
)
local
buildtime
=
$(
paoapi packages/
$pkg
| get_pao_var buildtime
)
...
@@ -3386,7 +3414,7 @@ epm_full_upgrade()
...
@@ -3386,7 +3414,7 @@ epm_full_upgrade()
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
$(
subst_option non_interactive
--assume
-
yes
)
$(
subst_option dryrun
--no-deploy
)
docmd flatpak update
$(
subst_option non_interactive
--assumeyes
)
$(
subst_option dryrun
--no-deploy
)
fi
fi
fi
fi
...
@@ -4057,6 +4085,11 @@ epm_install_files()
...
@@ -4057,6 +4085,11 @@ epm_install_files()
return
return
fi
fi
if
[
-n
"
$put_to_repo
"
]
;
then
epm_put_to_repo
$files
return
fi
case
$PMTYPE
in
case
$PMTYPE
in
packagekit
)
packagekit
)
...
@@ -4228,6 +4261,11 @@ epm_install_files_alt()
...
@@ -4228,6 +4261,11 @@ epm_install_files_alt()
return
return
fi
fi
if
[
-n
"
$put_to_repo
"
]
;
then
epm_put_to_repo
$files
return
fi
__epm_check_if_src_rpm
$files
__epm_check_if_src_rpm
$files
if
[
-z
"
$repacked_pkgs
"
]
;
then
if
[
-z
"
$repacked_pkgs
"
]
;
then
...
@@ -4422,6 +4460,12 @@ epm_install_files_apt_dpkg()
...
@@ -4422,6 +4460,12 @@ epm_install_files_apt_dpkg()
return
return
fi
fi
if
[
-n
"
$put_to_repo
"
]
;
then
epm_put_to_repo
$files
return
fi
# TODO: if dpkg can't install due missed deps, trying with apt (as for now, --refuse-depends, --refuse-breaks don't help me)
# TODO: if dpkg can't install due missed deps, trying with apt (as for now, --refuse-depends, --refuse-breaks don't help me)
if
[
-n
"
$nodeps
"
]
;
then
if
[
-n
"
$nodeps
"
]
;
then
...
@@ -4686,7 +4730,7 @@ epm_install_files_rpm()
...
@@ -4686,7 +4730,7 @@ epm_install_files_rpm()
{
{
local
files
=
"
$*
"
local
files
=
"
$*
"
[
-z
"
$files
"
]
&&
return
[
-z
"
$files
"
]
&&
return
if
__epm_repack_if_needed
$files
;
then
if
__epm_repack_if_needed
$files
;
then
[
-n
"
$repacked_pkgs
"
]
||
fatal
"Can't convert
$files
"
[
-n
"
$repacked_pkgs
"
]
||
fatal
"Can't convert
$files
"
files
=
"
$repacked_pkgs
"
files
=
"
$repacked_pkgs
"
...
@@ -4698,6 +4742,12 @@ epm_install_files_rpm()
...
@@ -4698,6 +4742,12 @@ epm_install_files_rpm()
return
return
fi
fi
if
[
-n
"
$put_to_repo
"
]
;
then
epm_put_to_repo
$files
return
fi
__epm_check_if_src_rpm
$files
__epm_check_if_src_rpm
$files
# --replacepkgs: Install the Package Even If Already Installed
# --replacepkgs: Install the Package Even If Already Installed
...
@@ -5329,40 +5379,48 @@ esac
...
@@ -5329,40 +5379,48 @@ esac
[
-n
"
$EPM_PACK_SCRIPTS_DIR
"
]
||
EPM_PACK_SCRIPTS_DIR
=
"
$CONFIGDIR
/pack.d"
[
-n
"
$EPM_PACK_SCRIPTS_DIR
"
]
||
EPM_PACK_SCRIPTS_DIR
=
"
$CONFIGDIR
/pack.d"
__epm_pack_run_handler
()
__epm_pack
()
{
{
local
packname
=
"
$1
"
local
packname
=
"
$1
"
local
tarname
=
"
$2
"
local
tarname
=
"
$2
"
local
packversion
=
"
$3
"
local
packversion
=
"
$3
"
local
url
=
"
$3
"
returntarname
=
''
returntarname
=
''
local
repackcode
=
"
$EPM_PACK_SCRIPTS_DIR
/
$packname
.sh"
local
repackcode
=
"
$EPM_PACK_SCRIPTS_DIR
/
$packname
.sh"
[
-x
"
$repackcode
"
]
||
fatal
"Can't find script
$repackcode
for packname
$packname
"
[
-x
"
$repackcode
"
]
||
return
[
-f
"
$repackcode
.rpmnew"
]
&&
warning
"There is .rpmnew file(s) in
$EPM_PACK_SCRIPTS_DIR
dir. The pack script can be outdated."
[
-f
"
$repackcode
.rpmnew"
]
&&
warning
"There is .rpmnew file(s) in
$EPM_PACK_SCRIPTS_DIR
dir. The pack script can be outdated."
# a file to keep filename of generated tarball
# a file to keep filename of generated tarball
filefortarname
=
"
$(
pwd
)
/filefortarname"
filefortarname
=
"
$(
pwd
)
/filefortarname"
set_sudo
[
"
$PROGDIR
"
=
"/usr/bin"
]
&&
SCPATH
=
"
$PATH
"
||
SCPATH
=
"
$PROGDIR
:
$PATH
"
export
SUDO
# TODO: inside () ?
export
PATH
=
$PROGDIR
:
$PATH
local
bashopt
=
''
local
bashopt
=
''
[
-n
"
$
verbose
"
]
&&
bashopt
=
'-x'
[
-n
"
$
debug
"
]
&&
bashopt
=
'-x'
#info "Running $($script --description 2>/dev/null) ..."
#info "Running $($script --description 2>/dev/null) ..."
(
unset
EPMCURDIR
;
docmd
$CMDSHELL
$bashopt
$repackcode
"
$tarname
"
"
$filefortarname
"
"
$packversion
"
)
||
fatal
# TODO: add url info here
(
unset
EPMCURDIR
;
export
PATH
=
$SCPATH
;
docmd
$CMDSHELL
$bashopt
$repackcode
"
$tarname
"
"
$filefortarname
"
"
$packversion
"
"
$url
"
)
||
fatal
returntarname
=
"
$(
cat
"
$filefortarname
"
)
"
||
fatal
"pack script
$repackcode
didn't set tarname"
returntarname
=
"
$(
cat
"
$filefortarname
"
)
"
||
fatal
"pack script
$repackcode
didn't set tarname"
[
-s
"
$returntarname
"
]
||
fatal
"pack script for
$packname
return unexist
$returntarname
file"
return
0
}
__epm_pack
()
{
local
packname
=
"
$1
"
local
URL
=
"
$4
"
[
-s
"
$returntarname
"
]
||
fatal
"pack script
$repackcode
return unexist
$returntarname
file"
# fills returntarname with packed tar
__epm_pack_run_handler
"
$@
"
||
fatal
"Can't find pack script for packname
$packname
"
if
[
-n
"
$download_only
"
]
;
then
if
[
-n
"
$download_only
"
]
;
then
mv
$returntarname
$EPMCURDIR
mv
$returntarname
$EPMCURDIR
return
return
fi
fi
# TODO: merge eepm.yaml here (common with $returntarname.eepm.yaml)
# add upstream_url: $URL too
# repack if needed
# repack if needed
repacked_pkgs
=
''
repacked_pkgs
=
''
# repack to our target
# repack to our target
...
@@ -5374,6 +5432,7 @@ __epm_pack()
...
@@ -5374,6 +5432,7 @@ __epm_pack()
[
-n
"
$repacked_pkgs
"
]
||
fatal
"Can't repack
$returntarname
"
[
-n
"
$repacked_pkgs
"
]
||
fatal
"Can't repack
$returntarname
"
fi
fi
local
pkgname
if
[
-n
"
$repacked_pkgs
"
]
;
then
if
[
-n
"
$repacked_pkgs
"
]
;
then
# remove packed file if we have repacked one
# remove packed file if we have repacked one
rm
-v
"
$returntarname
"
rm
-v
"
$returntarname
"
...
@@ -5390,7 +5449,9 @@ __epm_pack()
...
@@ -5390,7 +5449,9 @@ __epm_pack()
# we need put result in the cur dir
# we need put result in the cur dir
mv
-v
"
$pkgname
"
$EPMCURDIR
||
fatal
mv
-v
"
$pkgname
"
$EPMCURDIR
||
fatal
[
-r
"
$pkgname
.eepm.yaml"
]
&&
mv
-v
"
$pkgname
.eepm.yaml"
$EPMCURDIR
return
0
}
}
epm_pack_help
()
epm_pack_help
()
...
@@ -5419,16 +5480,19 @@ epm_pack()
...
@@ -5419,16 +5480,19 @@ epm_pack()
exit
exit
fi
fi
local
tmpdir
=
"
$(
mktemp
-d
--tmpdir
=
$BIGTMPDIR
)
"
local
tmpdir
remove_on_exit
$tmpdir
tmpdir
=
"
$(
mktemp
-d
--tmpdir
=
$BIGTMPDIR
)
"
||
fatal
remove_on_exit
"
$tmpdir
"
local
packname
=
"
$1
"
local
packname
=
"
$1
"
local
tarname
=
"
$2
"
local
tarname
=
"
$2
"
local
packversion
=
"
$3
"
local
packversion
=
"
$3
"
local
url
=
''
[
-n
"
$packname
"
]
||
fatal
"run with packname, see --help"
[
-n
"
$packname
"
]
||
fatal
"run with packname, see --help"
if
is_url
"
$tarname
"
;
then
if
is_url
"
$tarname
"
;
then
url
=
"
$tarname
"
pkg_urls
=
"
$tarname
"
pkg_urls
=
"
$tarname
"
cd
$tmpdir
||
fatal
cd
$tmpdir
||
fatal
__handle_pkg_urls_to_install
__handle_pkg_urls_to_install
...
@@ -5436,17 +5500,16 @@ epm_pack()
...
@@ -5436,17 +5500,16 @@ epm_pack()
tarname
=
"
$(
realpath
"
$pkg_files
"
)
"
tarname
=
"
$(
realpath
"
$pkg_files
"
)
"
elif
[
-d
"
$tarname
"
]
;
then
elif
[
-d
"
$tarname
"
]
;
then
tarname
=
"
$(
realpath
"
$tarname
"
)
"
tarname
=
"
$(
realpath
"
$tarname
"
)
"
cd
$tmpdir
||
fatal
elif
[
-s
"
$tarname
"
]
;
then
elif
[
-s
"
$tarname
"
]
;
then
# get full path for real name
# get full path for real name
tarname
=
"
$(
realpath
"
$tarname
"
)
"
tarname
=
"
$(
realpath
"
$tarname
"
)
"
cd
$tmpdir
||
fatal
else
else
# just pass name
# just pass name
true
true
fi
fi
__epm_pack
"
$packname
"
"
$tarname
"
"
$packversion
"
cd
$tmpdir
||
fatal
__epm_pack
"
$packname
"
"
$tarname
"
"
$packversion
"
"
$url
"
}
}
...
@@ -5675,7 +5738,8 @@ __run_script()
...
@@ -5675,7 +5738,8 @@ __run_script()
[
-f
"
$script
.rpmnew"
]
&&
warning
"There is .rpmnew file(s) in
$psdir
dir. The play script can be outdated."
[
-f
"
$script
.rpmnew"
]
&&
warning
"There is .rpmnew file(s) in
$psdir
dir. The play script can be outdated."
shift
shift
(
unset
EPMCURDIR
;
export
PATH
=
$PROGDIR
:
$PATH
;
$script
"
$@
"
)
[
"
$PROGDIR
"
=
"/usr/bin"
]
&&
SCPATH
=
"
$PATH
"
||
SCPATH
=
"
$PROGDIR
:
$PATH
"
(
unset
EPMCURDIR
;
export
PATH
=
$SCPATH
;
$script
"
$@
"
)
return
return
}
}
...
@@ -5717,7 +5781,8 @@ __list_app_packages_table()
...
@@ -5717,7 +5781,8 @@ __list_app_packages_table()
__list_installed_app
()
__list_installed_app
()
{
{
local
i
local
i
local
tapt
=
"
$(
mktemp
)
"
||
fatal
local
tapt
tapt
=
"
$(
mktemp
)
"
||
fatal
remove_on_exit
$tapt
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
...
@@ -5733,7 +5798,8 @@ __list_installed_app()
...
@@ -5733,7 +5798,8 @@ __list_installed_app()
__list_installed_packages
()
__list_installed_packages
()
{
{
local
i
local
i
local
tapt
=
"
$(
mktemp
)
"
||
fatal
local
tapt
tapt
=
"
$(
mktemp
)
"
||
fatal
remove_on_exit
$tapt
remove_on_exit
$tapt
__list_app_packages_table
>
$tapt
__list_app_packages_table
>
$tapt
# get all installed packages
# get all installed packages
...
@@ -5763,20 +5829,14 @@ __epm_play_run()
...
@@ -5763,20 +5829,14 @@ __epm_play_run()
local
script
=
"
$psdir
/
$1
.sh"
local
script
=
"
$psdir
/
$1
.sh"
shift
shift
export
PATH
=
$PROGDIR
:
$PATH
local
addopt
addopt
=
"
$dryrun
$non_interactive
"
set_sudo
export
SUDO
# keep EPM_AUTO for non epm code (epm uses EPM_OPTIONS now)
[
-n
"
$non_interactive
"
]
&&
export
EPM_AUTO
=
"--auto"
export
EPM_OPTIONS
=
"
$EPM_OPTIONS
$dryrun
"
local
bashopt
=
''
local
bashopt
=
''
[
-n
"
$
verbose
"
]
&&
bashopt
=
'-x'
[
-n
"
$
debug
"
]
&&
bashopt
=
'-x'
#info "Running $($script --description 2>/dev/null) ..."
#info "Running $($script --description 2>/dev/null) ..."
docmd
$CMDSHELL
$bashopt
$script
"
$@
"
[
"
$PROGDIR
"
=
"/usr/bin"
]
&&
SCPATH
=
"
$PATH
"
||
SCPATH
=
"
$PROGDIR
:
$PATH
"
(
export
EPM_OPTIONS
=
"
$EPM_OPTIONS
$addopt
"
export
PATH
=
$SCPATH
;
docmd
$CMDSHELL
$bashopt
$script
"
$@
"
)
}
}
__epm_play_list_installed
()
__epm_play_list_installed
()
...
@@ -5966,8 +6026,8 @@ __epm_play_download_epm_file()
...
@@ -5966,8 +6026,8 @@ __epm_play_download_epm_file()
{
{
local
target
=
"
$1
"
local
target
=
"
$1
"
local
file
=
"
$2
"
local
file
=
"
$2
"
#
local epmver="$(epm --short --version)"
#
use short version (3.4.5)
local
epmver
=
"
$
EPMVERSION
"
local
epmver
=
"
$
(
epm
--short
--version
)
"
local
URL
=
"https://eepm.ru/releases/
$epmver
/app-versions"
local
URL
=
"https://eepm.ru/releases/
$epmver
/app-versions"
info
"Updating local IPFS DB in
$eget_ipfs_db
file from
$URL
/eget-ipfs-db.txt"
info
"Updating local IPFS DB in
$eget_ipfs_db
file from
$URL
/eget-ipfs-db.txt"
docmd eget
-q
-O
"
$target
"
"
$URL
/
$file
"
&&
return
docmd eget
-q
-O
"
$target
"
"
$URL
/
$file
"
&&
return
...
@@ -5991,8 +6051,9 @@ __epm_play_initialize_ipfs()
...
@@ -5991,8 +6051,9 @@ __epm_play_initialize_ipfs()
fi
fi
# download and merge with local db
# download and merge with local db
local
t
=
$(
mktemp
)
||
fatal
local
t
remove_on_exit
"
$t
"
t
=
$(
mktemp
)
||
fatal
remove_on_exit
$t
__epm_play_download_epm_file
"
$t
"
"eget-ipfs-db.txt"
||
warning
"Can't update IPFS DB"
__epm_play_download_epm_file
"
$t
"
"eget-ipfs-db.txt"
||
warning
"Can't update IPFS DB"
if
[
-s
"
$t
"
]
;
then
if
[
-s
"
$t
"
]
;
then
echo
>>
$t
echo
>>
$t
...
@@ -6143,6 +6204,9 @@ case $PMTYPE in
...
@@ -6143,6 +6204,9 @@ case $PMTYPE in
# FIXME: returns TRUE ever on missed package
# FIXME: returns TRUE ever on missed package
docmd apt-cache policy
$pkg_names
docmd apt-cache policy
$pkg_names
;;
;;
dnf-
*
|
yum-
*
)
docmd dnf info
$pkg_names
;;
packagekit
)
packagekit
)
docmd pkcon resolve
$pkg_names
docmd pkcon resolve
$pkg_names
;;
;;
...
@@ -8639,9 +8703,7 @@ __epm_have_repack_rule()
...
@@ -8639,9 +8703,7 @@ __epm_have_repack_rule()
[
"
$BASEDISTRNAME
"
=
"alt"
]
||
return
1
[
"
$BASEDISTRNAME
"
=
"alt"
]
||
return
1
# skip for packages built with repack
# skip for packages built with repack
local
packager
=
"
$(
epm print field Packager
for
"
$1
"
2>/dev/null
)
"
epm_status_repacked
"
$1
"
&&
return
1
[
"
$packager
"
=
"EPM <support@etersoft.ru>"
]
&&
return
1
[
"
$packager
"
=
"EPM <support@eepm.ru>"
]
&&
return
1
# FIXME: use real way (for any archive)
# FIXME: use real way (for any archive)
local
pkgname
=
"
$(
epm print name
for
package
"
$1
"
)
"
local
pkgname
=
"
$(
epm print name
for
package
"
$1
"
)
"
...
@@ -8673,16 +8735,6 @@ __epm_split_by_pkg_type()
...
@@ -8673,16 +8735,6 @@ __epm_split_by_pkg_type()
}
}
__set_name_version
()
{
SPEC
=
"
$1
"
PKGNAME
=
"
$2
"
VERSION
=
"
$3
"
[
-n
"
$PKGNAME
"
]
&&
subst
"s|^Name:.*|Name:
$PKGNAME
|"
$SPEC
[
-n
"
$VERSION
"
]
&&
subst
"s|^Version:.*|Version:
$VERSION
|"
$SPEC
}
__check_stoplist
()
__check_stoplist
()
{
{
local
pkg
=
"
$1
"
local
pkg
=
"
$1
"
...
@@ -8693,27 +8745,6 @@ __check_stoplist()
...
@@ -8693,27 +8745,6 @@ __check_stoplist()
}
}
__set_version_pkgname
()
{
local
alpkg
=
"
$1
"
VERSION
=
"
$(
echo
"
$alpkg
"
|
grep
-o
-P
'[-_.][0-9][0-9]*([.]*[0-9])*'
|
head
-n1
|
sed
-e
's|^[-_.]||'
)
"
#"
[
-n
"
$VERSION
"
]
&&
PKGNAME
=
"
$(
echo
"
$alpkg
"
|
sed
-e
"s|[-_.]
$VERSION
.*||"
)
"
# set version as all between name and extension
#local woext="$(echo "alpkg" | sed -e 's|\.tar.*||')"
#if [ "$woext" != "$alpkg" ] ; then
# VERSION="$(echo "$woext" " | sed -e "s|^$PKGNAME[-_.]||")"
#fi
}
__set_version_apppkgname
()
{
local
alpkg
=
"
$1
"
VERSION
=
"
$(
echo
"
$alpkg
"
|
grep
-o
-P
"[-_.a-zA-Z]([0-9])([0-9])*([.]*[0-9])*"
|
head
-n1
|
sed
-e
's|^[-_.a-zA-Z]||'
-e
's|--|-|g'
)
"
#"
[
-n
"
$VERSION
"
]
&&
PKGNAME
=
"
$(
echo
"
$alpkg
"
|
sed
-e
"s|[-_.]
$VERSION
.*||"
)
"
}
__prepare_source_package
()
__prepare_source_package
()
{
{
local
pkg
=
"
$1
"
local
pkg
=
"
$1
"
...
@@ -8729,54 +8760,32 @@ __prepare_source_package()
...
@@ -8729,54 +8760,32 @@ __prepare_source_package()
VERSION
=
''
VERSION
=
''
SUBGENERIC
=
''
SUBGENERIC
=
''
# convert tarballs to tar (for alien)
if
rhas
"
$alpkg
"
"
\.
(rpm|deb)$"
;
then
if
rhas
"
$alpkg
"
"
\.
(rpm|deb)$"
;
then
# skip packing for supported: rpm and deb
return
return
fi
fi
# convert tarballs to tar (for alien)
if
rhas
"
$alpkg
"
"
\.
AppImage$"
;
then
if
rhas
"
$alpkg
"
"
\.
AppImage$"
;
then
__set_version_apppkgname
$alpkg
__epm_pack_run_handler generic-appimage
"
$pkg
"
[
-n
"
$VERSION
"
]
||
fatal
"Can't get version from
$alpkg
."
SUBGENERIC
=
'appimage'
SUBGENERIC
=
'appimage'
# TODO: move repack archive to erc?
elif
rhas
"
$alpkg
"
"
\.
snap$"
;
then
[
-x
"
$alpkg
"
]
||
docmd
chmod
u+x
$verbose
"
$alpkg
"
__epm_pack_run_handler generic-snap
"
$pkg
"
./
$alpkg
--appimage-extract
||
fatal
SUBGENERIC
=
'snap'
alpkg
=
$PKGNAME
-
$VERSION
.tar
else
# make a tar for alien
__epm_pack_run_handler generic-tar
"
$pkg
"
erc a
$alpkg
squashfs-root
return
fi
fi
__set_version_pkgname
$alpkg
alpkg
=
$(
basename
$returntarname
)
if
[
-n
"
$VERSION
"
]
;
then
if
[
"
$(
pwd
)
"
!=
"
$(
dirname
"
$returntarname
"
)
"
]
;
then
# TODO: don't use erc for detect type? then we potentially can skip install it
cp
$verbose
$returntarname
$alpkg
pkgtype
=
"
$(
erc
type
$alpkg
)
"
[
-r
"
$returntarname
.eepm.yaml"
]
&&
cp
$verbose
$returntarname
.eepm.yaml
$alpkg
.eepm.yaml
local
newalpkg
newalpkg
=
$PKGNAME
-
$VERSION
.
$pkgtype
#[ -n "$PKGNAME" ] || PKGNAME=$(basename $alpkg .$pkgtype)
if
[
"
$pkgtype
"
=
"tar"
]
||
[
"
$pkgtype
"
=
"tar.gz"
]
||
[
"
$pkgtype
"
=
"tgz"
]
;
then
# just rename supported formats
if
[
"
$alpkg
"
!=
"
$newalpkg
"
]
;
then
mv
$alpkg
$newalpkg
fi
else
# converts directly unsupported formats
newalpkg
=
$PKGNAME
-
$VERSION
.tar
#newalpkg=$(basename $alpkg .$pkgtype).tar
erc repack
$alpkg
$newalpkg
||
fatal
fi
if
[
"
$alpkg
"
!=
"
$newalpkg
"
]
;
then
rm
-f
$verbose
$alpkg
alpkg
=
$newalpkg
fi
else
warning
"Can't detect version in
$alpkg
. We have almost no chance it will supported in alien."
fi
fi
}
}
__epm_repack
()
__epm_repack
()
{
{
repacked_pkgs
=
''
repacked_pkgs
=
''
...
@@ -8856,7 +8865,8 @@ __epm_repack_to_deb()
...
@@ -8856,7 +8865,8 @@ __epm_repack_to_deb()
repacked_pkgs
=
''
repacked_pkgs
=
''
local
TDIR
=
"
$(
mktemp
-d
--tmpdir
=
$BIGTMPDIR
)
"
local
TDIR
TDIR
=
"
$(
mktemp
-d
--tmpdir
=
$BIGTMPDIR
)
"
||
fatal
remove_on_exit
$TDIR
remove_on_exit
$TDIR
for
pkg
in
$pkgs
;
do
for
pkg
in
$pkgs
;
do
...
@@ -8932,13 +8942,6 @@ __fix_spec()
...
@@ -8932,13 +8942,6 @@ __fix_spec()
fi
fi
done
done
# FIXME: where is a source of the bug with empty Summary?
subst
"s|Summary: *
$|
Summary:
$pkgname
(was empty Summary after alien)|"
$spec
subst
"s|^
\(
Version: .*
\)
~.*|
\1
|"
$spec
subst
"s|^Release: |Release: epm1.repacked.|"
$spec
subst
"s|^Distribution:.*||"
$spec
subst
"s|^
\(
(Converted from a
\)
\(
.*
\)
\(
package.*
\)
|(Repacked from binary
\2
package with epm
$EPMVERSION
)
\n\1
\2
\3
|"
$spec
#" hack for highlight
}
}
...
@@ -8949,16 +8952,14 @@ __apply_fix_code()
...
@@ -8949,16 +8952,14 @@ __apply_fix_code()
[
-f
"
$repackcode
.rpmnew"
]
&&
warning
"There is .rpmnew file(s) in
$EPM_REPACK_SCRIPTS_DIR
dir. The pack script can be outdated."
[
-f
"
$repackcode
.rpmnew"
]
&&
warning
"There is .rpmnew file(s) in
$EPM_REPACK_SCRIPTS_DIR
dir. The pack script can be outdated."
shift
shift
export
PATH
=
$PROGDIR
:
$PATH
[
"
$PROGDIR
"
=
"/usr/bin"
]
&&
SCPATH
=
"
$PATH
"
||
SCPATH
=
"
$PROGDIR
:
$PATH
"
local
bashopt
=
''
local
bashopt
=
''
[
-n
"
$
verbose
"
]
&&
bashopt
=
'-x'
[
-n
"
$
debug
"
]
&&
bashopt
=
'-x'
(
unset
EPMCURDIR
;
docmd
$CMDSHELL
$bashopt
$repackcode
"
$1
"
"
$2
"
"
$3
"
"
$4
"
)
||
fatal
"There is an error from
$repackcode
script"
(
unset
EPMCURDIR
;
export
PATH
=
$SCPATH
;
docmd
$CMDSHELL
$bashopt
$repackcode
"
$1
"
"
$2
"
"
$3
"
"
$4
"
)
||
fatal
"There is an error from
$repackcode
script"
}
}
__create_rpmmacros
()
__create_rpmmacros
()
{
{
[
-n
"
$TMPDIR
"
]
||
TMPDIR
=
/tmp
cat
<<
EOF
>
$HOME
/.rpmmacros
cat
<<
EOF
>
$HOME
/.rpmmacros
%_topdir
$HOME
/RPM
%_topdir
$HOME
/RPM
%_tmppath
$TMPDIR
%_tmppath
$TMPDIR
...
@@ -9005,8 +9006,9 @@ __epm_repack_to_rpm()
...
@@ -9005,8 +9006,9 @@ __epm_repack_to_rpm()
fi
fi
local
pkg
local
pkg
export
HOME
=
"
$(
mktemp
-d
--tmpdir
=
$BIGTMPDIR
)
"
HOME
=
"
$(
mktemp
-d
--tmpdir
=
$BIGTMPDIR
)
"
||
fatal
remove_on_exit
$HOME
remove_on_exit
$HOME
export
HOME
__create_rpmmacros
__create_rpmmacros
local
alpkg
local
alpkg
...
@@ -9025,6 +9027,7 @@ __epm_repack_to_rpm()
...
@@ -9025,6 +9027,7 @@ __epm_repack_to_rpm()
cp
$verbose
$pkg
$tmpbuilddir
/../
$alpkg
cp
$verbose
$pkg
$tmpbuilddir
/../
$alpkg
cd
$tmpbuilddir
/../
||
fatal
cd
$tmpbuilddir
/../
||
fatal
# fill alpkg and SUBGENERIC
__prepare_source_package
"
$pkg
"
__prepare_source_package
"
$pkg
"
cd
$tmpbuilddir
/
||
fatal
cd
$tmpbuilddir
/
||
fatal
...
@@ -9046,14 +9049,11 @@ __epm_repack_to_rpm()
...
@@ -9046,14 +9049,11 @@ __epm_repack_to_rpm()
mv
$spec
$tmpbuilddir
||
fatal
mv
$spec
$tmpbuilddir
||
fatal
spec
=
"
$tmpbuilddir
/
$(
basename
"
$spec
"
)
"
spec
=
"
$tmpbuilddir
/
$(
basename
"
$spec
"
)
"
#__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
[
-n
"
$VERSION
"
]
&&
chmod
$verbose
-R
a+rX
$buildroot
/
*
# run generic scripts and repack script for the pkg
# 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
[
-n
"
$SUBGENERIC
"
]
&&
__apply_fix_code
"generic-
$SUBGENERIC
"
$buildroot
$spec
$pkgname
$abspkg
[
-n
"
$SUBGENERIC
"
]
&&
__apply_fix_code
"generic-
$SUBGENERIC
"
$buildroot
$spec
$pkgname
$abspkg
...
@@ -9068,6 +9068,7 @@ __epm_repack_to_rpm()
...
@@ -9068,6 +9068,7 @@ __epm_repack_to_rpm()
else
else
a
=
''
rpmbuild
--buildroot
$buildroot
--target
$TARGETARCH
-bb
$spec
>
/dev/null
||
fatal
a
=
''
rpmbuild
--buildroot
$buildroot
--target
$TARGETARCH
-bb
$spec
>
/dev/null
||
fatal
fi
fi
# remove copy of source binary package (don't mix with generated)
# remove copy of source binary package (don't mix with generated)
rm
-f
$tmpbuilddir
/../
$alpkg
rm
-f
$tmpbuilddir
/../
$alpkg
local
repacked_rpm
=
"
$(
realpath
$tmpbuilddir
/../
*
.rpm
)
"
local
repacked_rpm
=
"
$(
realpath
$tmpbuilddir
/../
*
.rpm
)
"
...
@@ -9189,8 +9190,8 @@ esac
...
@@ -9189,8 +9190,8 @@ esac
__epm_get_file_from_url
()
__epm_get_file_from_url
()
{
{
local
url
=
"
$1
"
local
url
=
"
$1
"
local
tmpfile
=
$(
mktemp
)
local
tmpfile
remove_on_exit
"
$tmpfile
"
tmpfile
=
$(
mktemp
)
||
fatal
eget
-O
"
$tmpfile
"
"
$url
"
>
/dev/null
eget
-O
"
$tmpfile
"
"
$url
"
>
/dev/null
echo
"
$tmpfile
"
echo
"
$tmpfile
"
}
}
...
@@ -9280,7 +9281,8 @@ __epm_addkey_dnf()
...
@@ -9280,7 +9281,8 @@ __epm_addkey_dnf()
local
target
=
"/etc/yum.repos.d/
$name
.repo"
local
target
=
"/etc/yum.repos.d/
$name
.repo"
[
-s
$target
]
&&
return
[
-s
$target
]
&&
return
local
tmpfile
=
$(
mktemp
)
local
tmpfile
tmpfile
=
$(
mktemp
)
||
fatal
remove_on_exit
$tmpfile
remove_on_exit
$tmpfile
cat
>
$tmpfile
<<
EOF
cat
>
$tmpfile
<<
EOF
[
$name
]
[
$name
]
...
@@ -10088,6 +10090,10 @@ esac
...
@@ -10088,6 +10090,10 @@ esac
}
}
epm_put_to_repo
()
{
epm_repo_pkgupdate
"
$put_to_repo
"
"
$@
"
}
# File bin/epm-reposave:
# File bin/epm-reposave:
...
@@ -10745,7 +10751,8 @@ __epm_restore_meson()
...
@@ -10745,7 +10751,8 @@ __epm_restore_meson()
{
{
local
req_file
=
"
$1
"
local
req_file
=
"
$1
"
if
[
-n
"
$dryrun
"
]
;
then
if
[
-n
"
$dryrun
"
]
;
then
local
lt
=
$(
mktemp
)
local
lt
lt
=
$(
mktemp
)
||
fatal
echo
echo
__epm_restore_print_comment
"
$req_file
"
" dependency"
__epm_restore_print_comment
"
$req_file
"
" dependency"
grep
"dependency("
$req_file
|
sed
-e
's|.*dependency(||'
-e
's|).*||'
-e
's|, required.*||'
-e
's|, version:||'
-e
"s|'||g"
>
$lt
grep
"dependency("
$req_file
|
sed
-e
's|.*dependency(||'
-e
's|).*||'
-e
's|, required.*||'
-e
's|, version:||'
-e
"s|'||g"
>
$lt
...
@@ -10755,7 +10762,8 @@ __epm_restore_meson()
...
@@ -10755,7 +10762,8 @@ __epm_restore_meson()
fi
fi
info
"Install requirements from
$req_file
..."
info
"Install requirements from
$req_file
..."
local
lt
=
$(
mktemp
)
local
lt
lt
=
$(
mktemp
)
||
fatal
grep
"dependency("
$req_file
|
sed
-e
's|.*dependency(||'
-e
's|).*||'
-e
's|, required.*||'
-e
's|, version:||'
-e
"s|'||g"
>
$lt
grep
"dependency("
$req_file
|
sed
-e
's|.*dependency(||'
-e
's|).*||'
-e
's|, required.*||'
-e
's|, version:||'
-e
"s|'||g"
>
$lt
ilist
=
"
$ilist
$(
__epm_print_meson_list
""
$lt
)
"
ilist
=
"
$ilist
$(
__epm_print_meson_list
""
$lt
)
"
...
@@ -10772,7 +10780,8 @@ __epm_restore_npm()
...
@@ -10772,7 +10780,8 @@ __epm_restore_npm()
assure_exists jq
||
fatal
assure_exists jq
||
fatal
if
[
-n
"
$dryrun
"
]
;
then
if
[
-n
"
$dryrun
"
]
;
then
local
lt
=
$(
mktemp
)
local
lt
lt
=
$(
mktemp
)
||
fatal
a
=
jq .dependencies <
$req_file
>
$lt
a
=
jq .dependencies <
$req_file
>
$lt
echo
echo
__epm_restore_print_comment
"
$req_file
"
__epm_restore_print_comment
"
$req_file
"
...
@@ -10787,7 +10796,8 @@ __epm_restore_npm()
...
@@ -10787,7 +10796,8 @@ __epm_restore_npm()
fi
fi
info
"Install requirements from
$req_file
..."
info
"Install requirements from
$req_file
..."
local
lt
=
$(
mktemp
)
local
lt
lt
=
$(
mktemp
)
||
fatal
a
=
jq .dependencies <
$req_file
>
$lt
a
=
jq .dependencies <
$req_file
>
$lt
ilist
=
"
$(
__epm_print_npm_list
""
$lt
)
"
ilist
=
"
$(
__epm_print_npm_list
""
$lt
)
"
a
=
jq .devDependencies <
$req_file
>
$lt
a
=
jq .devDependencies <
$req_file
>
$lt
...
@@ -10801,7 +10811,8 @@ __epm_restore_perl()
...
@@ -10801,7 +10811,8 @@ __epm_restore_perl()
local
req_file
=
"
$1
"
local
req_file
=
"
$1
"
if
[
-n
"
$dryrun
"
]
;
then
if
[
-n
"
$dryrun
"
]
;
then
local
lt
=
$(
mktemp
)
local
lt
lt
=
$(
mktemp
)
||
fatal
a
=
/usr/bin/perl
$req_file
PRINT_PREREQ
=
1
>
$lt
a
=
/usr/bin/perl
$req_file
PRINT_PREREQ
=
1
>
$lt
# all requirements will autodetected during packing, put it to the buildreq
# all requirements will autodetected during packing, put it to the buildreq
echo
echo
...
@@ -10812,7 +10823,8 @@ __epm_restore_perl()
...
@@ -10812,7 +10823,8 @@ __epm_restore_perl()
fi
fi
info
"Install requirements from
$req_file
..."
info
"Install requirements from
$req_file
..."
local
lt
=
$(
mktemp
)
local
lt
lt
=
$(
mktemp
)
||
exit
a
=
/usr/bin/perl
$req_file
PRINT_PREREQ
=
1
>
$lt
a
=
/usr/bin/perl
$req_file
PRINT_PREREQ
=
1
>
$lt
ilist
=
"
$(
__epm_print_perl_list
""
$lt
)
"
ilist
=
"
$(
__epm_print_perl_list
""
$lt
)
"
rm
-f
$lt
rm
-f
$lt
...
@@ -10826,7 +10838,8 @@ __epm_restore_perl_shyaml()
...
@@ -10826,7 +10838,8 @@ __epm_restore_perl_shyaml()
assure_exists shyaml
||
fatal
assure_exists shyaml
||
fatal
if
[
-n
"
$dryrun
"
]
;
then
if
[
-n
"
$dryrun
"
]
;
then
local
lt
=
$(
mktemp
)
local
lt
lt
=
$(
mktemp
)
||
fatal
a
=
shyaml get-value requires <
$req_file
>
$lt
a
=
shyaml get-value requires <
$req_file
>
$lt
# all requirements will autodetected during packing, put it to the buildreq
# all requirements will autodetected during packing, put it to the buildreq
echo
echo
...
@@ -10842,7 +10855,8 @@ __epm_restore_perl_shyaml()
...
@@ -10842,7 +10855,8 @@ __epm_restore_perl_shyaml()
fi
fi
info
"Install requirements from
$req_file
..."
info
"Install requirements from
$req_file
..."
local
lt
=
$(
mktemp
)
local
lt
lt
=
$(
mktemp
)
||
fatal
a
=
shyaml get-value requires <
$req_file
>
$lt
a
=
shyaml get-value requires <
$req_file
>
$lt
ilist
=
"
$(
__epm_print_perl_list
""
$lt
)
"
ilist
=
"
$(
__epm_print_perl_list
""
$lt
)
"
a
=
shyaml get-value build_requires <
$req_file
>
$lt
a
=
shyaml get-value build_requires <
$req_file
>
$lt
...
@@ -11881,7 +11895,8 @@ epm_stats()
...
@@ -11881,7 +11895,8 @@ epm_stats()
__convert_pkgallowscripts_to_regexp
()
__convert_pkgallowscripts_to_regexp
()
{
{
local
tmpalf
=
"
$(
mktemp
)
"
||
fatal
local
tmpalf
tmpalf
=
"
$(
mktemp
)
"
||
fatal
# copied from eget's filter_glob
# copied from eget's filter_glob
# check man glob
# check man glob
# remove commentы and translate glob to regexp
# remove commentы and translate glob to regexp
...
@@ -12028,7 +12043,9 @@ epm_status_thirdparty()
...
@@ -12028,7 +12043,9 @@ epm_status_thirdparty()
local
distribution
local
distribution
distribution
=
"
$(
epm print field Distribution
for
"
$pkg
"
2>/dev/null
)
"
distribution
=
"
$(
epm print field Distribution
for
"
$pkg
"
2>/dev/null
)
"
echo
"
$distribution
"
|
grep
-q
"^ALT"
||
return
0
echo
"
$distribution
"
|
grep
-q
"^ALT"
&&
return
1
echo
"
$distribution
"
|
grep
-q
"^EEPM"
&&
return
1
return
0
;;
;;
*
)
*
)
fatal
"Unsupported
$BASEDISTRNAME
"
fatal
"Unsupported
$BASEDISTRNAME
"
...
@@ -12161,6 +12178,10 @@ epm_tool()
...
@@ -12161,6 +12178,10 @@ epm_tool()
showcmd json
"
$@
"
showcmd json
"
$@
"
$CMDSHELL
internal_tools_json
"
$@
"
$CMDSHELL
internal_tools_json
"
$@
"
;;
;;
"yaml"
)
# HELPCMD: parse yaml operations
showcmd yaml
"
$@
"
$CMDSHELL
$SHAREDIR
/tools_yaml
"
$@
"
;;
"which"
)
"which"
)
print_command_path
"
$@
"
# HELPCMD: which like command (no output to stderr, can works without which package)
print_command_path
"
$@
"
# HELPCMD: which like command (no output to stderr, can works without which package)
;;
;;
...
@@ -16205,8 +16226,6 @@ fi
...
@@ -16205,8 +16226,6 @@ fi
epm_main
()
epm_main
()
{
{
#PATH=$PATH:/sbin:/usr/sbin
set_pm_type
set_pm_type
check_tty
check_tty
...
@@ -16245,6 +16264,7 @@ print_version()
...
@@ -16245,6 +16264,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"
debug
=
verbose
=
$EPM_VERBOSE
verbose
=
$EPM_VERBOSE
quiet
=
quiet
=
nodeps
=
nodeps
=
...
@@ -16370,7 +16390,7 @@ check_command()
...
@@ -16370,7 +16390,7 @@ check_command()
epm_cmd
=
search
epm_cmd
=
search
direct_args
=
1
direct_args
=
1
;;
;;
-qp
|
qp|query_package
)
# HELPCMD: search in the list of installed packages
-qp
|
qp|
grep|
query_package
)
# HELPCMD: search in the list of installed packages
epm_cmd
=
query_package
epm_cmd
=
query_package
;;
;;
-qf
|
qf|-S|wp|which|belongs
)
# HELPCMD: query package(s) owning file
-qf
|
qf|-S|wp|which|belongs
)
# HELPCMD: query package(s) owning file
...
@@ -16623,6 +16643,9 @@ check_option()
...
@@ -16623,6 +16643,9 @@ check_option()
--verbose
)
# HELPOPT: verbose mode
--verbose
)
# HELPOPT: verbose mode
verbose
=
"--verbose"
verbose
=
"--verbose"
;;
;;
--debug
)
# HELPOPT: more debug output mode
debug
=
"--debug"
;;
--skip-installed
)
# HELPOPT: skip already installed packages during install
--skip-installed
)
# HELPOPT: skip already installed packages during install
skip_installed
=
1
skip_installed
=
1
;;
;;
...
@@ -16660,7 +16683,7 @@ check_option()
...
@@ -16660,7 +16683,7 @@ check_option()
repack
=
"--repack"
repack
=
"--repack"
;;
;;
--norepack
)
# HELPOPT: don't repack rpm package(s) if it is by default before install
--norepack
)
# HELPOPT: don't repack rpm package(s) if it is by default before install
repack
=
"--norepack"
no
repack
=
"--norepack"
;;
;;
--install
)
# HELPOPT: install packed rpm package(s)
--install
)
# HELPOPT: install packed rpm package(s)
install
=
"--install"
install
=
"--install"
...
@@ -16671,10 +16694,13 @@ check_option()
...
@@ -16671,10 +16694,13 @@ check_option()
--noscripts
)
# HELPOPT: disable scripts in install packages
--noscripts
)
# HELPOPT: disable scripts in install packages
noscripts
=
"--noscripts"
noscripts
=
"--noscripts"
;;
;;
--save-only
)
# HELPOPT: save the package/tarball after all
convert
ations (instead of install it)
--save-only
)
# HELPOPT: save the package/tarball after all
transform
ations (instead of install it)
save_only
=
"--save-only"
save_only
=
"--save-only"
;;
;;
--download-only
)
# HELPOPT: download only the package/tarball (before any convertation)
--put-to-repo
=
*
)
# HELPOPT: put the package after all transformations to the repo (--put-to-repo=/path/to/repo)
put_to_repo
=
"
$(
echo
"
$1
"
|
sed
-e
's|--put-to-repo=||'
)
"
;;
--download-only
)
# HELPOPT: download only the package/tarball (before any transformation)
download_only
=
"--download-only"
download_only
=
"--download-only"
;;
;;
--url
)
# HELPOPT: print only URL instead of download package
--url
)
# HELPOPT: print only URL instead of download package
...
@@ -16722,6 +16748,7 @@ check_filenames()
...
@@ -16722,6 +16748,7 @@ check_filenames()
[
-n
"
$pkg_urls
"
]
&&
pkg_urls
=
"
$pkg_urls
$opt
"
||
pkg_urls
=
"
$opt
"
[
-n
"
$pkg_urls
"
]
&&
pkg_urls
=
"
$pkg_urls
$opt
"
||
pkg_urls
=
"
$opt
"
else
else
has_space
"
$opt
"
&&
warning
"There are space(s) in package name '
$opt
', it is not supported. Skipped."
&&
continue
has_space
"
$opt
"
&&
warning
"There are space(s) in package name '
$opt
', it is not supported. Skipped."
&&
continue
echo
"
$opt
"
|
grep
-q
"[*]"
&&
warning
"There are forbidden symbols in package name '
$opt
'. Skipped."
&&
continue
[
-n
"
$pkg_names
"
]
&&
pkg_names
=
"
$pkg_names
$opt
"
||
pkg_names
=
"
$opt
"
[
-n
"
$pkg_names
"
]
&&
pkg_names
=
"
$pkg_names
$opt
"
||
pkg_names
=
"
$opt
"
fi
fi
[
-n
"
$quoted_args
"
]
&&
quoted_args
=
"
$quoted_args
\"
$opt
\"
"
||
quoted_args
=
"
\"
$opt
\"
"
[
-n
"
$quoted_args
"
]
&&
quoted_args
=
"
$quoted_args
\"
$opt
\"
"
||
quoted_args
=
"
\"
$opt
\"
"
...
@@ -16758,7 +16785,7 @@ if [ -n "$quiet" ] ; then
...
@@ -16758,7 +16785,7 @@ if [ -n "$quiet" ] ; then
fi
fi
# fill
# fill
export
EPM_OPTIONS
=
"
$nodeps
$force
$verbose
$quiet
$interactive
$non_interactive
$save_only
$download_only
"
export
EPM_OPTIONS
=
"
$nodeps
$force
$verbose
$
debug
$
quiet
$interactive
$non_interactive
$save_only
$download_only
"
# if input is not console and run script from file, get pkgs from stdin too
# if input is not console and run script from file, get pkgs from stdin too
if
[
!
-n
"
$inscript
"
]
&&
!
inputisatty
&&
[
-n
"
$PROGDIR
"
]
;
then
if
[
!
-n
"
$inscript
"
]
&&
!
inputisatty
&&
[
-n
"
$PROGDIR
"
]
;
then
...
...
packed/serv.sh
View file @
7a2f045b
...
@@ -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.5
5.8
"
EPMVERSION
=
"3.5
6.0
"
# package, single (file), pipe, git
# package, single (file), pipe, git
EPMMODE
=
"package"
EPMMODE
=
"package"
...
@@ -48,12 +48,20 @@ fi
...
@@ -48,12 +48,20 @@ fi
load_helper
()
load_helper
()
{
{
local
shieldname
=
"loaded
$(
echo
"
$1
"
|
sed
-e
's|-||g'
)
"
# already loaded
eval
"test -n
\"\$
$shieldname
\"
"
&&
debug
"Already loaded
$1
"
&&
return
local
CMD
=
"
$SHAREDIR
/
$1
"
local
CMD
=
"
$SHAREDIR
/
$1
"
[
-r
"
$CMD
"
]
||
fatal
"Have no
$CMD
helper file"
# do not use fatal() here, it can be initial state
[
-r
"
$CMD
"
]
||
{
echo
"FATAL: Have no
$CMD
helper file"
;
exit
1
;
}
eval
"
$shieldname
=1"
# shellcheck disable=SC1090
.
$CMD
.
$CMD
}
}
# File bin/epm-sh-functions:
# File bin/epm-sh-functions:
...
@@ -272,7 +280,7 @@ subst_option()
...
@@ -272,7 +280,7 @@ subst_option()
store_output
()
store_output
()
{
{
# use make_temp_file from etersoft-build-utils
# use make_temp_file from etersoft-build-utils
RC_STDOUT
=
"
$(
mktemp
)
"
RC_STDOUT
=
"
$(
mktemp
)
"
||
fatal
local
CMDSTATUS
=
$RC_STDOUT
.pipestatus
local
CMDSTATUS
=
$RC_STDOUT
.pipestatus
echo
1
>
$CMDSTATUS
echo
1
>
$CMDSTATUS
#RC_STDERR=$(mktemp)
#RC_STDERR=$(mktemp)
...
@@ -303,7 +311,7 @@ epm()
...
@@ -303,7 +311,7 @@ epm()
# run epm again to full initialization
# run epm again to full initialization
local
bashopt
=
''
local
bashopt
=
''
[
-n
"
$
verbose
"
]
&&
bashopt
=
'-x'
[
-n
"
$
debug
"
]
&&
bashopt
=
'-x'
$CMDSHELL
$bashopt
$PROGDIR
/
$PROGNAME
--inscript
"
$@
"
$CMDSHELL
$bashopt
$PROGDIR
/
$PROGNAME
--inscript
"
$@
"
}
}
...
@@ -313,7 +321,7 @@ sudoepm()
...
@@ -313,7 +321,7 @@ sudoepm()
[
"
$EPMMODE
"
=
"pipe"
]
&&
fatal
"Can't use sudo epm call from the piped script"
[
"
$EPMMODE
"
=
"pipe"
]
&&
fatal
"Can't use sudo epm call from the piped script"
local
bashopt
=
''
local
bashopt
=
''
[
-n
"
$
verbose
"
]
&&
bashopt
=
'-x'
[
-n
"
$
debug
"
]
&&
bashopt
=
'-x'
sudorun
$CMDSHELL
$bashopt
$PROGDIR
/
$PROGNAME
--inscript
"
$@
"
sudorun
$CMDSHELL
$bashopt
$PROGDIR
/
$PROGNAME
--inscript
"
$@
"
}
}
...
@@ -329,6 +337,18 @@ fatal()
...
@@ -329,6 +337,18 @@ fatal()
exit
1
exit
1
}
}
debug
()
{
[
-n
"
$debug
"
]
||
return
if
[
-z
"
$TEXTDOMAIN
"
]
;
then
set_color
$YELLOW
>
&2
echo
-n
"WARNING: "
>
&2
restore_color
>
&2
echo
"
$*
"
>
&2
fi
}
warning
()
warning
()
{
{
if
[
-z
"
$TEXTDOMAIN
"
]
;
then
if
[
-z
"
$TEXTDOMAIN
"
]
;
then
...
@@ -590,15 +610,21 @@ disabled_eget()
...
@@ -590,15 +610,21 @@ disabled_eget()
$EGET
"
$@
"
$EGET
"
$@
"
}
}
disabled_erc
()
{
__epm_assure_7zip
()
{
# install 7zip in any case (can be used)
# install 7zip in any case (can be used)
if
is_command 7z
||
is_command 7za
||
is_command 7zr
||
is_command 7zz
;
then
if
is_command 7z
||
is_command 7za
||
is_command 7zr
||
is_command 7zz
;
then
:
:
else
else
epm
install
p7zip
epm
install
p7zip
fi
fi
}
disabled_erc
()
{
__epm_assure_7zip
# use internal eget only if exists
# use internal eget only if exists
if
[
-s
$SHAREDIR
/tools_erc
]
;
then
if
[
-s
$SHAREDIR
/tools_erc
]
;
then
...
@@ -876,6 +902,7 @@ subst()
...
@@ -876,6 +902,7 @@ subst()
fi
fi
check_core_commands
()
check_core_commands
()
{
{
#which which >/dev/null || fatal "Can't find which command (which or debianutils package is missed?)"
#which which >/dev/null || fatal "Can't find which command (which or debianutils package is missed?)"
...
...
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