[source] scripts/dowload.pl: use glob to expand target dir

LEDE Commits lede-commits at lists.infradead.org
Thu Dec 14 09:45:10 PST 2017


jow pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/b69ea02a00758a2bcd3981cfb48cc629ff15cfe3

commit b69ea02a00758a2bcd3981cfb48cc629ff15cfe3
Author: Zoltan Gyarmati <mr.zoltan.gyarmati at gmail.com>
AuthorDate: Sat Aug 26 15:14:20 2017 +0200

    scripts/dowload.pl: use glob to expand target dir
    
    If CONFIG_DOWNLOAD_FOLDER is set to for example "~/dl", the download
    script fails to create the .hash and .dl files with the following
    errors:
     Cannot create file ~/dl/dropbear-2017.75.tar.bz2.dl: No such file or directory
     sh: 1: cannot create ~/dl/dropbear-2017.75.tar.bz2.hash: Directory nonexistent
    
    If the tarball already exists in the ~/dl dir, it's properly found and
    used, so this issue only affects the download.pl script.
     This patch calls glob() on the target dir parameter, which will expand `~`.
    
    Signed-off-by: Zoltan Gyarmati <mr.zoltan.gyarmati at gmail.com>
    (cherry picked from commit 0a761fe8ef346c6f0a78097938b083e2d078b0e2)
---
 scripts/download.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/download.pl b/scripts/download.pl
index 645ac85..bf9fe8c 100755
--- a/scripts/download.pl
+++ b/scripts/download.pl
@@ -16,7 +16,7 @@ use Text::ParseWords;
 @ARGV > 2 or die "Syntax: $0 <target dir> <filename> <hash> <url filename> [<mirror> ...]\n";
 
 my $url_filename;
-my $target = shift @ARGV;
+my $target = glob(shift @ARGV);
 my $filename = shift @ARGV;
 my $file_hash = shift @ARGV;
 $url_filename = shift @ARGV unless $ARGV[0] =~ /:\/\//;



More information about the lede-commits mailing list