generate-cgcs-tis-repo: Fix bashate indent issues

This fixes tox issues that where identified when the debrand
and rename of this script to be a .sh extension.

Change-Id: Ie694e8578c8b75191b60facb723daf4175a8ab87
Signed-off-by: Saul Wold <sgw@linux.intel.com>
This commit is contained in:
Saul Wold 2020-08-07 12:45:52 -07:00
parent f32c3e5b09
commit e390e85bd5
1 changed files with 54 additions and 54 deletions

View File

@ -36,35 +36,35 @@ ORIGIN="/import/mirrors/CentOS/${SRC_BUILD_ENVIRONMENT}/CentOS/pike"
CREATEREPO=$(which createrepo_c)
if [ $? -ne 0 ]; then
CREATEREPO="createrepo"
CREATEREPO="createrepo"
fi
# Create directories
for d in "$DEST_RPM" "$DEST_SRPM" "$TIS_CACHE_DIR"; do
if [ ! -d "$d" ]; then
mkdir -p "$d"
fi
if [ ! -d "$d" ]; then
mkdir -p "$d"
fi
done
if [ ! -e "$TIS_CACHE_ORIGIN" ]; then
echo "$ORIGIN" > $TIS_CACHE_ORIGIN
ORIGIN_DIR="$ORIGIN"
echo "$ORIGIN" > $TIS_CACHE_ORIGIN
ORIGIN_DIR="$ORIGIN"
else
ORIGIN_DIR=$(grep -v '^#' $TIS_CACHE_ORIGIN | head -n 1)
ORIGIN_DIR=$(grep -v '^#' $TIS_CACHE_ORIGIN | head -n 1)
fi
if [ ! -d "$ORIGIN_DIR" ]; then
echo "ERROR: directory not found '$ORIGIN_DIR'"
exit -1
echo "ERROR: directory not found '$ORIGIN_DIR'"
exit -1
fi
# copy standard and rt build of binary packages
for f in $(find "$RT_PKG_DIR" "$STD_PKG_DIR" -name '*.rpm' \
| grep -v '[.]src[.]rpm'); do
ff="$(basename $f)"
echo "$ff"
cp "$f" "$DEST_RPM"
touch "${DEST_RPM}/${ff}" --date="$TIMESTAMP"
| grep -v '[.]src[.]rpm'); do
ff="$(basename $f)"
echo "$ff"
cp "$f" "$DEST_RPM"
touch "${DEST_RPM}/${ff}" --date="$TIMESTAMP"
done
# Make a repo out of it
@ -72,10 +72,10 @@ done
# copy standard and rt build of src.rpm packages
for f in $(find "$STD_PKG_DIR" "$RT_PKG_DIR" -name '*.src.rpm'); do
ff="$(basename $f)"
echo "$ff"
cp "$f" "$DEST_SRPM"
touch "${DEST_SRPM}/${ff}" --date="$TIMESTAMP"
ff="$(basename $f)"
echo "$ff"
cp "$f" "$DEST_SRPM"
touch "${DEST_SRPM}/${ff}" --date="$TIMESTAMP"
done
# Make a repo out of it
@ -86,14 +86,14 @@ date > "${DEST_RPM_ROOT_NEW}/last_updated"
# Rotate directories ... current becomes old, and new becomes current
if [ -d $DEST_RPM_ROOT ]; then
mv "$DEST_RPM_ROOT" "$DEST_RPM_ROOT_OLD"
mv "$DEST_RPM_ROOT" "$DEST_RPM_ROOT_OLD"
fi
mv "$DEST_RPM_ROOT_NEW" "$DEST_RPM_ROOT"
rm -rf "$DEST_RPM_ROOT_OLD"
if [ -d "$DEST_SRPM_ROOT" ]; then
mv "$DEST_SRPM_ROOT" "$DEST_SRPM_ROOT_OLD"
mv "$DEST_SRPM_ROOT" "$DEST_SRPM_ROOT_OLD"
fi
mv "$DEST_SRPM_ROOT_NEW" "$DEST_SRPM_ROOT"
@ -102,52 +102,52 @@ rm -rf "$DEST_SRPM_ROOT_OLD"
# Update symlinks in cgcs-tis-repo
for d in $(find "$ORIGIN_DIR" -type d | tail -n +2); do
RELATIVE_DIR=$(echo $d | sed "s#^$ORIGIN_DIR/##")
if [ -d "${TIS_REPO_DIR}/${RELATIVE_DIR}" ]; then
rm -rf "${TIS_REPO_DIR}/${RELATIVE_DIR}/*"
fi
echo "mkdir -p $RELATIVE_DIR"
mkdir -p "${TIS_REPO_DIR}/${RELATIVE_DIR}"
RELATIVE_DIR=$(echo $d | sed "s#^$ORIGIN_DIR/##")
if [ -d "${TIS_REPO_DIR}/${RELATIVE_DIR}" ]; then
rm -rf "${TIS_REPO_DIR}/${RELATIVE_DIR}/*"
fi
echo "mkdir -p $RELATIVE_DIR"
mkdir -p "${TIS_REPO_DIR}/${RELATIVE_DIR}"
done
for d in $(find "$ORIGIN_DIR" -type d | tail -n +2); do
for f in $(find $d -maxdepth 1 -type f); do
RELATIVE_FILE=$(echo $f | sed "s#^$ORIGIN_DIR/##")
if [ -e "${TIS_REPO_DIR}/${RELATIVE_FILE}" ]; then
rm -f "${TIS_REPO_DIR}/${RELATIVE_FILE}"
fi
ln -s "$f" "${TIS_REPO_DIR}/${RELATIVE_FILE}"
done
for f in $(find $d -maxdepth 1 -type f); do
RELATIVE_FILE=$(echo $f | sed "s#^$ORIGIN_DIR/##")
if [ -e "${TIS_REPO_DIR}/${RELATIVE_FILE}" ]; then
rm -f "${TIS_REPO_DIR}/${RELATIVE_FILE}"
fi
ln -s "$f" "${TIS_REPO_DIR}/${RELATIVE_FILE}"
done
done
for d in $(find -L "$TIS_REPO_DIR" -type d -name repodata); do
pushd "${d}/.."
rm -rf repodata
if [ -f "comps.xml" ]; then
"$CREATEREPO" -g comps.xml "$PWD"
else
"$CREATEREPO" "$PWD"
fi
popd
pushd "${d}/.."
rm -rf repodata
if [ -f "comps.xml" ]; then
"$CREATEREPO" -g comps.xml "$PWD"
else
"$CREATEREPO" "$PWD"
fi
popd
done
# Recreate repodata
cd "$TIS_REPO_DIR"
for d in $(find -L . -type d -name repodata); do
pushd "${d}/.."
for c in $(ls -1 repodata/*comps*xml); do
mv -f "${c}" comps.xml
done
if [ -d "repodata" ]; then
rm -rf repodata
fi
if [ -f "comps.xml" ]; then
$CREATEREPO -g comps.xml "$PWD"
else
$CREATEREPO "$PWD"
fi
popd
pushd "${d}/.."
for c in $(ls -1 repodata/*comps*xml); do
mv -f "${c}" comps.xml
done
if [ -d "repodata" ]; then
rm -rf repodata
fi
if [ -f "comps.xml" ]; then
$CREATEREPO -g comps.xml "$PWD"
else
$CREATEREPO "$PWD"
fi
popd
done
# Update the dependancy_cache under cgcs-tis-repo