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
271a6c22
Commit
271a6c22
authored
May 01, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm play: rewrite IPFS DB download, check epm specific version URL
parent
fff45018
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
23 deletions
+37
-23
epm-play
bin/epm-play
+37
-23
No files found.
bin/epm-play
View file @
271a6c22
...
...
@@ -341,32 +341,46 @@ __epm_play_install()
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
()
{
if
[
-d
"
$(
dirname
"
$epm_ipfs_db
"
)
"
]
;
then
local
URL
=
"https://eepm.ru/app-versions"
if
[
!
-r
"
$eget_ipfs_db
"
]
;
then
sudorun
touch
"
$eget_ipfs_db
"
>
&2
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.)
# get initial db from server
info
"Initialize local IPFS DB in
$eget_ipfs_db
file and fill it with data from
$URL
/eget-ipfs-db.txt"
docmd eget
-q
-O
$eget_ipfs_db
"
$URL
/eget-ipfs-db.txt"
else
# update
local
t
=
$(
mktemp
)
||
fatal
info
"Updating local IPFS DB in
$eget_ipfs_db
file from
$URL
/eget-ipfs-db.txt"
docmd eget
-q
-O
$t
"
$URL
/eget-ipfs-db.txt"
||
warning
"Can't update IPFS DB"
if
[
-s
"
$t
"
]
;
then
echo
>>
$t
cat
$eget_ipfs_db
>>
$t
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"
if
[
!
-d
"
$(
dirname
"
$epm_ipfs_db
"
)
"
]
;
then
warning
"ipfs db dir
$eget_ipfs_db
does not exist, skipping IPFS mode"
return
1
fi
if
[
!
-r
"
$eget_ipfs_db
"
]
;
then
sudorun
touch
"
$eget_ipfs_db
"
>
&2
sudorun
chmod
-v
a+rw
"
$eget_ipfs_db
"
>
&2
fi
# download and merge with local db
local
t
=
$(
mktemp
)
||
fatal
remove_on_exit
"
$t
"
__epm_play_download_epm_file
"
$t
"
"eget-ipfs-db.txt"
||
warning
"Can't update IPFS DB"
if
[
-s
"
$t
"
]
;
then
echo
>>
$t
cat
$eget_ipfs_db
>>
$t
sort
-u
<
$t
|
grep
-v
"^$"
>
$eget_ipfs_db
fi
# the only one thing need to enable IPFS in eget
export
EGET_IPFS_DB
=
"
$eget_ipfs_db
"
}
epm_play
()
...
...
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