diff options
| -rw-r--r-- | TODO | 4 | ||||
| -rwxr-xr-x | greypool | 9 |
2 files changed, 9 insertions, 4 deletions
@@ -1,12 +1,8 @@ TODO list for greypool -- color and pager options for the config file. - - handle the case where a project has more than one maintainer... or no maintainer. this doesn't happen with SlackBuilds.org. -- handle ^C gracefully during wget downloads. - - improve the interactive config: - cache the repo list? - possibly use dialog? @@ -562,6 +562,10 @@ sub stamp_cache { sub check_cache { mkdir_p $cachedir; return if cache_ok() || $no_download; + invalidate_cache(); +} + +sub invalidate_cache { for(<$cachedir/*>) { unlink $_; } @@ -603,8 +607,13 @@ sub download { "'$url'"; debug $cmd; + + $SIG{INT} = sub { invalidate_cache(); fatal "exiting due to ^C"; exit 1; }; my $status = system($cmd); + $SIG{INT} = 'DEFAULT'; + if($status) { + invalidate_cache(); fatal "wget failed, exit status " . ($status >> 8); } sleep 1; # repology wants to limit requests to 1 per sec. |
