From b917733a119eebe9e42a25a3ab5e42ba7611dafd Mon Sep 17 00:00:00 2001 From: Alan De Smet <alan.desmet@ssec.wisc.edu> Date: Wed, 18 Aug 2021 19:20:00 +0000 Subject: [PATCH] Fix warning message typo; don't symlink onto self symlinking onto self is a danger when doing downloads directly into the run directory. --- example/aitf-data-for-run | 6 ++++-- example/aitf-update-cache | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/example/aitf-data-for-run b/example/aitf-data-for-run index 57f0114..7732921 100755 --- a/example/aitf-data-for-run +++ b/example/aitf-data-for-run @@ -1,3 +1,4 @@ +#! /home/adesmet/csppfetch/example/venv/bin/python3 #! /usr/bin/python3 # System modules @@ -74,7 +75,7 @@ def main(): cache_dir = args.dir if not os.access(cache_dir, os.W_OK): - logging.warning(f'I do not appear to be able to have write access to "{cache_dir}". Downloading directly into args.destination') + logging.warning(f'I do not appear to be able to have write access to "{cache_dir}". Downloading directly into {args.destination}') args.dir = args.destination do_download = not args.cache_only @@ -104,7 +105,8 @@ def main(): dst_dir = os.path.dirname(dst) os.makedirs(dst_dir, exist_ok=True) logging.info(src + ' -> ' + dst) - os.symlink(src, dst) + if src != dst: + os.symlink(src, dst) except csppfetch.DownloadsFailedException as e: logging.fatal(str(e)) diff --git a/example/aitf-update-cache b/example/aitf-update-cache index bcbeebe..714b8b9 100755 --- a/example/aitf-update-cache +++ b/example/aitf-update-cache @@ -1,4 +1,4 @@ -#! /usr/bin/python3 +#! /home/adesmet/csppfetch/example/venv/bin/python3 # System modules import os -- GitLab