diskimage-builder/diskimage_builder/elements/openeuler-minimal/pre-install.d/00-setup-mirror
wangxiyuan e5cf2faae3 Rename openeuler mirror script
The file name under pre-install.d should be like "^[0-9A-Za-z_-]+$",
otherwise the script will be skipped by the name check step and raise
"Ignoring non-conforming filenames" warning.

This patch rename the openeuler mirror script to ensure it follows
the regex.

Change-Id: I6d868df7932345547711100519523546bd53360e
2023-03-29 02:29:33 +00:00

14 lines
453 B
Bash
Executable File

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
if [ -n "${DIB_DISTRIBUTION_MIRROR:-}" ]; then
# Only set the mirror for OS, everything, EPOL and update repositories,
# The others (debuginfo and source) aren't mirrored since they do not exist on all mirrors
sed -i "/\(debuginfo\|source\)/! {s#http://repo.openeuler.org#$DIB_DISTRIBUTION_MIRROR#g}" $TARGET_ROOT/etc/yum.repos.d/openEuler.repo
fi