From 0fa998bc635bb7150597cbbdb30b2cd8ce51e519 Mon Sep 17 00:00:00 2001 From: Duncaen Date: Sat, 17 Jan 2026 16:41:00 +0100 Subject: [PATCH] xbps-src: add option to not sync repositories --- common/xbps-src/shutils/chroot.sh | 4 ++-- xbps-src | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/common/xbps-src/shutils/chroot.sh b/common/xbps-src/shutils/chroot.sh index 69a27603cc913e..c35b40d2291b99 100644 --- a/common/xbps-src/shutils/chroot.sh +++ b/common/xbps-src/shutils/chroot.sh @@ -316,7 +316,7 @@ chroot_sync_repodata() { fi # Make sure to sync index for remote repositories. - if [ -z "$XBPS_SKIP_REMOTEREPOS" ]; then + if [ -z "$XBPS_SKIP_REMOTEREPOS" -a -z "$XBPS_SKIP_SYNC" ]; then msg_normal "xbps-src: updating repositories for host ($XBPS_MACHINE)...\n" $XBPS_INSTALL_CMD $XBPS_INSTALL_ARGS -S fi @@ -327,7 +327,7 @@ chroot_sync_repodata() { cp $XBPS_MASTERDIR/var/db/xbps/keys/*.plist \ $XBPS_MASTERDIR/$XBPS_CROSS_BASE/var/db/xbps/keys # Make sure to sync index for remote repositories. - if [ -z "$XBPS_SKIP_REMOTEREPOS" ]; then + if [ -z "$XBPS_SKIP_REMOTEREPOS" -a -z "$XBPS_SKIP_SYNC" ]; then msg_normal "xbps-src: updating repositories for target ($XBPS_TARGET_MACHINE)...\n" env -- XBPS_TARGET_ARCH=$XBPS_TARGET_MACHINE \ $XBPS_INSTALL_CMD $XBPS_INSTALL_ARGS -r $XBPS_MASTERDIR/$XBPS_CROSS_BASE -S diff --git a/xbps-src b/xbps-src index 14e7d4259d6c96..704bfab39b28a5 100755 --- a/xbps-src +++ b/xbps-src @@ -218,6 +218,8 @@ $(print_cross_targets) -N Disable use of remote repositories to resolve dependencies. +-n Disable syncing of remote repositories. + -o Enable or disable (prefixed with ~) package build options. If 'etc/conf' already specifies some, it is merged. Keep in mind that these options @@ -384,7 +386,7 @@ XBPS_VERSION=${XBPS_VERSION##*:} readonly XBPS_SRC_VERSION="113" XBPS_OPTIONS= -XBPS_OPTSTRING="1A:a:bc:CEfgGhH:iIj:Lm:No:p:qsQKr:tvV" +XBPS_OPTSTRING="1A:a:bc:CEfgGhH:iIj:Lm:Nno:p:qsQKr:tvV" # Preprocess arguments in order to allow options before and after XBPS_TARGET. eval set -- $(getopt "$XBPS_OPTSTRING" "$@"); @@ -412,6 +414,7 @@ while getopts "$XBPS_OPTSTRING" opt; do L) export NOCOLORS=1; XBPS_OPTIONS+=" -L";; m) XBPS_ARG_MASTERDIR="$OPTARG"; XBPS_OPTIONS+=" -m $OPTARG";; N) XBPS_ARG_SKIP_REMOTEREPOS=1; XBPS_OPTIONS+=" -N";; + n) XBPS_ARG_SKIP_SYNC=1; XBPS_OPTIONS+=" -n";; o) XBPS_ARG_PKG_OPTIONS="$OPTARG"; XBPS_OPTIONS+=" -o $OPTARG";; p) XBPS_ARG_PRINT_VARIABLES="$OPTARG"; XBPS_OPTIONS+=" -p $OPTARG";; q) XBPS_ARG_QUIET=1; XBPS_OPTIONS+=" -q";; @@ -495,6 +498,7 @@ fi [ -n "$XBPS_ARG_BUILD_ONLY_ONE_PKG" ] && XBPS_BUILD_ONLY_ONE_PKG=yes [ -n "$XBPS_ARG_IGNORE_BROKENNESS" ] && XBPS_IGNORE_BROKENNESS=1 [ -n "$XBPS_ARG_SKIP_REMOTEREPOS" ] && XBPS_SKIP_REMOTEREPOS=1 +[ -n "$XBPS_ARG_SKIP_SYNC" ] && XBPS_SKIP_SYNC=1 [ -n "$XBPS_ARG_BUILD_FORCEMODE" ] && XBPS_BUILD_FORCEMODE=1 [ -n "$XBPS_ARG_INFORMATIVE_RUN" ] && XBPS_INFORMATIVE_RUN=1 [ -n "$XBPS_ARG_TEMP_MASTERDIR" ] && XBPS_TEMP_MASTERDIR=1