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
Nurlan
eepm
Commits
ca1137db
Commit
ca1137db
authored
Mar 10, 2017
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm sf: make compressed cache for local file too
parent
21ab4038
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
+17
-14
epm-sh-altlinux
bin/epm-sh-altlinux
+17
-14
No files found.
bin/epm-sh-altlinux
View file @
ca1137db
...
@@ -33,7 +33,7 @@ get_local_alt_mirror_path()
...
@@ -33,7 +33,7 @@ get_local_alt_mirror_path()
[
"
$BN1
"
=
"branch"
]
&&
echo
"/tmp/eepm/
$BN2
/
$BN1
/
$BN0
"
||
echo
"/tmp/eepm/
$BN1
/
$BN0
"
[
"
$BN1
"
=
"branch"
]
&&
echo
"/tmp/eepm/
$BN2
/
$BN1
/
$BN0
"
||
echo
"/tmp/eepm/
$BN1
/
$BN0
"
}
}
# args: url target_file
# args: url
/path
target_file
# result: will set FILE
# result: will set FILE
download_alt_contents_index
()
download_alt_contents_index
()
{
{
...
@@ -47,16 +47,21 @@ download_alt_contents_index()
...
@@ -47,16 +47,21 @@ download_alt_contents_index()
mkdir
-p
"
$TD
"
mkdir
-p
"
$TD
"
docmd eget
-O
"
$OFILE
"
"
$1
"
||
return
if
echo
"
$1
"
|
grep
-q
"/"
;
then
# TODO: separate
cp
-fv
"
$1
"
"
$OFILE
"
||
return
else
docmd eget
-O
"
$OFILE
"
"
$1
"
||
return
fi
# plain file by default
# plain file by default
echo
""
>
$DONE
echo
""
>
$DONE
# try compress
# try compress
if
epm assure lz4
;
then
if
epm assure lz4
</dev/null
;
then
docmd lz4
--rm
"
$OFILE
"
"
$OFILE
.lz4"
||
return
docmd lz4
--rm
"
$OFILE
"
"
$OFILE
.lz4"
||
return
echo
"lz4"
>
$DONE
echo
"lz4"
>
$DONE
else
else
epm assure xz
||
return
epm assure xz
</dev/null
||
return
docmd xz
"
$ofile
"
||
return
docmd xz
"
$ofile
"
||
return
echo
"xz"
>
$DONE
echo
"xz"
>
$DONE
fi
fi
...
@@ -66,21 +71,19 @@ get_local_alt_contents_index()
...
@@ -66,21 +71,19 @@ get_local_alt_contents_index()
{
{
load_helper epm-repolist
load_helper epm-repolist
local
LOCALPATH
# print out from local mirror
# print out from local mirror
epm_repolist |
grep
"rpm.*file:/"
|
sed
-e
"s|^rpm.*file:||g"
|
while
read
LOCALPATH ARCH other
;
do
epm_repolist |
grep
"rpm.*file:/"
|
sed
-e
"s|^rpm.*file:||g"
|
while
read
URL ARCH other
;
do
test
-d
"
$LOCALPATH
/
$ARCH
"
||
continue
LOCALPATH
=
$(
get_local_alt_mirror_path
"
$URL
/
$ARCH
"
)
FILE
=
"
$LOCALPATH
/
$ARCH
/base/contents_index"
download_alt_contents_index
$URL
/
$ARCH
/base/contents_index
$LOCALPATH
||
continue
if
[
-r
"
$FILE
"
]
;
then
echo
"
$LOCALPATH
/contents_index*"
echo
"
$FILE
"
else
info
"TODO for girar server: There is no
$(
basename
$FILE
)
file in
$(
dirname
$FILE
)
"
fi
done
done
# print out from mirrored contents_index
# 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[[:space:]]*(ftp|http|https)://"
|
sed
-e
"s@^rpm.*
\(
ftp
\|
http
\|
https
\)
://@
\1
://
@g"
|
while
read
URL ARCH other
;
do
LOCALPATH
=
$(
get_local_alt_mirror_path
"
$URL
/
$ARCH
"
)
LOCALPATH
=
$(
get_local_alt_mirror_path
"
$URL
/
$ARCH
"
)
download_alt_contents_index
$URL
/
$ARCH
/base/contents_index
$LOCALPATH
download_alt_contents_index
$URL
/
$ARCH
/base/contents_index
$LOCALPATH
||
continue
echo
"
$LOCALPATH
/contents_index*"
echo
"
$LOCALPATH
/contents_index*"
done
done
...
...
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