emacs: use relative downloaded paths in update-from-overlay.py

We chdir to the dir where update-from-overlay.py is in.  So we can use
relative paths.  This also aligns with how we use paths in git commit.
This commit is contained in:
Lin Jian
2026-03-04 00:37:10 +08:00
parent 64f3c34d7c
commit d4cc578e23
@@ -108,7 +108,6 @@ def main(
name,
sha,
emacs_overlay=emacs_overlay,
here_directory=here_directory,
logger=logger,
)
@@ -175,7 +174,6 @@ def fetch_fileset(
name: str,
sha: str,
emacs_overlay: EmacsOverlay,
here_directory: HereDirectory,
logger: logging.Logger,
) -> None:
"""Fetch a fileset from emacs overlay.
@@ -190,15 +188,13 @@ def fetch_fileset(
basename = emacs_overlay.elisp_packages_set[name]["basename"]
url = f"{emacs_overlay.raw_url}/{sha}/{location}/{basename}"
destination = here_directory.path / basename
logger.debug(f"Getting {url}")
with (
urllib.request.urlopen(url) as input_stream,
open(destination, "wb") as output_file,
open(basename, "wb") as output_file,
):
logger.info(f"Installing {destination}")
logger.info(f"Installing {basename}")
shutil.copyfileobj(input_stream, output_file)
logger.debug("END")