Add needed features (0.4.0)

* Add --disable-gpg-check switch to sync scripts
* Add --disable-repo-gpg-check switch to sync scripts
* Add datestamp for future image use
This commit is contained in:
Louis Abel 2022-07-28 16:00:40 -07:00
parent 77264a3195
commit 6c20ee5a43
Signed by untrusted user: label
GPG Key ID: B37E62D143879B36
6 changed files with 44 additions and 8 deletions

View File

@ -26,6 +26,8 @@ parser.add_argument('--refresh-treeinfo', action='store_true')
# I am aware this is confusing, I want podman to be the default option
parser.add_argument('--simple', action='store_false')
parser.add_argument('--logger', type=str)
parser.add_argument('--disable-gpg-check', action='store_false')
parser.add_argument('--disable-repo-gpg-check', action='store_false')
# Parse them
results = parser.parse_args()
@ -54,6 +56,8 @@ a = RepoSync(
logger=results.logger,
refresh_extra_files=results.refresh_extra_files,
refresh_treeinfo=results.refresh_treeinfo,
gpg_check=results.disable_gpg_check,
repo_gpg_check=results.disable_repo_gpg_check,
)
def run():

View File

@ -29,6 +29,8 @@ parser.add_argument('--refresh-extra-files', action='store_true')
# I am aware this is confusing, I want podman to be the default option
parser.add_argument('--simple', action='store_false')
parser.add_argument('--logger', type=str)
parser.add_argument('--disable-gpg-check', action='store_false')
parser.add_argument('--disable-repo-gpg-check', action='store_false')
# Parse them
results = parser.parse_args()
@ -56,7 +58,9 @@ a = SigRepoSync(
fullrun=results.full_run,
nofail=results.no_fail,
refresh_extra_files=results.refresh_extra_files,
logger=results.logger
logger=results.logger,
gpg_check=results.disable_gpg_check,
repo_gpg_check=results.disable_repo_gpg_check,
)

View File

@ -3,24 +3,24 @@
name={{repo.name}}
baseurl={{ repo.baseurl }}
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgcheck={{ gpg_check }}
repo_gpgcheck={{ repo_gpg_check }}
gpgkey={{ repo.gpgkey }}
[{{ repo.name }}-debug]
name={{repo.name}}
baseurl={{ repo.baseurl }}-debug
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgcheck={{ gpg_check }}
repo_gpgcheck={{ repo_gpg_check }}
gpgkey={{ repo.gpgkey }}
[{{ repo.name }}-source]
name={{repo.name}}
baseurl={{ repo.srcbaseurl }}
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgcheck={{ gpg_check }}
repo_gpgcheck={{ repo_gpg_check }}
gpgkey={{ repo.gpgkey }}
{% endfor %}

View File

@ -57,6 +57,8 @@ class RepoSync:
fullrun: bool = False,
nofail: bool = False,
gpgkey: str = 'stable',
gpg_check: bool = True,
repo_gpg_check: bool = True,
rlmode: str = 'stable',
just_pull_everything: bool = False,
logger=None
@ -103,6 +105,8 @@ class RepoSync:
self.extra_files = rlvars['extra_files']
self.gpgkey = gpgkey
self.checksum = rlvars['checksum']
self.gpg_check = gpg_check
self.repo_gpg_check = repo_gpg_check
self.compose_id = '{}-{}-{}'.format(
config['shortname'],
@ -241,6 +245,8 @@ class RepoSync:
self.hashed,
self.extra_files,
self.gpgkey,
self.gpg_check,
self.repo_gpg_check,
self.tmplenv,
self.log
)
@ -1486,6 +1492,8 @@ class SigRepoSync:
fullrun: bool = False,
nofail: bool = False,
gpgkey: str = 'stable',
gpg_check: bool = True,
repo_gpg_check: bool = True,
logger=None
):
self.nofail = nofail
@ -1516,6 +1524,8 @@ class SigRepoSync:
self.fullversion = rlvars['revision']
self.sigrepo = repo
self.checksum = rlvars['checksum']
self.gpg_check = gpg_check
self.repo_gpg_check = repo_gpg_check
# Relevant major version items
self.sigvars = sigvars
@ -1672,6 +1682,8 @@ class SigRepoSync:
self.hashed,
self.extra_files,
self.gpgkey,
self.gpg_check,
self.repo_gpg_check,
self.tmplenv,
self.log
)

View File

@ -61,6 +61,8 @@ class IsoBuild:
extra_iso_mode: str = 'local',
compose_dir_is_here: bool = False,
hashed: bool = False,
updated_image: bool = False,
image_increment: str = '0',
image=None,
logger=None
):
@ -93,6 +95,10 @@ class IsoBuild:
self.checksum = rlvars['checksum']
self.profile = rlvars['profile']
self.hashed = hashed
self.updated_image = updated_image
self.updated_image_increment = "." + image_increment
self.updated_image_date = (time.strftime("%Y%m%d", time.localtime())
+ self.updated_image_increment)
# Relevant major version items
self.arch = arch
@ -809,6 +815,10 @@ class IsoBuild:
if self.release_candidate:
rclevel = '-' + self.rclvl
datestamp = ''
if self.updated_image:
datestamp = '-' + self.updated_image_date.copy()
volid = '{}-{}-{}{}-{}-{}'.format(
self.shortname,
self.major_version,

View File

@ -411,6 +411,8 @@ class Shared:
hashed,
extra_files,
gpgkey,
gpg_check,
repo_gpg_check,
templates,
logger,
dest_path='/var/tmp'
@ -468,7 +470,11 @@ class Shared:
repolist.append(repodata)
template = templates.get_template('repoconfig.tmpl')
output = template.render(repos=repolist)
output = template.render(
repos=repolist,
gpg_check=gpg_check,
repo_gpg_check=repo_gpg_check
)
config_file.write(output)
config_file.close()