Skip to content
Snippets Groups Projects

Read the modifyrepo to add in repomd the updateinfo and module info

Merged Marta Vila Fernandes requested to merge modifyrepo into master
1 file
+ 6
8
Compare changes
  • Side-by-side
  • Inline
+ 6
8
@@ -162,19 +162,17 @@ EOF
# Keep the current xml.gz file and remove the older one
UPDXMLFILE=$(/bin/ls -1tr $REPOPATH/*-updateinfo.xml.gz 2>&1 | /usr/bin/tail -1)
if [ -f "$UPDXMLFILE" ]; then
/bin/cp -f $UPDXMLFILE $REPOPATH/updateinfo.xml.gz
/bin/gunzip -f $REPOPATH/updateinfo.xml.gz
/usr/bin/modifyrepo $REPOPATH/updateinfo.xml $REPOPATH/repodata
/usr/bin/find ${REPOPATH} -name '*updateinfo.xml*' -not -name $UPDXMLFILE -printf "removed '%f'\n" -delete
/usr/bin/modifyrepo $UPDXMLFILE $REPOPATH/repodata
NEWUPDXMLFILE=$(sed '/updateinfo.xml.gz/!d; s/.*repodata\/\(.*\)".*/\1/' ${REPOPATH}/repodata/repomd.xml)
/usr/bin/find ${REPOPATH} -name '*updateinfo.xml*' -not -name $NEWUPDXMLFILE -printf "removed '%f'\n" -delete
fi
# Keep the current yaml.gz file and remove the older one
MODULEFILE=$(/bin/ls -1tr ${REPOPATH}/*-module*yaml.gz 2>&1 | /usr/bin/tail -1)
if [ -f "$MODULEFILE" ]; then
/bin/cp -f $MODULEFILE $REPOPATH/modulefile.yaml.gz
/bin/gunzip -f $REPOPATH/modulefile.yaml.gz
/usr/bin/modifyrepo --mdtype=modules $REPOPATH/modulefile.yaml $REPOPATH/repodata
/usr/bin/find ${REPOPATH} -name '*module*.yaml*' -not -name $MODULEFILE -printf "removed '%f'\n" -delete
/usr/bin/modifyrepo --mdtype=modules $MODULEFILE $REPOPATH/repodata
NEWMODULEFILE=$(sed '/yaml.gz/!d; s/.*repodata\/\(.*\)".*/\1/' ${REPOPATH}/repodata/repomd.xml)
/usr/bin/find ${REPOPATH} -name '*module*.yaml*' -not -name $NEWMODULEFILE -printf "removed '%f'\n" -delete
fi
fi # end of if [[ $RUN_CREATEREPO -eq 1 ]]
Loading