Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
refactor(parser): version -> pkgver
Browse files Browse the repository at this point in the history
  • Loading branch information
D-Brox authored Aug 5, 2023
1 parent 6c94aae commit 94c63e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pacup/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ def command(
log.info("Editing pacscript file...")
rprint(f"{padding}[bold blue]=>[/bold blue] Editing pacscript")
edited_lines = lines.copy()
edited_lines[version.line_number] = f'version="{version.latest}"\n'
edited_lines[version.line_number] = f'pkgver="{version.latest}"\n'

edited_lines[hash_line] = f'hash="{latest_hash}"\n'

Expand Down
8 changes: 4 additions & 4 deletions pacup/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,17 +246,17 @@ async def parse(
else extract_var(line, "pkgname=")
)

elif line.startswith("version="):
elif line.startswith("pkgver="):
log.info(f"Found version: {line}")
version = (
Version(
line_number,
await query_data(pacscript_reader_process, "echo ${version}"),
await query_data(pacscript_reader_process, "echo ${pkgver}"),
)
if ("$" in line) or ("\\" in line)
else Version(
line_number,
extract_var(line, "version="),
extract_var(line, "pkgver="),
)
)

Expand Down Expand Up @@ -343,4 +343,4 @@ async def parse(
)

def __repr__(self) -> str:
return f"Pacscript(name={self.path.name}, pkgname={self.pkgname}, version={self.version}, url={self.url}, hash_line={self.hash_line}, maintainer='{self.maintainer}' repology_filters={self.repology_filters})"
return f"Pacscript(name={self.path.name}, pkgname={self.pkgname}, pkgver={self.version}, url={self.url}, hash_line={self.hash_line}, maintainer='{self.maintainer}' repology_filters={self.repology_filters})"

0 comments on commit 94c63e1

Please sign in to comment.