From 864fe22b74b1a680f5a5c33696348e42c7abd326 Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Mon, 31 Oct 2022 15:39:38 -0700 Subject: [PATCH] try to fix local pungi prepop --- .../scripts/.sync_from_peridot.py.swp | Bin 12288 -> 0 bytes mangle/generators/.gitignore | 3 ++ .../generate_prepopulate_from_pungi | 5 +-- .../generate_prepopulate_from_pungi_latest | 29 ++++++++++++++++++ .../generate_prepopulate_from_stream | 3 +- mangle/generators/prepopulate_parser.py | 12 +++++++- 6 files changed, 48 insertions(+), 4 deletions(-) delete mode 100644 iso/empanadas/empanadas/scripts/.sync_from_peridot.py.swp create mode 100644 mangle/generators/.gitignore create mode 100755 mangle/generators/generate_prepopulate_from_pungi_latest diff --git a/iso/empanadas/empanadas/scripts/.sync_from_peridot.py.swp b/iso/empanadas/empanadas/scripts/.sync_from_peridot.py.swp deleted file mode 100644 index 48e2275bbaa87694487890f97312f24226ec52ba..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeHNJB%DP71 zKH+LE?5Yv@YN9k>wMxk?bO@tX`M6{SOPSg6WD+e(YgWyqNa9SZaa?jOQe_9_WOw$^ z3Je4WW-?IOEP8E$9Dnr{U+PPXN9gmsdl>0$&4P0oMQtyak*AR)F81A>=pUN8n4~8t?`{ftP_>3xp&< zANccWLT&(8fz!ZY;MYThd=4;R5x9Mjkn6xz;3V+(Q-pjA+yJfv9|IY14%h&W0xtnC z0(YJy`@FuVT90Cpk z|AHUK(H+NAxB>%#fxy7S$pFR02D&Qx%OvF)^-m`WSticnF3n5j4_qaZvm#b9UDMoD z(wafr6PGO6VmUV}#K$yYabD(eGUCZr8=YMn~t7 z>d8(AGXDZEGuN{4z zqsR-K*Ncs+bke!*>fPs@@?n*?X&YbP*|{>Ej9M4h=uB=Lt;sby)0n-d^qT*->r7OU ziM(rTd4*}LPe#}1I|x6IGlYGzM9=dgrFO)}l;I&&bbG`szrr;=OY@2wLx>*uH5^}I zQl!F8P%0W(PPv6``b}b5zwlDe4ZC-FnGio9_|*=VdcNJeOzO5bq$07Grq!f53e0dg z)a3;a%(>xu;BPV0xxuTK=%(xSV13GW zZKfS{!chFUDXWYq@)cOOSz&3Z(lINjRdnbXrqDzNt)r@R+|6RE(VJ*0MEizuce1D9 zUU(ueN^@o?ROIw#&L}5B5kzOsFi6t_MAdpU=c}AXMG&ny!`!NEglx{pT9=|)*&Zy` zYucQlUNpK@zCuS_mTQaa&=O&JVxh>ipQ!PeQNvO5kf@YOVJrnXYMZCai!&?3k%8e% zD`=YAiJ%dXf(b3y_&(BizY1{xzW)+&*_P1$Sqr5?38<&$KBhHm|cnf1-%vM diff --git a/mangle/generators/.gitignore b/mangle/generators/.gitignore new file mode 100644 index 0000000..67e33fd --- /dev/null +++ b/mangle/generators/.gitignore @@ -0,0 +1,3 @@ +__pycache__/ *.py[cod] +*$py.class +*.so diff --git a/mangle/generators/generate_prepopulate_from_pungi b/mangle/generators/generate_prepopulate_from_pungi index 25b75b0..96cff93 100755 --- a/mangle/generators/generate_prepopulate_from_pungi +++ b/mangle/generators/generate_prepopulate_from_pungi @@ -6,7 +6,7 @@ if [ -n "$1" ] && [ -n "$2" ]; then MAJOR=$1 DATE=$2 else - echo "Major version not specified" + echo "Major version or date not specified" exit 1 fi @@ -16,6 +16,7 @@ grep_val=$? if [ "$grep_val" -ne 0 ]; then echo "Date format incorrect. You must use: YYYYMMDD.X" + exit 2 fi export RLVER=$MAJOR @@ -23,7 +24,7 @@ source common drop="${PREPOPDROP}" current=$(pwd) -compose_dir="${COMPOSE_BASEDIR}/Rocky-${MAJOR}-${DATE}/compose" +compose_dir="${COMPOSE_BASEDIR}/${MAJOR}/Rocky-${MAJOR}-${DATE}/compose" pushd "${compose_dir}" || { echo "Could not change directory"; exit 1; } /usr/bin/python3 "${current}/prepopulate_parser.py" diff --git a/mangle/generators/generate_prepopulate_from_pungi_latest b/mangle/generators/generate_prepopulate_from_pungi_latest new file mode 100755 index 0000000..5566fc2 --- /dev/null +++ b/mangle/generators/generate_prepopulate_from_pungi_latest @@ -0,0 +1,29 @@ +#!/bin/bash +# Parses a local compose's repos +#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) +compose_dir="${COMPOSE_BASEDIR}/${MAJOR}/latest-Rocky-${MAJOR}/compose" + +pushd "${compose_dir}" || { echo "Could not change directory"; exit 1; } +/usr/bin/python3 "${current}/prepopulate_parser.py" --pungi +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" diff --git a/mangle/generators/generate_prepopulate_from_stream b/mangle/generators/generate_prepopulate_from_stream index a4f5ede..3d51a5c 100755 --- a/mangle/generators/generate_prepopulate_from_stream +++ b/mangle/generators/generate_prepopulate_from_stream @@ -6,7 +6,7 @@ if [ -n "$1" ] && [ -n "$2" ]; then MAJOR=$1 DATE=$2 else - echo "Major version not specified" + echo "Major version or date not specified" exit 1 fi @@ -16,6 +16,7 @@ grep_val=$? if [ "$grep_val" -ne 0 ]; then echo "Date format incorrect. You must use: YYYYMMDD.X" + exit 2 fi export RLVER=$MAJOR diff --git a/mangle/generators/prepopulate_parser.py b/mangle/generators/prepopulate_parser.py index 43f9787..bf21ea1 100755 --- a/mangle/generators/prepopulate_parser.py +++ b/mangle/generators/prepopulate_parser.py @@ -2,6 +2,7 @@ import os import os.path import json +import argparse import dnf import createrepo_c as cr from common import * @@ -20,6 +21,15 @@ IGNORES = [ 'redhat-release' ] +parser = argparse.ArgumentParser() +parser.add_argument("--pungi", help="local pungi is here", action='store_true') +args = parser.parse_args() + +if args.pungi: + APPEND_TO_PATH = '/os' +else: + APPEND_TO_PATH = '' + def warningcb(warning_type, message): print("WARNING: %s" % message) return True @@ -31,7 +41,7 @@ for k in REPOS: PRIMARY_XML_PATH = None FILELISTS_XML_PATH = None OTHER_XML_PATH = None - REPO_PATH = k + '/' + arch + REPO_PATH = k + '/' + arch + APPEND_TO_PATH repomd = cr.Repomd() cr.xml_parse_repomd(os.path.join(REPO_PATH, "repodata/repomd.xml"), repomd, warningcb) for record in repomd.records: