try to fix local pungi prepop

This commit is contained in:
Louis Abel 2022-10-31 15:39:38 -07:00
parent 7288a6f544
commit 864fe22b74
Signed by untrusted user: label
GPG Key ID: B37E62D143879B36
6 changed files with 48 additions and 4 deletions

3
mangle/generators/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
__pycache__/ *.py[cod]
*$py.class
*.so

View File

@ -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"

View File

@ -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"

View File

@ -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

View File

@ -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: