-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
temp: add stream 10 specific scripts
- Loading branch information
1 parent
2d6eeed
commit f6776e5
Showing
2 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
# Parses a CentOS Stream compose's repos | ||
#set -x | ||
|
||
if [ -n "$1" ] && [ -n "$2" ]; then | ||
MAJOR=$1 | ||
DATE=$2 | ||
else | ||
echo "Major version or date not specified" | ||
exit 1 | ||
fi | ||
|
||
# Verify the date format | ||
echo "${DATE}" | grep -Eq '[0-9]+\.[0-9]' | ||
grep_val=$? | ||
|
||
if [ "$grep_val" -ne 0 ]; then | ||
echo "Date format incorrect. You must use: YYYYMMDD.X" | ||
exit 2 | ||
fi | ||
|
||
export RLVER=$MAJOR | ||
source common | ||
|
||
drop="${PREPOPDROP}" | ||
current=$(pwd) | ||
tmpdir=$(mktemp -d) | ||
stream_compose_url="https://composes.stream.centos.org/stream-${MAJOR}/production/CentOS-Stream-${MAJOR}-${DATE}/compose" | ||
|
||
pushd "${tmpdir}" || { echo "Could not change directory"; exit 1; } | ||
for x in "${REPO[@]}"; do | ||
echo "Working on ${x}" | ||
for y in "${ARCH[@]}"; do | ||
repodatas=( $(dnf reposync --repofrompath ${x},${stream_compose_url}/${x}/${y}/os --download-metadata --repoid=${x} -p ${x}/${y} --forcearch ${y} --norepopath --remote-time --assumeyes -u | grep repodata) ) | ||
mkdir -p "${x}/${y}/repodata" | ||
pushd "${x}/${y}/repodata" || { echo "Could not change directory"; exit 1; } | ||
for z in "${repodatas[@]}"; do | ||
wget -q -nc "${z}" | ||
done | ||
wget -q -nc "${stream_compose_url}/${x}/${y}/os/repodata/repomd.xml" | ||
popd || { echo "Could not change back..."; exit 1; } | ||
done | ||
done | ||
/usr/bin/python3 "${current}/prepopulate_parser.py" --version ${MAJOR} | ||
ret_val=$? | ||
popd || { echo "Could not change back..."; exit 1; } | ||
|
||
if [ "$ret_val" -ne "0" ]; then | ||
echo "There was an error running through the parser." | ||
exit 1 | ||
fi | ||
|
||
echo "File located at: $drop" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
# Parses a CentOS Stream compose's repos | ||
#set -x | ||
|
||
if [ -n "$1" ] && [ -n "$2" ]; then | ||
MAJOR="$1" | ||
DATE="$2" | ||
else | ||
echo "Major version not specified" | ||
exit 1 | ||
fi | ||
|
||
# Verify the date format | ||
echo "${DATE}" | grep -Eq '[0-9]+\.[0-9]' | ||
grep_val=$? | ||
|
||
if [ "$grep_val" -ne 0 ]; then | ||
echo "Date format incorrect. You must use: YYYYMMDD.X" | ||
fi | ||
|
||
export RLVER="${MAJOR}" | ||
source common | ||
|
||
drop="${VERSDROP}" | ||
current=$(pwd) | ||
tmpdir=$(mktemp -d) | ||
#stream_compose_url="${STREAM_COMPOSE_BASEURL}/CentOS-Stream-${MAJOR}-${DATE}/compose" | ||
stream_compose_url="https://composes.stream.centos.org/stream-${MAJOR}/production/CentOS-Stream-${MAJOR}-${DATE}/compose" | ||
|
||
pushd "${tmpdir}" || { echo "Could not change directory"; exit 1; } | ||
for x in "${REPO[@]}"; do | ||
echo "Working on ${x}" | ||
for y in "${ARCH[@]}"; do | ||
repodatas=( $(dnf reposync --repofrompath ${x},${stream_compose_url}/${x}/${y}/os --download-metadata --repoid=${x} -p ${x}/${y} --forcearch ${y} --norepopath --remote-time --assumeyes -u | grep repodata) ) | ||
mkdir -p "${x}/${y}/repodata" | ||
pushd "${x}/${y}/repodata" || { echo "Could not change directory"; exit 1; } | ||
for z in "${repodatas[@]}"; do | ||
wget -q -nc "${z}" | ||
done | ||
wget -q -nc "${stream_compose_url}/${x}/${y}/os/repodata/repomd.xml" | ||
popd || { echo "Could not change back..."; exit 1; } | ||
done | ||
done | ||
/usr/bin/python3 "${current}/version_parser.py" --version "${MAJOR}" | ||
ret_val=$? | ||
popd || { echo "Could not change back..."; exit 1; } | ||
|
||
if [ "$ret_val" -ne "0" ]; then | ||
echo "There was an error running through the parser." | ||
exit 1 | ||
fi | ||
|
||
echo "File located at: $drop" |