Skip to content

Commit

Permalink
xmirror.in: fix failing if xbps-install doesn't sync
Browse files Browse the repository at this point in the history
  • Loading branch information
AnInternetTroll committed Jul 7, 2024
1 parent 06330d4 commit 8a3a006
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions xmirror.in
Original file line number Diff line number Diff line change
Expand Up @@ -153,18 +153,16 @@ ${BOLD}Do you want to continue?${RESET}" 20 80 || return
}

write_mirrors() {
set -e
local REPOSITORY="$1"
if ! [[ "$REPOSITORY" = *"://"* ]]; then
log "warning: mirror protocol not specified, assuming http://"
REPOSITORY="http://$REPOSITORY"
fi
mkdir -p "${ROOTDIR}/etc/xbps.d"
cp --no-preserve=mode,ownership --backup=simple --suffix=.old \
"${ROOTDIR}/usr/share/xbps.d"/*-repository-*.conf "${ROOTDIR}/etc/xbps.d/"
sed -i "s|https://repo-default.voidlinux.org|${REPOSITORY%/}|g" "${ROOTDIR}/etc/xbps.d"/*-repository-*.conf
"${ROOTDIR}/usr/share/xbps.d"/*-repository-*.conf "${ROOTDIR}/etc/xbps.d/" &&
sed -i "s|https://repo-default.voidlinux.org|${REPOSITORY%/}|g" "${ROOTDIR}/etc/xbps.d"/*-repository-*.conf &&
$XBPS_INSTALL -S -r "${ROOTDIR}"
set +e
}

reset_mirrors_int() {
Expand Down

0 comments on commit 8a3a006

Please sign in to comment.