Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mkimage-profiles
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
1
Merge Requests
1
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
Ximper Linux
mkimage-profiles
Commits
3a3ebe0b
Commit
3a3ebe0b
authored
Feb 02, 2022
by
Anton Midyukov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
repo: add the ability to select a repository mirror (default http/alt)
Default changed from yandex to alt due to:
https://bugzilla.altlinux.org/show_bug.cgi?id=41588#c1
parent
31afa367
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
5 deletions
+39
-5
README
features.in/repo/README
+8
-0
config.mk
features.in/repo/config.mk
+2
-0
90-enable-repo
features.in/repo/image-scripts.d/90-enable-repo
+29
-5
No files found.
features.in/repo/README
View file @
3a3ebe0b
...
...
@@ -6,3 +6,11 @@
addons, updates или иных по мере необходимости.
Результат -- каталог ALTLinux/base/ для копирования в образ.
Дополнительно обрабатываемые переменные:
* REPO
** позволяет выбрать и включить зеркало репозитория
** не влияет ни на что, если вызывается цель use/repo/main
** значение: http/alt (по умолчанию) либо протокол/зеркало
** см. тж. /etc/apt/sources.list.d/, проверьте наличие нужного!
features.in/repo/config.mk
View file @
3a3ebe0b
use/repo:
@$(call add_feature)
@$(call add,STAGE1_PACKAGES,gnupg)
@$(call try,REPO,rsync/alt)
@$(call xport,ROOTFS_MAIN)
@$(call xport,REPO)
use/repo/main:: sub/main use/repo; @:
...
...
features.in/repo/image-scripts.d/90-enable-repo
View file @
3a3ebe0b
#!/bin/sh
# enable online repos if possible, just quit if list is absent
repo_source
=
'/etc/apt/sources.list.d/yandex.list'
# enable online repos if not use/repo/main
[
-z
"
$GLOBAL_ROOTFS_MAIN
"
]
||
exit
0
[
-s
"
$repo_source
"
]
||
exit
0
[
-n
"
$GLOBAL_REPO
"
]
||
exit
0
PROTO
=
"
${
GLOBAL_REPO
%/*
}
"
# http, ftp, rsync
case
"
$PROTO
"
in
http|ftp|rsync
)
;;
*
)
echo
"Error: protocol
$PROTO
not supported"
>
&2
exit
1
;;
esac
MIRROR
=
"
${
GLOBAL_REPO
#*/
}
"
# alt, heanet, kiev, yandex, ...
if
[
-z
"
$MIRROR
"
]
;
then
echo
"Error: variable MIRROR is not set!!!"
>
&2
echo
"Set REPO variable in the format: PROTO/MIRROR"
>
&2
echo
"Example: http/yandex"
>
&2
exit
1
fi
repo_source
=
"/etc/apt/sources.list.d/
$MIRROR
.list"
if
[
!
-s
"
$repo_source
"
]
;
then
echo
"Error:
$repo_source
is not exist"
>
&2
exit
1
fi
# regexps from alterator-pkg (via installer-feature-online-repo)
prefix_re
=
"[[:space:]]*rpm[[:space:]]
\+\(
[^[:space:]]
\+
[[:space:]]
\+\)\?
"
host_re
=
"
http
:
\/\/\(
[^[:space:]]
\+\)
[[:space:]]
\+
"
host_re
=
"
${
PROTO
:-
http
}
:
\/\/\(
[^[:space:]]
\+\)
[[:space:]]
\+
"
updates_re
=
"
${
prefix_re
}${
host_re
}
\(
[^[:space:]]
\+\/\)\?
"
sed
-i
"s/^#
\(
$updates_re
\)
/
\1
/"
"
$repo_source
"
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