mkimage-profiles/features.in/repo/image-scripts.d/90-enable-repo

14 lines
455 B
Plaintext
Raw Normal View History

#!/bin/sh
# enable online repos if possible, just quit if list is absent
repo_source='/etc/apt/sources.list.d/yandex.list'
[ -s "$repo_source" ] || exit 0
# regexps from alterator-pkg (via installer-feature-online-repo)
prefix_re="[[:space:]]*rpm[[:space:]]\+\([^[:space:]]\+[[:space:]]\+\)\?"
host_re="http:\/\/\([^[:space:]]\+\)[[:space:]]\+"
updates_re="${prefix_re}${host_re}\([^[:space:]]\+\/\)\?"
sed -i "s/^#\($updates_re\)/\1/" "$repo_source"