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
88ae5fc6
Commit
88ae5fc6
authored
Feb 18, 2024
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm-repofix: rewrite epm repo change
parent
364c7f2b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
88 deletions
+30
-88
epm-repofix
bin/epm-repofix
+30
-88
No files found.
bin/epm-repofix
View file @
88ae5fc6
...
...
@@ -130,7 +130,8 @@ __try_fix_apt_source_list()
local
list
=
"
$1
"
local
br
=
"
$(
__repofix_filter_vendor
"
$2
"
)
"
local
path
=
"
$3
"
if
grep
-q
-e
"^[^#].*
$path
"
$list
;
then
# FIXME: masked grep: предупреждение: stray \ before /
if
grep
-q
-e
"^[^#].*
$path
"
$list
2>/dev/null
;
then
if
__repofix_check_vendor
$br
;
then
regexp_subst
"/
$path
/s/^rpm[[:space:]]*([fhr])/rpm [
$br
]
\1
/"
$list
else
...
...
@@ -169,29 +170,12 @@ __fix_alt_sources_list()
done
}
__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://ftp.basealt.ru/pub/distributions/* ALTLinux|
$NURL
|"
\
-e
"s|h
\?
f
\?
t
\?
tp://mirror.yandex.ru/* altlinux|
$NURL
|"
\
-e
"s|h
\?
f
\?
t
\?
tp://mirror.eterfund.org/download.etersoft.ru/pub/* ALTLinux|
$NURL
|"
}
__subst_with_eterfund_url
()
{
local
NURL
=
"https://mirror.eterfund.org/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://ftp.basealt.ru/pub/distributions/* ALTLinux|
$NURL
|"
\
-e
"s|h
\?
f
\?
t
\?
tp://mirror.yandex.ru/* altlinux|
$NURL
|"
}
__subst_with_
yandex
_url
()
__subst_with_
repo
_url
()
{
local
NURL
=
"
http://mirror.yandex.ru altlinux
"
local
NURL
=
"
$2
"
echo
"
$1
"
|
sed
\
-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://ftp.etersoft.ru/pub/* ALTLinux|
$NURL
|"
\
...
...
@@ -199,56 +183,15 @@ __subst_with_yandex_url()
-e
"s|h
\?
f
\?
t
\?
tp://mirror.eterfund.org/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://ftp.etersoft.ru/pub/* ALTLinux|
$NURL
|"
\
-e
"s|h
\?
f
\?
t
\?
tp://mirror.eterfund.org/download.etersoft.ru/pub/* ALTLinux|
$NURL
|"
\
-e
"s|h
\?
f
\?
t
\?
tp://download.etersoft.ru/pub/* ALTLinux|
$NURL
|"
}
__subst_with_altlinux_url
()
{
local
NURL
=
"http://ftp.altlinux.org/pub/distributions ALTLinux"
echo
"
$1
"
|
sed
\
-e
"s|h
\?
f
\?
t
\?
tp://mirror.yandex.ru/* altlinux|
$NURL
|"
\
-e
"s|h
\?
f
\?
t
\?
tp://ftp.etersoft.ru/pub/* ALTLinux|
$NURL
|"
\
-e
"s|h
\?
f
\?
t
\?
tp://mirror.eterfund.org/download.etersoft.ru/pub/* ALTLinux|
$NURL
|"
\
-e
"s|h
\?
f
\?
t
\?
tp://download.etersoft.ru/pub/* ALTLinux|
$NURL
|"
}
__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
()
__change_repo
()
{
local
SHORT
=
"
$1
"
local
REPLTO
=
"
$2
"
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
"
)
"
a
=
""
apt-repo list |
grep
-v
$SHORT
|
grep
-v
"file:/"
|
while
read
nn
;
do
NN
=
"
$(
__subst_with_
repo_url
"
$nn
"
"
$REPLTO
"
)
"
[
"
$NN
"
=
"
$nn
"
]
&&
continue
epm removerepo
"
$nn
"
epm addrepo
"
$NN
"
epm addrepo
"
$NN
"
&&
epm removerepo
"
$nn
"
||
return
1
done
}
...
...
@@ -264,26 +207,25 @@ case $BASEDISTRNAME in
__fix_alt_sources_list /etc/apt/sources.list
__fix_alt_sources_list /etc/apt/sources.list.d/
*
.list
# TODO: move to repo change
if
[
"
$1
"
=
"etersoft"
]
;
then
__fix_repo_to_etersoft /etc/apt/sources.list
__fix_repo_to_etersoft /etc/apt/sources.list.d/
*
.list
fi
if
[
"
$1
"
=
"eterfund.org"
]
;
then
__fix_repo_to_eterfund /etc/apt/sources.list
__fix_repo_to_eterfund /etc/apt/sources.list.d/
*
.list
fi
if
[
"
$1
"
=
"yandex"
]
;
then
__fix_repo_to_yandex /etc/apt/sources.list
__fix_repo_to_yandex /etc/apt/sources.list.d/
*
.list
fi
if
[
"
$1
"
=
"basealt"
]
;
then
__fix_repo_to_basealt /etc/apt/sources.list
__fix_repo_to_basealt /etc/apt/sources.list.d/
*
.list
fi
if
[
"
$1
"
=
"altlinux.org"
]
;
then
__fix_repo_to_altlinux /etc/apt/sources.list
__fix_repo_to_altlinux /etc/apt/sources.list.d/
*
.list
fi
case
"
$1
"
in
"etersoft"
)
__change_repo etersoft
"http://download.etersoft.ru/pub ALTLinux"
;;
"eterfund.org"
)
__change_repo eterfund.org
"https://mirror.eterfund.org/download.etersoft.ru/pub ALTLinux"
;;
"yandex"
)
__change_repo mirror.yandex
"http://mirror.yandex.ru altlinux"
;;
"basealt"
)
__change_repo ftp.basealt
"http://ftp.basealt.ru/pub/distributions ALTLinux"
;;
"altlinux.org"
)
__change_repo ftp.altlinux
"http://ftp.altlinux.org/pub/distributions ALTLinux"
;;
*
)
fatal
"Unsupported change key
$1
"
esac
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