Skip to content
Snippets Groups Projects
Commit 33834e86 authored by Marta Vila Fernandes's avatar Marta Vila Fernandes :game_die:
Browse files

the backticks are the old way of doing subshells, use the new format

parent ecfe8320
No related branches found
No related tags found
1 merge request!223[LOS1012] Stop unzip of the yaml and xml files
Pipeline #4800861 passed
......@@ -24,8 +24,8 @@ echo "Inputs: REPOID=\"$REPOID\" REPOFILE=\"$REPOFILE\" REPOPATH=\"$REPOPATH\" C
REPOPATH="/repo/${REPOPATH}"
# Record what's already there first
/usr/bin/find ${REPOPATH} -type f -name "*.rpm" ! -size 0 -printf '%f %s\n' > /tmp/prelist
PRECOUNT=`wc -l /tmp/prelist | cut -d' ' -f1`
PRESIZE=`awk '{print $2}' /tmp/prelist | paste -sd+ | bc`
PRECOUNT=$(wc -l /tmp/prelist | cut -d' ' -f1)
PRESIZE=$(awk '{print $2}' /tmp/prelist | paste -sd+ | bc)
echo "[${REPOID}]" > /etc/yum.repos.d/sync.repo
echo $REPOFILE | base64 -d >> /etc/yum.repos.d/sync.repo
......@@ -112,12 +112,12 @@ if [ $? -eq 0 ]; then
fi
# Now let's look at the new stuff
/usr/bin/find ${REPOPATH} -type f -name "*.rpm" ! -size 0 -printf '%f %s\n' > /tmp/postlist
POSTCOUNT=`wc -l /tmp/postlist | cut -d' ' -f1`
POSTCOUNT=$(wc -l /tmp/postlist | cut -d' ' -f1)
# cdn.redhat.com delivers us some rpms with junk attached at the end ... ?
# these are 'useable' but since the size changes, metadata must be regenerated to
# take it into account.
POSTSIZE=`awk '{print $2}' /tmp/postlist | paste -sd+ | bc`
POSTSIZE=$(awk '{print $2}' /tmp/postlist | paste -sd+ | bc)
if [[ ($PRECOUNT -eq $POSTCOUNT) && ($PRESIZE -ne $POSTSIZE) ]]; then
cat << EOF | error | tee $OUTPUT
......@@ -126,11 +126,11 @@ EOF
fi
if [[ ($PRECOUNT -ne $POSTCOUNT) || ($PRESIZE -ne $POSTSIZE) ]]; then
CHANGELIST=`/usr/bin/diff --changed-group-format='%>' --unchanged-group-format='' <(awk '{print $1}' /tmp/prelist) <(awk '{print $1}' /tmp/postlist)`
CHANGELIST=$(/usr/bin/diff --changed-group-format='%>' --unchanged-group-format='' <(awk '{print $1}' /tmp/prelist) <(awk '{print $1}' /tmp/postlist))
# Run createrepo
if [[ $RUN_CREATEREPO -eq 1 ]]; then
COMPXMLFILE=`/bin/ls -1tr ${REPOPATH}/*-comps*xml.gz 2>&1 | /usr/bin/tail -1`
COMPXMLFILE=$(/bin/ls -1tr ${REPOPATH}/*-comps*xml.gz 2>&1 | /usr/bin/tail -1)
if [ -f "$COMPXMLFILE" ]; then
/bin/cp -f $COMPXMLFILE $REPOPATH/comps.xml.gz
......@@ -180,11 +180,11 @@ fi
for rpm in ${CHANGELIST}; do
path=`/usr/bin/find ${REPOPATH} -type f -name "${rpm}"`
info=`/usr/bin/rpm --queryformat "%{NAME} %{VERSION}-%{RELEASE} %{ARCH}" -qp ${path} 2>/dev/null`
name=`echo $info | cut -d' ' -f1`
version=`echo $info | cut -d' ' -f2`
arch=`echo $info | cut -d' ' -f3`
path=$(/usr/bin/find ${REPOPATH} -type f -name "${rpm}")
info=$(/usr/bin/rpm --queryformat "%{NAME} %{VERSION}-%{RELEASE} %{ARCH}" -qp ${path} 2>/dev/null)
name=$(echo $info | cut -d' ' -f1)
version=$(echo $info | cut -d' ' -f2)
arch=$(echo $info | cut -d' ' -f3)
cat << EOF | log
"message_type": "change",
......@@ -206,7 +206,7 @@ cat << EOF | log
EOF
# Turn the new-line separated list of changes into a comma-separated list of quoted strings
LIST=`sed 's/^/"/;s/$/"/;s/^""$//' <(echo "${CHANGELIST}") | /usr/bin/tr '\n' ',' | sed 's/,$//'`
LIST=$(sed 's/^/"/;s/$/"/;s/^""$//' <(echo "${CHANGELIST}") | /usr/bin/tr '\n' ',' | sed 's/,$//')
cat << EOF | log > $OUTPUT
"message_type": "result",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment