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
6d8340e6
Commit
6d8340e6
authored
Oct 14, 2020
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm-repofix: add support for yandex and basealt
parent
9c886e4e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
3 deletions
+58
-3
epm
bin/epm
+1
-1
epm-repo
bin/epm-repo
+4
-0
epm-repofix
bin/epm-repofix
+53
-2
No files found.
bin/epm
View file @
6d8340e6
...
...
@@ -256,7 +256,7 @@ check_command()
repolist|sl|rl|listrepo|repo-list
)
# HELPCMD: print repo list
epm_cmd
=
repolist
;;
repofix
)
# HELPCMD:
fix paths in sources lists (ALT Linux only)
repofix
)
# HELPCMD:
<mirror>: fix paths in sources lists (ALT Linux only). use repofix etersoft/yandex/basealt for rewrite URL to the specified server
epm_cmd
=
repofix
;;
removerepo|rr
)
# HELPCMD: remove package repo
...
...
bin/epm-repo
View file @
6d8340e6
...
...
@@ -36,6 +36,10 @@ epm_repo()
load_helper epm-repofix
epm_repofix
"
$@
"
;;
change|set
)
# HELPCMD: <mirror>: switch sources to the mirror (supports etersoft/yandex/basealt): rewrite URL to the specified server
load_helper epm-repofix
epm_repofix
"
$@
"
;;
clean
)
# HELPCMD: remove temp. repos
# TODO: check for ALT
sudocmd apt-repo
$dryrun
clean
...
...
bin/epm-repofix
View file @
6d8340e6
...
...
@@ -78,8 +78,26 @@ __subst_with_etersoft_url()
{
local
NURL
=
"http://download.etersoft.ru/pub ALTLinux"
echo
"
$1
"
|
sed
\
-e
"s|h
\?
f
\?
t
\?
tp://ftp.altlinux.org/pub/distributions ALTLinux|
$NURL
|"
\
-e
"s|h
\?
f
\?
t
\?
tp://mirror.yandex.ru altlinux|
$NURL
|"
-e
"s|h
\?
f
\?
t
\?
tp://ftp.altlinux.org/pub/distributions/* ALTLinux|
$NURL
|"
\
-e
"s|h
\?
f
\?
t
\?
tp://ftp.basealt.ru/pub/distributions/* ALTLinux|
$NURL
|"
\
-e
"s|h
\?
f
\?
t
\?
tp://mirror.yandex.ru/* altlinux|
$NURL
|"
}
__subst_with_yandex_url
()
{
local
NURL
=
"http://mirror.yandex.ru altlinux"
echo
"
$1
"
|
sed
\
-e
"s|h
\?
f
\?
t
\?
tp://ftp.altlinux.org/pub/distributions/* ALTLinux|
$NURL
|"
\
-e
"s|h
\?
f
\?
t
\?
tp://ftp.basealt.ru/pub/distributions/* ALTLinux|
$NURL
|"
\
-e
"s|h
\?
f
\?
t
\?
tp://download.etersoft.ru/pub/* ALTLinux|
$NURL
|"
}
__subst_with_basealt_url
()
{
local
NURL
=
"http://ftp.basealt.ru/pub/distributions ALTLinux"
echo
"
$1
"
|
sed
\
-e
"s|h
\?
f
\?
t
\?
tp://mirror.yandex.ru/* altlinux|
$NURL
|"
\
-e
"s|h
\?
f
\?
t
\?
tp://download.etersoft.ru/pub/* ALTLinux|
$NURL
|"
}
__fix_repo_to_etersoft
()
...
...
@@ -87,11 +105,35 @@ __fix_repo_to_etersoft()
local
NN
a
=
""
apt-repo list |
grep
-v
debuginfo |
grep
-v
etersoft |
grep
-v
"file:/"
|
while
read
nn
;
do
NN
=
"
$(
__subst_with_etersoft_url
"
$nn
"
)
"
[
"
$NN
"
=
"
$nn
"
]
&&
continue
epm removerepo
"
$nn
"
epm addrepo
"
$NN
"
done
}
__fix_repo_to_yandex
()
{
local
NN
a
=
""
apt-repo list |
grep
-v
debuginfo |
grep
-v
mirror
\.
yandex |
grep
-v
"file:/"
|
while
read
nn
;
do
NN
=
"
$(
__subst_with_yandex_url
"
$nn
"
)
"
[
"
$NN
"
=
"
$nn
"
]
&&
continue
epm removerepo
"
$nn
"
epm addrepo
"
$NN
"
done
}
__fix_repo_to_basealt
()
{
local
NN
a
=
""
apt-repo list |
grep
-v
debuginfo |
grep
-v
ftp.basealt |
grep
-v
"file:/"
|
while
read
nn
;
do
NN
=
"
$(
__subst_with_basealt_url
"
$nn
"
)
"
[
"
$NN
"
=
"
$nn
"
]
&&
continue
epm removerepo
"
$nn
"
epm addrepo
"
$NN
"
done
}
epm_repofix
()
{
...
...
@@ -102,10 +144,19 @@ case $DISTRNAME in
[
-n
"
$quiet
"
]
||
docmd apt-repo list
__fix_alt_sources_list /etc/apt/sources.list
__fix_alt_sources_list /etc/apt/sources.list.d/
*
.list
# TODO: move to repo change
if
[
"
$pkg_filenames
"
=
"etersoft"
]
;
then
__fix_repo_to_etersoft /etc/apt/sources.list
__fix_repo_to_etersoft /etc/apt/sources.list.d/
*
.list
fi
if
[
"
$pkg_filenames
"
=
"yandex"
]
;
then
__fix_repo_to_yandex /etc/apt/sources.list
__fix_repo_to_yandex /etc/apt/sources.list.d/
*
.list
fi
if
[
"
$pkg_filenames
"
=
"basealt"
]
;
then
__fix_repo_to_basealt /etc/apt/sources.list
__fix_repo_to_basealt /etc/apt/sources.list.d/
*
.list
fi
docmd apt-repo list
return
;;
...
...
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