Skip to content

Fix read_files.sh for Factory/base #308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 30, 2025

Conversation

andrii-suse
Copy link
Collaborator

followup from #307

@foursixnine foursixnine merged commit 69cbb32 into master Jul 30, 2025
5 checks passed
@foursixnine foursixnine deleted the fix_factory_read_files_repopath branch July 30, 2025 09:39
else:
repopath = (
self.ag.productrepopath() + "/" + self.folder + "/*" + repodir.attrib["folder"] + "*" + suffix
)
Copy link

@d3flex d3flex Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
)
if "/" in self.folder:
prd_path = self.ag.productpath
else:
prd_path = self.ag.productrepopath()
glob_pattern = f"*{repodir.attrib['folder']}*{suffix}"
repopath = (os.path.join(prd_path, self.folder, glob_pattern))

I think this reduce the duplication

Comment on lines +662 to +668
repopath = ""
if "/" in self.folder:
repopath = self.ag.productpath + "/" + self.folder + "/*" + repodir.attrib["folder"] + "*" + suffix
else:
repopath = (
self.ag.productrepopath() + "/" + self.folder + "/*" + repodir.attrib["folder"] + "*" + suffix
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
repopath = ""
if "/" in self.folder:
repopath = self.ag.productpath + "/" + self.folder + "/*" + repodir.attrib["folder"] + "*" + suffix
else:
repopath = (
self.ag.productrepopath() + "/" + self.folder + "/*" + repodir.attrib["folder"] + "*" + suffix
)
repopath = self.ag.productpath + "/" + self.folder + "/*" + repodir.attrib["folder"] + "*" + suffix if "/" in self.folder else ( self.ag.productrepopath() + "/" + self.folder + "/*" + repodir.attrib["folder"] + "*" + suffix )

wrapped accordingly of course. Probably easier to read if written like this

Suggested change
repopath = ""
if "/" in self.folder:
repopath = self.ag.productpath + "/" + self.folder + "/*" + repodir.attrib["folder"] + "*" + suffix
else:
repopath = (
self.ag.productrepopath() + "/" + self.folder + "/*" + repodir.attrib["folder"] + "*" + suffix
)
suffix_path = "/" + self.folder + "/*" + repodir.attrib["folder"] + "*" + suffix
repopath = self.ag.productpath + suffix_path if "/" in self.folder else self.ag.productrepopath() + suffix_path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants