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
a897670c
Commit
a897670c
authored
Apr 27, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit packed 3.54.0
parent
a283355b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
237 additions
and
113 deletions
+237
-113
epm.sh
packed/epm.sh
+208
-103
serv.sh
packed/serv.sh
+29
-10
No files found.
packed/epm.sh
View file @
a897670c
...
@@ -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
3.1
"
EPMVERSION
=
"3.5
4.0
"
# package, single (file), pipe, git
# package, single (file), pipe, git
EPMMODE
=
"package"
EPMMODE
=
"package"
...
@@ -333,9 +333,10 @@ sudoepm()
...
@@ -333,9 +333,10 @@ sudoepm()
fatal
()
fatal
()
{
{
if
[
-z
"
$TEXTDOMAIN
"
]
;
then
if
[
-z
"
$TEXTDOMAIN
"
]
;
then
set_color
$RED
set_color
$RED
>
&2
echo
"Error:
$*
(you can discuss the epm
$EPMVERSION
problem in Telegram: https://t.me/useepm)"
>
&2
echo
-n
"ERROR: "
>
&2
restore_color
restore_color
>
&2
echo
"
$*
(you can discuss the epm
$EPMVERSION
problem in Telegram: https://t.me/useepm)"
>
&2
fi
fi
exit
1
exit
1
}
}
...
@@ -343,9 +344,10 @@ fatal()
...
@@ -343,9 +344,10 @@ fatal()
warning
()
warning
()
{
{
if
[
-z
"
$TEXTDOMAIN
"
]
;
then
if
[
-z
"
$TEXTDOMAIN
"
]
;
then
set_color
$YELLOW
set_color
$YELLOW
>
&2
echo
"Warning:
$*
"
>
&2
echo
-n
"WARNING: "
>
&2
restore_color
restore_color
>
&2
echo
"
$*
"
>
&2
fi
fi
}
}
...
@@ -540,13 +542,12 @@ disabled_eget()
...
@@ -540,13 +542,12 @@ disabled_eget()
disabled_erc
()
disabled_erc
()
{
{
if
!
is_command patool
;
then
# 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
fi
# use internal eget only if exists
# use internal eget only if exists
if
[
-s
$SHAREDIR
/tools_erc
]
;
then
if
[
-s
$SHAREDIR
/tools_erc
]
;
then
...
@@ -733,8 +734,12 @@ __epm_remove_from_tmp_files()
...
@@ -733,8 +734,12 @@ __epm_remove_from_tmp_files()
{
{
keep
=
"
$1
"
keep
=
"
$1
"
[
-r
"
$keep
"
]
||
return
0
[
-r
"
$keep
"
]
||
return
0
[
-n
"
$to_remove_pkg_files
"
]
||
return
0
if
[
-n
"
$to_remove_pkg_files
"
]
;
then
to_remove_pkg_files
=
"
$(
echo
"
$to_remove_pkg_files
"
|
sed
-e
"s|
$keep
||"
)
"
to_remove_pkg_files
=
"
$(
echo
"
$to_remove_pkg_files
"
|
sed
-e
"s|
$keep
||"
)
"
fi
if
[
-n
"
$to_remove_tmp_files
"
]
;
then
to_remove_tmp_files
=
"
$(
echo
"
$to_remove_tmp_files
"
|
sed
-e
"s|
$keep
||"
)
"
fi
}
}
__epm_remove_tmp_files
()
__epm_remove_tmp_files
()
...
@@ -743,6 +748,7 @@ __epm_remove_tmp_files()
...
@@ -743,6 +748,7 @@ __epm_remove_tmp_files()
if
[
-z
"
$DEBUG
"
]
;
then
if
[
-z
"
$DEBUG
"
]
;
then
# TODO: reinvent
# TODO: reinvent
[
-n
"
$to_remove_pkg_files
"
]
&&
rm
-f
$to_remove_pkg_files
[
-n
"
$to_remove_pkg_files
"
]
&&
rm
-f
$to_remove_pkg_files
[
-n
"
$to_remove_tmp_files
"
]
&&
rm
-f
$to_remove_tmp_files
# hack??
# hack??
[
-n
"
$to_remove_pkg_files
"
]
&&
rmdir
$(
dirname
$to_remove_pkg_files
|
head
-n1
)
2>/dev/null
[
-n
"
$to_remove_pkg_files
"
]
&&
rmdir
$(
dirname
$to_remove_pkg_files
|
head
-n1
)
2>/dev/null
[
-n
"
$to_remove_pkg_dirs
"
]
&&
rmdir
$to_remove_pkg_dirs
2>/dev/null
[
-n
"
$to_remove_pkg_dirs
"
]
&&
rmdir
$to_remove_pkg_dirs
2>/dev/null
...
@@ -752,6 +758,19 @@ __epm_remove_tmp_files()
...
@@ -752,6 +758,19 @@ __epm_remove_tmp_files()
}
}
remove_on_exit
()
{
trap
"__epm_remove_tmp_files"
EXIT
while
[
-n
"
$1
"
]
;
do
if
[
-d
"
$1
"
]
;
then
to_clean_tmp_dirs
=
"
$to_clean_tmp_dirs
$1
"
elif
[
-f
"
$1
"
]
;
then
to_clean_tmp_files
=
"
$to_clean_tmp_files
$1
"
fi
shift
done
}
has_space
()
has_space
()
{
{
estrlist
--
has_space
"
$@
"
estrlist
--
has_space
"
$@
"
...
@@ -1086,63 +1105,6 @@ __epm_addrepo_altlinux()
...
@@ -1086,63 +1105,6 @@ __epm_addrepo_altlinux()
}
}
__epm_addkey_altlinux
()
{
local
url
=
"
$1
"
local
fingerprint
=
"
$2
"
local
comment
=
"
$3
"
local
name
=
"
$(
basename
"
$url
"
.gpg
)
"
[
-s
/etc/apt/vendors.list.d/
$name
.list
]
&&
return
cat
<<
EOF
| sudorun tee /etc/apt/vendors.list.d/
$name
.list
simple-key "
$name
" {
FingerPrint "
$fingerprint
";
Name "
$comment
";
}
EOF
eget
-q
-O
/tmp/
$name
.gpg
$url
||
fatal
sudorun gpg
--no-default-keyring
--keyring
/usr/lib/alt-gpgkeys/pubring.gpg
--import
/tmp/
$name
.gpg
rm
-f
/tmp/
$name
.gpg
}
__epm_addkey_deb
()
{
local
url
=
"
$1
"
local
fingerprint
=
"
$2
"
local
comment
=
"
$3
"
local
name
=
"
$(
basename
$url
.gpg
)
"
[
-s
/etc/apt/trusted.gpg.d/
$name
.gpg
]
&&
return
if
[
-z
"
$fingerprint
"
]
;
then
set_sudo
eget
-q
-O-
"
$url
"
| sudorun apt-key add -
return
fi
sudocmd apt-key adv
--keyserver
"
$url
"
--recv
"
$fingerprint
"
}
epm_addkey
()
{
case
$BASEDISTRNAME
in
"alt"
)
__epm_addkey_altlinux
"
$@
"
return
;;
esac
case
$PMTYPE
in
apt-dpkg
)
__epm_addkey_deb
"
$@
"
;;
esac
}
__epm_addrepo_astra
()
__epm_addrepo_astra
()
{
{
...
@@ -1194,6 +1156,15 @@ __epm_addrepo_astra()
...
@@ -1194,6 +1156,15 @@ __epm_addrepo_astra()
return
return
}
}
__epm_addrepo_alpine
()
{
local
repo
=
"
$1
"
is_url
"
$repo
"
||
fatal
"Only URL is supported"
epm repo list
--quiet
|
grep
-q
-F
"
$repo
"
&&
return
0
echo
"
$repo
"
| sudocmd
tee
-a
/etc/apk/repositories
}
__epm_addrepo_deb
()
__epm_addrepo_deb
()
{
{
assure_exists apt-add-repository software-properties-common
assure_exists apt-add-repository software-properties-common
...
@@ -1254,6 +1225,10 @@ case $BASEDISTRNAME in
...
@@ -1254,6 +1225,10 @@ case $BASEDISTRNAME in
"astra"
)
"astra"
)
__epm_addrepo_astra
$repo
__epm_addrepo_astra
$repo
return
return
;;
"apk"
)
__epm_addrepo_alpine
"
$repo
"
||
return
;;
esac
esac
case
$PMTYPE
in
case
$PMTYPE
in
...
@@ -3944,8 +3919,14 @@ epm_install_files()
...
@@ -3944,8 +3919,14 @@ epm_install_files()
if
[
-n
"
$noscripts
"
]
;
then
if
[
-n
"
$noscripts
"
]
;
then
info
"Workaround for install packages via apt with --noscripts (see https://bugzilla.altlinux.org/44670)"
info
"Workaround for install packages via apt with --noscripts (see https://bugzilla.altlinux.org/44670)"
info
"Firstly install package requrements …"
info
"Firstly install package requrements …"
# names of packages to be installed
local
fl
=
"
$(
epm print name
for
package
$files
)
"
local
req
=
"
$(
docmd epm req
--short
$files
)
"
||
return
# exclude package names from requires (req - fl)
req
=
"
$(
estrlist exclude
"
$fl
"
"
$req
"
)
"
# TODO: can we install only requires via apt?
# TODO: can we install only requires via apt?
epm
install
$(
epm req
--short
$files
)
||
return
docmd epm
install
$req
||
return
# retry with rpm
# retry with rpm
# --replacepkgs: Install the Package Even If Already Installed
# --replacepkgs: Install the Package Even If Already Installed
local
replacepkgs
=
"
$(
__epm_get_replacepkgs
$files
)
"
local
replacepkgs
=
"
$(
__epm_get_replacepkgs
$files
)
"
...
@@ -5063,9 +5044,8 @@ __epm_pack()
...
@@ -5063,9 +5044,8 @@ __epm_pack()
[
-x
"
$repackcode
"
]
||
fatal
"Can't find script
$repackcode
for packname
$packname
"
[
-x
"
$repackcode
"
]
||
fatal
"Can't find script
$repackcode
for packname
$packname
"
[
-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."
tmpdir
=
"
$(
mktemp
-d
)
"
# a file to keep filename of generated tarball
filefortarname
=
"
$tmpdir
/filefortarname"
filefortarname
=
"
$(
pwd
)
/filefortarname"
trap
"rm -rf
$tmpdir
"
EXIT
set_sudo
set_sudo
export
SUDO
export
SUDO
...
@@ -5078,25 +5058,15 @@ __epm_pack()
...
@@ -5078,25 +5058,15 @@ __epm_pack()
#info "Running $($script --description 2>/dev/null) ..."
#info "Running $($script --description 2>/dev/null) ..."
(
unset
EPMCURDIR
;
docmd
$CMDSHELL
$bashopt
$repackcode
"
$tarname
"
"
$filefortarname
"
"
$packversion
"
)
||
fatal
(
unset
EPMCURDIR
;
docmd
$CMDSHELL
$bashopt
$repackcode
"
$tarname
"
"
$filefortarname
"
"
$packversion
"
)
||
fatal
returntarname
=
"
$(
cat
"
$filefortarname
"
)
"
||
fatal
"pack script
$repackcode
didn't set tarname"
returntarname
=
"
$(
cat
"
$filefortarname
"
)
"
||
fatal
"pack script
$repackcode
didn't set tarname"
rm
-rf
$tmpdir
[
-s
"
$returntarname
"
]
||
fatal
"pack script
$repackcode
didn't return tarname"
#local newname="$(basename "$returntarname")"
# now it is by default in the current dir
[
-s
"
$returntarname
"
]
||
fatal
"pack script
$repackcode
return unexist
$returntarname
file"
#if [ "$returntarname" != "$(realpath $newname)" ; then
# # repack put its result to the current dir
# mv -v $returntarname . || fatal
#fi
if
[
-n
"
$download_only
"
]
;
then
if
[
-n
"
$download_only
"
]
;
then
mv
$returntarname
$EPMCURDIR
return
return
fi
fi
trap
"rm -v
$returntarname
"
EXIT
# repack if needed
# FIXME: __epm_repack will drop trap
repacked_pkgs
=
''
repacked_pkgs
=
''
# repack to our target
# repack to our target
if
__epm_repack_if_needed
$returntarname
;
then
if
__epm_repack_if_needed
$returntarname
;
then
...
@@ -5108,20 +5078,21 @@ __epm_pack()
...
@@ -5108,20 +5078,21 @@ __epm_pack()
fi
fi
if
[
-n
"
$repacked_pkgs
"
]
;
then
if
[
-n
"
$repacked_pkgs
"
]
;
then
rm
-v
$returntarname
# remove packed file if we have repacked one
mv
-v
$repacked_pkgs
.
||
fatal
rm
-v
"
$returntarname
"
pkgname
=
$(
pwd
)
/
"
$(
basename
$repacked_pkgs
)
"
# also drop spaces
pkgname
=
"
$(
echo
$repacked_pkgs
)
"
else
else
pkgname
=
"
$returntarname
"
pkgname
=
"
$returntarname
"
fi
fi
if
[
-n
"
$install
"
]
;
then
if
[
-n
"
$install
"
]
;
then
trap
"rm -v
$pkgname
"
EXIT
docmd epm
install
"
$pkgname
"
docmd epm
install
$pkgname
return
return
fi
fi
trap
""
EXIT
# we need put result in the cur dir
mv
-v
"
$pkgname
"
$EPMCURDIR
||
fatal
}
}
...
@@ -5152,6 +5123,8 @@ epm_pack()
...
@@ -5152,6 +5123,8 @@ epm_pack()
fi
fi
trap
"__epm_remove_tmp_files"
EXIT
trap
"__epm_remove_tmp_files"
EXIT
local
tmpdir
=
"
$(
mktemp
-d
--tmpdir
=
$BIGTMPDIR
)
"
to_clean_tmp_dirs
=
"
$to_clean_tmp_dirs
$tmpdir
"
local
packname
=
"
$1
"
local
packname
=
"
$1
"
local
tarname
=
"
$2
"
local
tarname
=
"
$2
"
...
@@ -5161,15 +5134,17 @@ epm_pack()
...
@@ -5161,15 +5134,17 @@ epm_pack()
if
is_url
"
$tarname
"
;
then
if
is_url
"
$tarname
"
;
then
pkg_urls
=
"
$tarname
"
pkg_urls
=
"
$tarname
"
cd
$tmpdir
||
fatal
__handle_pkg_urls_to_install
__handle_pkg_urls_to_install
# drop spaces and get full path
# drop spaces and get full path
tarname
=
"
$(
realpath
$pkg_files
)
"
tarname
=
"
$(
realpath
$pkg_files
)
"
elif
[
-d
"
$tarname
"
]
;
then
elif
[
-d
"
$tarname
"
]
;
then
fatal
"FIXME: implement packing of the dir
$tarname
?
"
tarname
=
"
$(
realpath
"
$tarname
"
)
"
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
...
@@ -5412,7 +5387,7 @@ __run_script()
...
@@ -5412,7 +5387,7 @@ __run_script()
__get_app_package
()
__get_app_package
()
{
{
__run_script
"
$1
"
--package-name
"
$2
"
2>/dev/null
__run_script
"
$1
"
--package-name
"
$2
"
"
$3
"
2>/dev/null
}
}
...
@@ -5679,7 +5654,7 @@ __epm_play_install()
...
@@ -5679,7 +5654,7 @@ __epm_play_install()
else
else
shift
shift
fi
fi
__epm_play_install_one
$p
$v
$options
||
RES
=
1
__epm_play_install_one
"
$p
"
"
$v
"
$options
||
RES
=
1
done
done
return
$RES
return
$RES
...
@@ -7270,10 +7245,6 @@ get_fix_release_pkg()
...
@@ -7270,10 +7245,6 @@ get_fix_release_pkg()
echo
"apt-conf-
$TO
"
echo
"apt-conf-
$TO
"
# apt-conf-sisyphus and apt-conf-branch conflicts
# apt-conf-sisyphus and apt-conf-branch conflicts
epm installed apt-conf-branch
&&
echo
"apt-conf-branch-"
epm installed apt-conf-branch
&&
echo
"apt-conf-branch-"
#for i in apt apt-rsync libapt libpackagekit-glib librpm7 packagekit rpm synaptic realmd libldap2 ; do
# epm installed $i && echo "$i"
#done
else
else
epm installed apt-conf-branch
&&
echo
"apt-conf-branch"
&&
epm installed apt-conf-sisyphus
&&
echo
"apt-conf-sisyphus-"
epm installed apt-conf-branch
&&
echo
"apt-conf-branch"
&&
epm installed apt-conf-sisyphus
&&
echo
"apt-conf-sisyphus-"
fi
fi
...
@@ -8329,7 +8300,6 @@ __epm_have_repack_rule()
...
@@ -8329,7 +8300,6 @@ __epm_have_repack_rule()
# skip repacking on non ALT systems
# skip repacking on non ALT systems
[
"
$BASEDISTRNAME
"
=
"alt"
]
||
return
1
[
"
$BASEDISTRNAME
"
=
"alt"
]
||
return
1
# skip for packages built with repack
local
packager
=
"
$(
epm print field Packager
for
"
$1
"
2>/dev/null
)
"
local
packager
=
"
$(
epm print field Packager
for
"
$1
"
2>/dev/null
)
"
[
"
$packager
"
=
"EPM <support@etersoft.ru>"
]
&&
return
1
[
"
$packager
"
=
"EPM <support@etersoft.ru>"
]
&&
return
1
[
"
$packager
"
=
"EPM <support@eepm.ru>"
]
&&
return
1
[
"
$packager
"
=
"EPM <support@eepm.ru>"
]
&&
return
1
...
@@ -8815,7 +8785,7 @@ epm_repo()
...
@@ -8815,7 +8785,7 @@ epm_repo()
disable
)
# HELPCMD: disable <repo>
disable
)
# HELPCMD: disable <repo>
epm_repodisable
"
$@
"
epm_repodisable
"
$@
"
;;
;;
addkey
)
# HELPCMD: add repository gpg key
addkey
)
# HELPCMD: add repository gpg key
(by URL or file)
epm_addkey
"
$@
"
epm_addkey
"
$@
"
;;
;;
clean
)
# HELPCMD: remove temp. repos (tasks and CD-ROMs)
clean
)
# HELPCMD: remove temp. repos (tasks and CD-ROMs)
...
@@ -8864,6 +8834,129 @@ esac
...
@@ -8864,6 +8834,129 @@ esac
}
}
# File bin/epm-repo-addkey:
__epm_get_file_from_url
()
{
local
tmpfile
=
$(
mktemp
)
remove_on_exit
$tmpfile
eget
-O
$tmpfile
$url
>
/dev/null
echo
"
$tmpfile
"
}
__epm_addkey_altlinux
()
{
local
url
=
"
$1
"
local
fingerprint
=
"
$2
"
local
comment
=
"
$3
"
local
name
=
"
$4
"
[
-n
"
$name
"
]
||
name
=
"
$(
basename
"
$url
"
.gpg
)
"
[
-s
/etc/apt/vendors.list.d/
$name
.list
]
&&
return
cat
<<
EOF
| sudorun tee /etc/apt/vendors.list.d/
$name
.list
simple-key "
$name
" {
FingerPrint "
$fingerprint
";
Name "
$comment
";
}
EOF
local
tmpfile
=
$(
__epm_get_file_from_url
$url
)
||
fatal
sudocmd gpg
--no-default-keyring
--keyring
/usr/lib/alt-gpgkeys/pubring.gpg
--import
$tmpfile
}
__epm_addkey_alpine
()
{
local
url
=
"
$1
"
local
name
=
"
$(
basename
$url
.rsa
)
"
local
target
=
"/etc/apk/keys/
$name
.rsa"
[
-s
$target
]
&&
return
local
tmpfile
=
$(
__epm_get_file_from_url
$url
)
||
fatal
sudocmd
cp
$tmpfile
$target
}
__epm_addkey_dnf
()
{
local
url
=
"
$1
"
local
gpgkeyurl
=
"
$2
"
local
nametext
=
"
$3
"
local
name
=
"
$4
"
# TODO: missed name, nametext, gpgkeyurl (disable gpgcheck=1)
local
target
=
"/etc/yum.repos.d/
$name
.repo"
[
-s
$target
]
&&
return
local
tmpfile
=
$(
mktemp
)
remove_on_exit
$tmpfile
cat
>
$tmpfile
<<
EOF
[
$name
]
name=
$nametext
baseurl=
$url
gpgcheck=1
enabled=1
gpgkey=
$gpgkeyurl
EOF
chmod
644
$tmpfile
sudocmd
cp
$tmpfile
$target
}
__epm_addkey_deb
()
{
local
url
=
"
$1
"
local
fingerprint
=
"
$2
"
local
comment
=
"
$3
"
local
name
=
"
$4
"
[
-n
"
$name
"
]
||
name
=
"
$(
basename
"
$url
"
.gpg
)
"
[
-s
/etc/apt/trusted.gpg.d/
$name
.gpg
]
&&
return
if
[
-z
"
$fingerprint
"
]
;
then
local
tmpfile
=
$(
__epm_get_file_from_url
$url
)
||
fatal
sudocmd apt-key add
$tmpfile
return
fi
sudocmd apt-key adv
--keyserver
"
$url
"
--recv
"
$fingerprint
"
}
epm_addkey
()
{
case
$BASEDISTRNAME
in
"alt"
)
__epm_addkey_altlinux
"
$@
"
return
;;
"alpine"
)
__epm_addkey_alpine
"
$@
"
return
;;
esac
case
$PMTYPE
in
apt-dpkg
)
__epm_addkey_deb
"
$@
"
;;
dnf-
*
|
yum-
*
)
__epm_addkey_dnf
"
$@
"
;;
esac
}
# File bin/epm-repodisable:
# File bin/epm-repodisable:
...
@@ -9435,6 +9528,9 @@ case $PMTYPE in
...
@@ -9435,6 +9528,9 @@ case $PMTYPE in
urpm-rpm
)
urpm-rpm
)
docmd urpmq
--list-media
active
--list-url
docmd urpmq
--list-media
active
--list-url
;;
;;
apk
)
cat
/etc/apk/repositories
;;
zypper-rpm
)
zypper-rpm
)
docmd zypper sl
-d
docmd zypper sl
-d
;;
;;
...
@@ -11796,7 +11892,7 @@ epm_upgrade()
...
@@ -11796,7 +11892,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
"-o Debug::pkgMarkInstall=1 -o Debug::pkgProblemResolver=1"
)
"
local
APTOPTIONS
=
"
$(
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
)
...
@@ -13373,20 +13469,26 @@ quiet=''
...
@@ -13373,20 +13469,26 @@ quiet=''
verbose
=
''
verbose
=
''
WGETNOSSLCHECK
=
''
WGETNOSSLCHECK
=
''
CURLNOSSLCHECK
=
''
CURLNOSSLCHECK
=
''
AXELNOSSLCHECK
=
''
WGETUSERAGENT
=
''
WGETUSERAGENT
=
''
CURLUSERAGENT
=
''
CURLUSERAGENT
=
''
AXELUSERAGENT
=
''
WGETHEADER
=
''
WGETHEADER
=
''
CURLHEADER
=
''
CURLHEADER
=
''
AXELHEADER
=
''
AXELHEADER
=
''
WGETCOMPRESSED
=
''
WGETCOMPRESSED
=
''
CURLCOMPRESSED
=
''
CURLCOMPRESSED
=
''
AXELCOMPRESSED
=
''
WGETQ
=
''
#-q
WGETQ
=
''
#-q
CURLQ
=
''
#-s
CURLQ
=
''
#-s
AXELQ
=
''
#-q
# TODO: aria2c
# TODO: aria2c
# TODO: wget --trust-server-names
# TODO: wget --trust-server-names
# TODO:
# TODO:
WGETNAMEOPTIONS
=
'--content-disposition'
WGETNAMEOPTIONS
=
'--content-disposition'
CURLNAMEOPTIONS
=
'--remote-name --remote-time --remote-header-name'
CURLNAMEOPTIONS
=
'--remote-name --remote-time --remote-header-name'
AXELNAMEOPTIONS
=
''
LISTONLY
=
''
LISTONLY
=
''
CHECKURL
=
''
CHECKURL
=
''
...
@@ -13405,6 +13507,7 @@ set_quiet()
...
@@ -13405,6 +13507,7 @@ set_quiet()
{
{
WGETQ
=
'-q'
WGETQ
=
'-q'
CURLQ
=
'-s'
CURLQ
=
'-s'
AXELQ
=
'-q'
quiet
=
1
quiet
=
1
}
}
...
@@ -13480,6 +13583,7 @@ while [ -n "$1" ] ; do
...
@@ -13480,6 +13583,7 @@ while [ -n "$1" ] ; do
-k
|
--no-check-certificate
)
-k
|
--no-check-certificate
)
WGETNOSSLCHECK
=
'--no-check-certificate'
WGETNOSSLCHECK
=
'--no-check-certificate'
CURLNOSSLCHECK
=
'-k'
CURLNOSSLCHECK
=
'-k'
AXELNOSSLCHECK
=
'--insecure'
;;
;;
-H
|
--header
)
-H
|
--header
)
shift
shift
...
@@ -13491,6 +13595,7 @@ while [ -n "$1" ] ; do
...
@@ -13491,6 +13595,7 @@ while [ -n "$1" ] ; do
user_agent
=
"Mozilla/5.0 (X11; Linux
$arch
) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"
user_agent
=
"Mozilla/5.0 (X11; Linux
$arch
) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"
WGETUSERAGENT
=
"-U '
$user_agent
'"
WGETUSERAGENT
=
"-U '
$user_agent
'"
CURLUSERAGENT
=
"-A '
$user_agent
'"
CURLUSERAGENT
=
"-A '
$user_agent
'"
AXELUSERAGENT
=
"--user-agent='
$user_agent
'"
;;
;;
--compressed
)
--compressed
)
CURLCOMPRESSED
=
'--compressed'
CURLCOMPRESSED
=
'--compressed'
...
@@ -13654,7 +13759,7 @@ put_cid_and_url()
...
@@ -13654,7 +13759,7 @@ put_cid_and_url()
is_fileurl
"
$URL
"
&&
return
is_fileurl
"
$URL
"
&&
return
echo
"
$URL
$CID
$FN
"
>>
"
$EGET_IPFS_DB
"
echo
"
$URL
$CID
$FN
"
>>
"
$EGET_IPFS_DB
"
ech
o
"Placed in
$EGET_IPFS_DB
:
$URL
$CID
$FN
"
inf
o
"Placed in
$EGET_IPFS_DB
:
$URL
$CID
$FN
"
}
}
get_filename_by_cid
()
get_filename_by_cid
()
...
@@ -15315,7 +15420,7 @@ help()
...
@@ -15315,7 +15420,7 @@ help()
COMMAND
=
"
$1
"
COMMAND
=
"
$1
"
if
[
-z
"
$COMMAND
"
]
;
then
if
[
-z
"
$COMMAND
"
]
;
then
echo
"Run with --help for get command description."
echo
"Run with --help for get command description."
>
&2
exit
1
exit
1
fi
fi
...
...
packed/serv.sh
View file @
a897670c
...
@@ -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
3.1
"
EPMVERSION
=
"3.5
4.0
"
# package, single (file), pipe, git
# package, single (file), pipe, git
EPMMODE
=
"package"
EPMMODE
=
"package"
...
@@ -331,9 +331,10 @@ sudoepm()
...
@@ -331,9 +331,10 @@ sudoepm()
fatal
()
fatal
()
{
{
if
[
-z
"
$TEXTDOMAIN
"
]
;
then
if
[
-z
"
$TEXTDOMAIN
"
]
;
then
set_color
$RED
set_color
$RED
>
&2
echo
"Error:
$*
(you can discuss the epm
$EPMVERSION
problem in Telegram: https://t.me/useepm)"
>
&2
echo
-n
"ERROR: "
>
&2
restore_color
restore_color
>
&2
echo
"
$*
(you can discuss the epm
$EPMVERSION
problem in Telegram: https://t.me/useepm)"
>
&2
fi
fi
exit
1
exit
1
}
}
...
@@ -341,9 +342,10 @@ fatal()
...
@@ -341,9 +342,10 @@ fatal()
warning
()
warning
()
{
{
if
[
-z
"
$TEXTDOMAIN
"
]
;
then
if
[
-z
"
$TEXTDOMAIN
"
]
;
then
set_color
$YELLOW
set_color
$YELLOW
>
&2
echo
"Warning:
$*
"
>
&2
echo
-n
"WARNING: "
>
&2
restore_color
restore_color
>
&2
echo
"
$*
"
>
&2
fi
fi
}
}
...
@@ -538,13 +540,12 @@ disabled_eget()
...
@@ -538,13 +540,12 @@ disabled_eget()
disabled_erc
()
disabled_erc
()
{
{
if
!
is_command patool
;
then
# 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
fi
# use internal eget only if exists
# use internal eget only if exists
if
[
-s
$SHAREDIR
/tools_erc
]
;
then
if
[
-s
$SHAREDIR
/tools_erc
]
;
then
...
@@ -731,8 +732,12 @@ __epm_remove_from_tmp_files()
...
@@ -731,8 +732,12 @@ __epm_remove_from_tmp_files()
{
{
keep
=
"
$1
"
keep
=
"
$1
"
[
-r
"
$keep
"
]
||
return
0
[
-r
"
$keep
"
]
||
return
0
[
-n
"
$to_remove_pkg_files
"
]
||
return
0
if
[
-n
"
$to_remove_pkg_files
"
]
;
then
to_remove_pkg_files
=
"
$(
echo
"
$to_remove_pkg_files
"
|
sed
-e
"s|
$keep
||"
)
"
to_remove_pkg_files
=
"
$(
echo
"
$to_remove_pkg_files
"
|
sed
-e
"s|
$keep
||"
)
"
fi
if
[
-n
"
$to_remove_tmp_files
"
]
;
then
to_remove_tmp_files
=
"
$(
echo
"
$to_remove_tmp_files
"
|
sed
-e
"s|
$keep
||"
)
"
fi
}
}
__epm_remove_tmp_files
()
__epm_remove_tmp_files
()
...
@@ -741,6 +746,7 @@ __epm_remove_tmp_files()
...
@@ -741,6 +746,7 @@ __epm_remove_tmp_files()
if
[
-z
"
$DEBUG
"
]
;
then
if
[
-z
"
$DEBUG
"
]
;
then
# TODO: reinvent
# TODO: reinvent
[
-n
"
$to_remove_pkg_files
"
]
&&
rm
-f
$to_remove_pkg_files
[
-n
"
$to_remove_pkg_files
"
]
&&
rm
-f
$to_remove_pkg_files
[
-n
"
$to_remove_tmp_files
"
]
&&
rm
-f
$to_remove_tmp_files
# hack??
# hack??
[
-n
"
$to_remove_pkg_files
"
]
&&
rmdir
$(
dirname
$to_remove_pkg_files
|
head
-n1
)
2>/dev/null
[
-n
"
$to_remove_pkg_files
"
]
&&
rmdir
$(
dirname
$to_remove_pkg_files
|
head
-n1
)
2>/dev/null
[
-n
"
$to_remove_pkg_dirs
"
]
&&
rmdir
$to_remove_pkg_dirs
2>/dev/null
[
-n
"
$to_remove_pkg_dirs
"
]
&&
rmdir
$to_remove_pkg_dirs
2>/dev/null
...
@@ -750,6 +756,19 @@ __epm_remove_tmp_files()
...
@@ -750,6 +756,19 @@ __epm_remove_tmp_files()
}
}
remove_on_exit
()
{
trap
"__epm_remove_tmp_files"
EXIT
while
[
-n
"
$1
"
]
;
do
if
[
-d
"
$1
"
]
;
then
to_clean_tmp_dirs
=
"
$to_clean_tmp_dirs
$1
"
elif
[
-f
"
$1
"
]
;
then
to_clean_tmp_files
=
"
$to_clean_tmp_files
$1
"
fi
shift
done
}
has_space
()
has_space
()
{
{
estrlist
--
has_space
"
$@
"
estrlist
--
has_space
"
$@
"
...
...
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