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
7f331f5f
Commit
7f331f5f
authored
Mar 10, 2017
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epmsf: refactoring
parent
5aba0531
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
17 deletions
+15
-17
epm-sh-altlinux
bin/epm-sh-altlinux
+15
-17
No files found.
bin/epm-sh-altlinux
View file @
7f331f5f
...
...
@@ -56,6 +56,19 @@ __local_ercat()
done
}
# something like gzip
compress_file_inplace
()
{
local
OFILE
=
"
$1
"
if
epm assure lz4 </dev/null
;
then
docmd lz4
--rm
"
$OFILE
"
"
$OFILE
.lz4"
||
return
else
epm assure xz </dev/null
||
return
docmd xz
"
$OFILE
"
||
return
fi
return
0
}
# args: url/path target_file
# result: will set FILE
download_alt_contents_index
()
...
...
@@ -77,14 +90,7 @@ download_alt_contents_index()
docmd eget
-O
"
$OFILE
"
"
$1
"
||
{
touch
$OFILE
.failed
;
return
1
;
}
fi
# try compress
if
epm assure lz4 </dev/null
;
then
docmd lz4
--rm
"
$OFILE
"
"
$OFILE
.lz4"
||
return
else
epm assure xz </dev/null
||
return
docmd xz
"
$ofile
"
||
return
fi
return
0
compress_file_inplace
"
$OFILE
"
}
get_local_alt_contents_index
()
...
...
@@ -93,15 +99,7 @@ get_local_alt_contents_index()
local
LOCALPATH
# print out from local mirror
epm_repolist |
grep
"rpm.*file:/"
|
sed
-e
"s|^rpm.*file:||g"
|
while
read
URL ARCH other
;
do
LOCALPATH
=
$(
get_local_alt_mirror_path
"
$URL
/
$ARCH
"
)
download_alt_contents_index
$URL
/
$ARCH
/base/contents_index
$LOCALPATH
||
continue
echo
"
$LOCALPATH
/contents_index*"
done
# print out from mirrored contents_index
epm_repolist |
grep
-E
"rpm[[:space:]]*(ftp|http|https)://"
|
sed
-e
"s@^rpm.*
\(
ftp
\|
http
\|
https
\)
://@
\1
://@g"
|
while
read
URL ARCH other
;
do
epm_repolist |
grep
-E
"rpm.*(ftp://|http://|https://|file:/)"
|
sed
-e
"s@^rpm.*
\(
ftp://
\|
http://
\|
https://
\|
file:
\)
@
\1
@g"
|
while
read
URL ARCH other
;
do
LOCALPATH
=
$(
get_local_alt_mirror_path
"
$URL
/
$ARCH
"
)
download_alt_contents_index
$URL
/
$ARCH
/base/contents_index
$LOCALPATH
||
continue
echo
"
$LOCALPATH
/contents_index*"
...
...
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