forked from sig_core/toolkit
Change parsers to have switches, KPR for branching
This commit is contained in:
parent
6e6d2adf91
commit
3d4e4f40c2
42
mangle/generators/generate_prepopulate_from_kpr
Executable file
42
mangle/generators/generate_prepopulate_from_kpr
Executable file
@ -0,0 +1,42 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Parses a koji tag for a branch out
|
||||||
|
#set -x
|
||||||
|
|
||||||
|
if [ -n "$1" ]; then
|
||||||
|
MAJOR=$1
|
||||||
|
else
|
||||||
|
echo "Major version not specified"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
export RLVER=$MAJOR
|
||||||
|
source common
|
||||||
|
|
||||||
|
drop="${PREPOPDROP}"
|
||||||
|
current=$(pwd)
|
||||||
|
tmpdir=$(mktemp -d)
|
||||||
|
tag_template="c${MAJOR}s-build"
|
||||||
|
stream_repo_url="${STREAM_KOJI_REPO}/${tag_template}/latest"
|
||||||
|
|
||||||
|
pushd "${tmpdir}" || { echo "Could not change directory"; exit 1; }
|
||||||
|
for y in "${ARCH[@]}"; do
|
||||||
|
repodatas=( $(dnf reposync --repofrompath ${tag_template},${stream_repo_url}/${y} --download-metadata --repoid=${tag_template} -p ${tag_template}/${y} --forcearch ${y} --norepopath --remote-time --assumeyes -u | grep repodata) )
|
||||||
|
mkdir -p "${tag_template}/${y}/repodata"
|
||||||
|
pushd "${tag_template}/${y}/repodata" || { echo "Could not change directory"; exit 1; }
|
||||||
|
for z in "${repodatas[@]}"; do
|
||||||
|
wget -q -nc "${z}"
|
||||||
|
done
|
||||||
|
wget -q -nc "${stream_repo_url}/${y}/repodata/repomd.xml"
|
||||||
|
popd || { echo "Could not change back..."; exit 1; }
|
||||||
|
done
|
||||||
|
/usr/bin/python3 "${current}/prepopulate_parser.py" --version $RLVER --stream
|
||||||
|
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
|
||||||
|
|
||||||
|
sed -i "s|${tag_template}|branched|g" $drop
|
||||||
|
echo "File located at: $drop"
|
@ -27,7 +27,7 @@ current=$(pwd)
|
|||||||
compose_dir="${COMPOSE_BASEDIR}/${MAJOR}/Rocky-${MAJOR}-${DATE}/compose"
|
compose_dir="${COMPOSE_BASEDIR}/${MAJOR}/Rocky-${MAJOR}-${DATE}/compose"
|
||||||
|
|
||||||
pushd "${compose_dir}" || { echo "Could not change directory"; exit 1; }
|
pushd "${compose_dir}" || { echo "Could not change directory"; exit 1; }
|
||||||
/usr/bin/python3 "${current}/prepopulate_parser.py"
|
/usr/bin/python3 "${current}/prepopulate_parser.py" --version ${RLVER}
|
||||||
ret_val=$?
|
ret_val=$?
|
||||||
popd || { echo "Could not change back..."; exit 1; }
|
popd || { echo "Could not change back..."; exit 1; }
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ current=$(pwd)
|
|||||||
compose_dir="${COMPOSE_BASEDIR}/${MAJOR}/latest-Rocky-${MAJOR}/compose"
|
compose_dir="${COMPOSE_BASEDIR}/${MAJOR}/latest-Rocky-${MAJOR}/compose"
|
||||||
|
|
||||||
pushd "${compose_dir}" || { echo "Could not change directory"; exit 1; }
|
pushd "${compose_dir}" || { echo "Could not change directory"; exit 1; }
|
||||||
/usr/bin/python3 "${current}/prepopulate_parser.py" --pungi
|
/usr/bin/python3 "${current}/prepopulate_parser.py" --pungi --version ${RLVER}
|
||||||
ret_val=$?
|
ret_val=$?
|
||||||
popd || { echo "Could not change back..."; exit 1; }
|
popd || { echo "Could not change back..."; exit 1; }
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ for x in "${REPO[@]}"; do
|
|||||||
popd || { echo "Could not change back..."; exit 1; }
|
popd || { echo "Could not change back..."; exit 1; }
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
/usr/bin/python3 "${current}/prepopulate_parser.py"
|
/usr/bin/python3 "${current}/prepopulate_parser.py" --version ${MAJOR}
|
||||||
ret_val=$?
|
ret_val=$?
|
||||||
popd || { echo "Could not change back..."; exit 1; }
|
popd || { echo "Could not change back..."; exit 1; }
|
||||||
|
|
||||||
|
@ -7,8 +7,6 @@ import dnf
|
|||||||
import createrepo_c as cr
|
import createrepo_c as cr
|
||||||
from common import *
|
from common import *
|
||||||
|
|
||||||
REPOS = switcher.rlver((os.environ['RLVER']))
|
|
||||||
|
|
||||||
# Source packages we do not ship or are rocky branded
|
# Source packages we do not ship or are rocky branded
|
||||||
IGNORES = [
|
IGNORES = [
|
||||||
'insights-client',
|
'insights-client',
|
||||||
@ -22,10 +20,16 @@ IGNORES = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument('--version', type=str, required=True)
|
||||||
parser.add_argument("--pungi", help="local pungi is here", action='store_true')
|
parser.add_argument("--pungi", help="local pungi is here", action='store_true')
|
||||||
args = parser.parse_args()
|
parser.add_argument('--stream', action='store_true', help="Stream koji only")
|
||||||
|
|
||||||
if args.pungi:
|
results = parser.parse_args()
|
||||||
|
|
||||||
|
REPOS = switcher.rlver(results.version,
|
||||||
|
stream=results.stream)
|
||||||
|
|
||||||
|
if results.pungi:
|
||||||
APPEND_TO_PATH = '/os'
|
APPEND_TO_PATH = '/os'
|
||||||
else:
|
else:
|
||||||
APPEND_TO_PATH = ''
|
APPEND_TO_PATH = ''
|
||||||
|
Loading…
Reference in New Issue
Block a user