From 2c3c84366d7fc9fe89fe59e68cf46474a69c15c3 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Fri, 16 Oct 2026 15:43:01 -0400 Subject: Use a custom wgetrc. --- TODO | 8 ++++---- greypool | 37 ++++++++++++++++++++++++++++++++----- 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/TODO b/TODO index 8564ace..32383fc 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,5 @@ TODO list for greypool -- use custom wgetrc. - - handle ^C gracefully during wget downloads. - improve the interactive config: @@ -12,8 +10,10 @@ TODO list for greypool - there's a bug I haven't looked for yet that causes the list to be incomplete occasionally. Pretty sure this happens if an ignored - package comes at the end of a JSON file. The packages listed in each - file are in random order so it's hard to trigger on purpose. + package comes at the end of a JSON file. The packages listed in + each file are in random order so it's hard to trigger on purpose. I + may have already fixed this by changing how the ignore list is + implemented... - de-uglify and refactor the code. it's a mess. diff --git a/greypool b/greypool index 566f70f..a34be32 100755 --- a/greypool +++ b/greypool @@ -84,8 +84,35 @@ sub parse_opts { fatal "extra junk on the command line after '$email'" if @ARGV; $color_output = -t STDOUT unless defined $color_output; - $privdir = $ENV{HOME} . "/.greypool/" unless defined $privdir; + $privdir = $ENV{HOME} . "/.greypool" unless defined $privdir; $config_file = $privdir . "/config"; + $wgetrc = $privdir . "/wgetrc"; +} + +sub create_wgetrc { + return if -e $wgetrc; + info "$wgetrc doesn't exist, creating"; + open my $f, ">$wgetrc" || fatal "can't create $wgetrc: $!\n"; + print $f <> 8); } @@ -557,6 +583,7 @@ sub colorize { parse_opts(); read_config_file(); +create_wgetrc(); check_cache(); generate_report(); stamp_cache(); -- cgit v1.2.3