Skip to content

Commit

Permalink
Fallback to createrepo if createrepo_c is not available
Browse files Browse the repository at this point in the history
and exit with 1 if none is installed
  • Loading branch information
jpopelka committed Apr 30, 2024
1 parent 91d6d70 commit 6819a37
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion mtps-get-builds
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ which 'createrepo' >/dev/null 2>&1 && GB_CREATEREPO_BIN="createrepo" || :
which 'createrepo_c' >/dev/null 2>&1 && GB_CREATEREPO_BIN="createrepo_c" || :
if [ -z "$GB_CREATEREPO_BIN" ]; then
echo "Install createrepo[_c] to create repositories."
exit 0
exit 1
fi
echo "Using $GB_CREATEREPO_BIN"
"$GB_CREATEREPO_BIN" --database "$GB_REPODIR"
Expand Down
2 changes: 1 addition & 1 deletion mtps-get-module
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ which 'modifyrepo' >/dev/null 2>&1 && MODIFYREPO_BIN="modifyrepo" || :
which 'modifyrepo_c' >/dev/null 2>&1 && MODIFYREPO_BIN="modifyrepo_c" || :
if [[ -z "$CREATEREPO_BIN" || -z "$MODIFYREPO_BIN" ]]; then
echo "Install createrepo[_c] to create repositories."
exit 0
exit 1
fi

echo "Using $CREATEREPO_BIN"
Expand Down
2 changes: 1 addition & 1 deletion mtps-get-task
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ which 'createrepo' >/dev/null 2>&1 && CREATEREPO_BIN="createrepo" || :
which 'createrepo_c' >/dev/null 2>&1 && CREATEREPO_BIN="createrepo_c" || :
if [ -z "$CREATEREPO_BIN" ]; then
echo "Install createrepo[_c] to create repositories."
exit 0
exit 1
fi
echo "Using $CREATEREPO_BIN"
"$CREATEREPO_BIN" --database "$REPODIR"
Expand Down
6 changes: 2 additions & 4 deletions profiles/rhel/prepare-system
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,9 @@ if [ -n "$ENABLE_BUILD_ROOT" ]; then
yum-config-manager --enable "$buildroot_repo"
fi

# repoquery util acts not on live system, but rather on set of enabled repos. mini-tps hold personal list of protected packages, such as openssh-server
# yum config-manager --set-enabled astepano-mini-tps || :

echo "Installing required packages for testing"
yum -y install createrepo_c which procps-ng
yum -y install createrepo_c || yum -y install createrepo
yum -y install which procps-ng

yum -y upgrade
yum clean all
Expand Down

0 comments on commit 6819a37

Please sign in to comment.