Commit 9c133b2e authored by Vitaly Lipatov's avatar Vitaly Lipatov

commit packed 3.55.1

parent ddd0bbb5
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
PROGDIR=$(dirname "$0") PROGDIR=$(dirname "$0")
PROGNAME=$(basename "$0") PROGNAME=$(basename "$0")
[ -n "$EPMCURDIR" ] || export EPMCURDIR="$(pwd)" [ -n "$EPMCURDIR" ] || export EPMCURDIR="$(pwd)"
CMDSHELL="/bin/bash" CMDSHELL="/usr/bin/env bash"
# TODO: pwd for ./epm and which for epm # TODO: pwd for ./epm and which for epm
[ "$PROGDIR" = "." ] && PROGDIR="$EPMCURDIR" [ "$PROGDIR" = "." ] && PROGDIR="$EPMCURDIR"
if [ "$0" = "/dev/stdin" ] || [ "$0" = "sh" ] ; then if [ "$0" = "/dev/stdin" ] || [ "$0" = "sh" ] ; then
...@@ -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.0" EPMVERSION="3.55.1"
# package, single (file), pipe, git # package, single (file), pipe, git
EPMMODE="package" EPMMODE="package"
...@@ -517,7 +517,7 @@ disabled_eget() ...@@ -517,7 +517,7 @@ disabled_eget()
local EGET local EGET
# use internal eget only if exists # use internal eget only if exists
if [ -s $SHAREDIR/tools_eget ] ; then if [ -s $SHAREDIR/tools_eget ] ; then
( EGET_BACKEND=$eget_backend $SHAREDIR/tools_eget "$@" ) ( EGET_BACKEND=$eget_backend $CMDSHELL $SHAREDIR/tools_eget "$@" )
return return
fi fi
fatal "Internal error: missed tools_eget" fatal "Internal error: missed tools_eget"
...@@ -541,7 +541,7 @@ disabled_erc() ...@@ -541,7 +541,7 @@ disabled_erc()
# use internal eget only if exists # use internal eget only if exists
if [ -s $SHAREDIR/tools_erc ] ; then if [ -s $SHAREDIR/tools_erc ] ; then
$SHAREDIR/tools_erc "$@" $CMDSHELL $SHAREDIR/tools_erc "$@"
return return
fi fi
fatal "Internal error: missed tools_erc" fatal "Internal error: missed tools_erc"
...@@ -559,7 +559,7 @@ disabled_ercat() ...@@ -559,7 +559,7 @@ disabled_ercat()
local ERCAT local ERCAT
# use internal eget only if exists # use internal eget only if exists
if [ -s $SHAREDIR/tools_ercat ] ; then if [ -s $SHAREDIR/tools_ercat ] ; then
$SHAREDIR/tools_ercat "$@" $CMDSHELL $SHAREDIR/tools_ercat "$@"
return return
fi fi
fatal "Internal error: missed tools_ercat" fatal "Internal error: missed tools_ercat"
...@@ -574,7 +574,7 @@ disabled_ercat() ...@@ -574,7 +574,7 @@ disabled_ercat()
disabled_estrlist() disabled_estrlist()
{ {
if [ -s $SHAREDIR/tools_estrlist ] ; then if [ -s $SHAREDIR/tools_estrlist ] ; then
$SHAREDIR/tools_estrlist "$@" $CMDSHELL $SHAREDIR/tools_estrlist "$@"
return return
fi fi
fatal "missed tools_estrlist" fatal "missed tools_estrlist"
...@@ -5633,32 +5633,46 @@ __epm_play_install() ...@@ -5633,32 +5633,46 @@ __epm_play_install()
return $RES return $RES
} }
__epm_play_download_epm_file()
{
local target="$1"
local file="$2"
#local epmver="$(epm --short --version)"
local epmver="$EPMVERSION"
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"
docmd eget -q -O "$target" "$URL/$file" && return
URL="https://eepm.ru/app-versions"
info "Updating local IPFS DB in $eget_ipfs_db file from $URL/eget-ipfs-db.txt"
docmd eget -q -O "$target" "$URL/$file"
}
__epm_play_initialize_ipfs() __epm_play_initialize_ipfs()
{ {
if [ -d "$(dirname "$epm_ipfs_db")" ] ; then if [ ! -d "$(dirname "$epm_ipfs_db")" ] ; then
local URL="https://eepm.ru/app-versions" warning "ipfs db dir $eget_ipfs_db does not exist, skipping IPFS mode"
if [ ! -r "$eget_ipfs_db" ] ; then return 1
sudorun touch "$eget_ipfs_db" >&2 fi
sudorun chmod -v a+rw "$eget_ipfs_db" >&2
# TODO: update this DB every time when changed (and get from IPFS as sign it works.) if [ ! -r "$eget_ipfs_db" ] ; then
# get initial db from server sudorun touch "$eget_ipfs_db" >&2
info "Initialize local IPFS DB in $eget_ipfs_db file and fill it with data from $URL/eget-ipfs-db.txt" sudorun chmod -v a+rw "$eget_ipfs_db" >&2
docmd eget -q -O $eget_ipfs_db "$URL/eget-ipfs-db.txt" fi
else
# update # download and merge with local db
local t=$(mktemp) || fatal local t=$(mktemp) || fatal
info "Updating local IPFS DB in $eget_ipfs_db file from $URL/eget-ipfs-db.txt" remove_on_exit "$t"
docmd eget -q -O $t "$URL/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
cat $eget_ipfs_db >>$t cat $eget_ipfs_db >>$t
sort -u < $t | grep -v "^$" > $eget_ipfs_db sort -u < $t | grep -v "^$" > $eget_ipfs_db
fi
fi
export EGET_IPFS_DB="$eget_ipfs_db"
else
warning "ipfs db dir $eget_ipfs_db is not exists, skipping --ipfs"
fi fi
# the only one thing need to enable IPFS in eget
export EGET_IPFS_DB="$eget_ipfs_db"
} }
epm_play() epm_play()
...@@ -8589,7 +8603,7 @@ __apply_fix_code() ...@@ -8589,7 +8603,7 @@ __apply_fix_code()
export PATH=$PROGDIR:$PATH export PATH=$PROGDIR:$PATH
local bashopt='' local bashopt=''
[ -n "$verbose" ] && bashopt='-x' [ -n "$verbose" ] && bashopt='-x'
( unset EPMCURDIR ; docmd $CMDSHELL $bashopt $repackcode "$1" "$2" "$3" ) || fatal "There is an error from $repackcode script" ( unset EPMCURDIR ; docmd $CMDSHELL $bashopt $repackcode "$1" "$2" "$3" "$4" ) || fatal "There is an error from $repackcode script"
} }
__create_rpmmacros() __create_rpmmacros()
...@@ -8691,9 +8705,9 @@ __epm_repack_to_rpm() ...@@ -8691,9 +8705,9 @@ __epm_repack_to_rpm()
cd $buildroot || fatal cd $buildroot || fatal
__fix_spec $pkgname $buildroot $spec __fix_spec $pkgname $buildroot $spec
__apply_fix_code "generic" $buildroot $spec $pkgname __apply_fix_code "generic" $buildroot $spec $pkgname $abspkg
[ -n "$SUBGENERIC" ] && __apply_fix_code "generic-$SUBGENERIC" $buildroot $spec [ -n "$SUBGENERIC" ] && __apply_fix_code "generic-$SUBGENERIC" $buildroot $spec $pkgname $abspkg
__apply_fix_code $pkgname $buildroot $spec $pkgname __apply_fix_code $pkgname $buildroot $spec $pkgname $abspkg
cd - >/dev/null cd - >/dev/null
TARGETARCH=$(epm print info -a | sed -e 's|^x86$|i586|') TARGETARCH=$(epm print info -a | sed -e 's|^x86$|i586|')
...@@ -11720,7 +11734,7 @@ epm_tool() ...@@ -11720,7 +11734,7 @@ epm_tool()
;; ;;
"json") # HELPCMD: json operations "json") # HELPCMD: json operations
showcmd json "$@" showcmd json "$@"
internal_tools_json "$@" $CMDSHELL internal_tools_json "$@"
;; ;;
"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)
...@@ -12229,23 +12243,14 @@ print_bug_report_url() ...@@ -12229,23 +12243,14 @@ print_bug_report_url()
# allows x86_64/Distro/Version # allows x86_64/Distro/Version
override_distrib() override_distrib()
{ {
if [ -n "$1" ] ; then [ -n "$DISTRNAMEOVERRIDE" ] || DISTRNAMEOVERRIDE="$1"
local name="$(echo "$1" | sed -e 's|x86_64/||')" [ -n "$DISTRNAMEOVERRIDE" ] || return
[ "$name" = "$1" ] && DIST_ARCH="x86" || DIST_ARCH="x86_64"
DISTRIB_ID="$(echo "$name" | sed -e 's|/.*||')"
DISTRIB_RELEASE="$(echo "$name" | sed -e 's|.*/||')"
[ "$DISTRIB_ID" = "$DISTRIB_RELEASE" ] && DISTRIB_RELEASE=''
else
if [ -z "$DISTRNAME" ] ; then
return
fi
# if predefined DISTRNAME and possible DISTRVERSION local name="$(echo "$DISTRNAMEOVERRIDE" | sed -e 's|x86_64/||')"
DISTRIB_ID="$DISTRNAME" [ "$name" = "$DISTRNAMEOVERRIDE" ] && DIST_ARCH="x86" || DIST_ARCH="x86_64"
[ -n "$DISTRVERSION" ] && DISTRIB_RELEASE="$DISTRVERSION" DISTRIB_ID="$(echo "$name" | sed -e 's|/.*||')"
[ -n "$DISTRARCH" ] && DIST_ARCH="$DISTRARCH" DISTRIB_RELEASE="$(echo "$name" | sed -e 's|.*/||')"
# export DISTRCONTROL="$(get_service_manager)" [ "$DISTRIB_ID" = "$DISTRIB_RELEASE" ] && DISTRIB_RELEASE=''
fi
VENDOR_ID='' VENDOR_ID=''
PRETTY_NAME="$DISTRIB_ID" PRETTY_NAME="$DISTRIB_ID"
...@@ -13112,9 +13117,7 @@ EOF ...@@ -13112,9 +13117,7 @@ EOF
} }
if [ -n "$DISTRNAME" ] ; then override_distrib "$DISTRNAMEOVERRIDE"
override_distrib
fi
if [ -n "$*" ] ; then if [ -n "$*" ] ; then
eval lastarg=\${$#} eval lastarg=\${$#}
...@@ -13130,7 +13133,7 @@ if [ -n "$*" ] ; then ...@@ -13130,7 +13133,7 @@ if [ -n "$*" ] ; then
fi fi
# if without override # if without override
if [ -z "$DISTRIB_ID" ] && [ -z "$DISTRNAME" ] ; then if [ -z "$DISTRIB_ID" ] ; then
fill_distr_info fill_distr_info
[ -n "$DISTRIB_ID" ] || DISTRIB_ID="Generic" [ -n "$DISTRIB_ID" ] || DISTRIB_ID="Generic"
fi fi
...@@ -14272,12 +14275,18 @@ url_get_filename() ...@@ -14272,12 +14275,18 @@ url_get_filename()
! is_httpurl "$URL" && basename "$URL" && return ! is_httpurl "$URL" && basename "$URL" && return
# FIXME with wget # See https://www.cpcwood.com/blog/5-aws-s3-utf-8-content-disposition
# https://www.rfc-editor.org/rfc/rfc6266
local cd="$(url_get_header "$URL" "Content-Disposition")" local cd="$(url_get_header "$URL" "Content-Disposition")"
if echo "$cd" | grep -q "filename=" ; then if echo "$cd" | grep -qi "filename\*= *UTF-8" ; then
#Content-Disposition: attachment; filename="unityhub-amd64-3.3.0.deb"; filename*=UTF-8''"unityhub-amd64-3.3.0.deb"
echo "$cd" | sed -e "s|.*filename\*= *UTF-8''||i" -e 's|^"||' -e 's|";$||' -e 's|"$||'
return
fi
if echo "$cd" | grep -qi "filename=" ; then
#Content-Disposition: attachment; filename=postman-linux-x64.tar.gz #Content-Disposition: attachment; filename=postman-linux-x64.tar.gz
#content-disposition: attachment; filename="code-1.77.1-1680651749.el7.x86_64.rpm" #content-disposition: attachment; filename="code-1.77.1-1680651749.el7.x86_64.rpm"
echo "$cd" | sed -e 's|.*filename=||' -e 's|^"||' -e 's|";$||' -e 's|"$||' echo "$cd" | sed -e 's|.*filename= *||i' -e 's|^"||' -e 's|";.*||' -e 's|"$||'
return return
fi fi
......
...@@ -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.0" EPMVERSION="3.55.1"
# package, single (file), pipe, git # package, single (file), pipe, git
EPMMODE="package" EPMMODE="package"
...@@ -515,7 +515,7 @@ disabled_eget() ...@@ -515,7 +515,7 @@ disabled_eget()
local EGET local EGET
# use internal eget only if exists # use internal eget only if exists
if [ -s $SHAREDIR/tools_eget ] ; then if [ -s $SHAREDIR/tools_eget ] ; then
( EGET_BACKEND=$eget_backend $SHAREDIR/tools_eget "$@" ) ( EGET_BACKEND=$eget_backend $CMDSHELL $SHAREDIR/tools_eget "$@" )
return return
fi fi
fatal "Internal error: missed tools_eget" fatal "Internal error: missed tools_eget"
...@@ -539,7 +539,7 @@ disabled_erc() ...@@ -539,7 +539,7 @@ disabled_erc()
# use internal eget only if exists # use internal eget only if exists
if [ -s $SHAREDIR/tools_erc ] ; then if [ -s $SHAREDIR/tools_erc ] ; then
$SHAREDIR/tools_erc "$@" $CMDSHELL $SHAREDIR/tools_erc "$@"
return return
fi fi
fatal "Internal error: missed tools_erc" fatal "Internal error: missed tools_erc"
...@@ -557,7 +557,7 @@ disabled_ercat() ...@@ -557,7 +557,7 @@ disabled_ercat()
local ERCAT local ERCAT
# use internal eget only if exists # use internal eget only if exists
if [ -s $SHAREDIR/tools_ercat ] ; then if [ -s $SHAREDIR/tools_ercat ] ; then
$SHAREDIR/tools_ercat "$@" $CMDSHELL $SHAREDIR/tools_ercat "$@"
return return
fi fi
fatal "Internal error: missed tools_ercat" fatal "Internal error: missed tools_ercat"
...@@ -572,7 +572,7 @@ disabled_ercat() ...@@ -572,7 +572,7 @@ disabled_ercat()
disabled_estrlist() disabled_estrlist()
{ {
if [ -s $SHAREDIR/tools_estrlist ] ; then if [ -s $SHAREDIR/tools_estrlist ] ; then
$SHAREDIR/tools_estrlist "$@" $CMDSHELL $SHAREDIR/tools_estrlist "$@"
return return
fi fi
fatal "missed tools_estrlist" fatal "missed tools_estrlist"
...@@ -1584,23 +1584,14 @@ print_bug_report_url() ...@@ -1584,23 +1584,14 @@ print_bug_report_url()
# allows x86_64/Distro/Version # allows x86_64/Distro/Version
override_distrib() override_distrib()
{ {
if [ -n "$1" ] ; then [ -n "$DISTRNAMEOVERRIDE" ] || DISTRNAMEOVERRIDE="$1"
local name="$(echo "$1" | sed -e 's|x86_64/||')" [ -n "$DISTRNAMEOVERRIDE" ] || return
[ "$name" = "$1" ] && DIST_ARCH="x86" || DIST_ARCH="x86_64"
DISTRIB_ID="$(echo "$name" | sed -e 's|/.*||')"
DISTRIB_RELEASE="$(echo "$name" | sed -e 's|.*/||')"
[ "$DISTRIB_ID" = "$DISTRIB_RELEASE" ] && DISTRIB_RELEASE=''
else
if [ -z "$DISTRNAME" ] ; then
return
fi
# if predefined DISTRNAME and possible DISTRVERSION local name="$(echo "$DISTRNAMEOVERRIDE" | sed -e 's|x86_64/||')"
DISTRIB_ID="$DISTRNAME" [ "$name" = "$DISTRNAMEOVERRIDE" ] && DIST_ARCH="x86" || DIST_ARCH="x86_64"
[ -n "$DISTRVERSION" ] && DISTRIB_RELEASE="$DISTRVERSION" DISTRIB_ID="$(echo "$name" | sed -e 's|/.*||')"
[ -n "$DISTRARCH" ] && DIST_ARCH="$DISTRARCH" DISTRIB_RELEASE="$(echo "$name" | sed -e 's|.*/||')"
# export DISTRCONTROL="$(get_service_manager)" [ "$DISTRIB_ID" = "$DISTRIB_RELEASE" ] && DISTRIB_RELEASE=''
fi
VENDOR_ID='' VENDOR_ID=''
PRETTY_NAME="$DISTRIB_ID" PRETTY_NAME="$DISTRIB_ID"
...@@ -2467,9 +2458,7 @@ EOF ...@@ -2467,9 +2458,7 @@ EOF
} }
if [ -n "$DISTRNAME" ] ; then override_distrib "$DISTRNAMEOVERRIDE"
override_distrib
fi
if [ -n "$*" ] ; then if [ -n "$*" ] ; then
eval lastarg=\${$#} eval lastarg=\${$#}
...@@ -2485,7 +2474,7 @@ if [ -n "$*" ] ; then ...@@ -2485,7 +2474,7 @@ if [ -n "$*" ] ; then
fi fi
# if without override # if without override
if [ -z "$DISTRIB_ID" ] && [ -z "$DISTRNAME" ] ; then if [ -z "$DISTRIB_ID" ] ; then
fill_distr_info fill_distr_info
[ -n "$DISTRIB_ID" ] || DISTRIB_ID="Generic" [ -n "$DISTRIB_ID" ] || DISTRIB_ID="Generic"
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment