Index | Thread | Search

From:
Kirill A. Korinsky <kirill@korins.ky>
Subject:
Re: dpb: wipe all packages in an error state
To:
Rafael Sadowski <rafael@sizeofvoid.org>
Cc:
ports@openbsd.org, marc.espie.openbsd@gmail.com
Date:
Sat, 01 Nov 2025 11:59:55 +0100

Download raw body.

Thread
On Sat, 01 Nov 2025 11:09:02 +0100,
Rafael Sadowski <rafael@sizeofvoid.org> wrote:
> 
> Simple diff to add the external control "wipe-all". This wiped all
> packages in an error state.
> 
> Is this useful for anyone else?
>

During my ffmpeg bulk I had need for it more than once.

But wipe accepts multiple packages as space separated list which is an
output in dpb UI. So, I ended with a few cycle of copy and paste.

But it was like dozen packages, and it was not that complicated, but for
largers wipe such command might be useful.

> Index: lib/DPB/External.pm
> ===================================================================
> RCS file: /cvs/ports/infrastructure/lib/DPB/External.pm,v
> diff -u -p -r1.32 External.pm
> --- lib/DPB/External.pm	17 Oct 2023 08:03:53 -0000	1.32
> +++ lib/DPB/External.pm	1 Nov 2025 10:02:37 -0000
> @@ -134,6 +134,24 @@ sub stub_out($self, $fh, $p)
>  	}
>  }
>  
> +sub wipe_all($self, $fh)
> +{
> +	my $state = $self->{state};
> +	my $engine = $state->engine;
> +	my $errors = $engine->{errors};
> +
> +	if (@$errors == 0) {
> +		$fh->print("No packages in error state\n");
> +		return;
> +	}
> +
> +	$fh->print("Wiping all packages in error state:\n");
> +
> +	for my $v (@$errors) {
> +		$self->wipe($fh, $v->fullpkgpath);
> +	}
> +}
> +
>  sub wipehost($self, $fh, $h)
>  {
>  	# kill the stuff that's running
> @@ -211,6 +229,8 @@ sub handle_command($self, $line, $fh)
>  			    join(" ", @{$state->{bad_paths}}), "\n");
>  			delete $state->{bad_paths};
>  		}
> +	} elsif ($line =~ m/^wipe-all\b/) {
> +		$self->wipe_all($fh);
>  	} elsif ($line =~ m/^wipe\s+(.*)/) {
>  		for my $p (split(/\s+/, $1)) {
>  			$self->wipe($fh, $p);
> @@ -245,6 +265,7 @@ sub handle_command($self, $line, $fh)
>  		    "\tstub <fullpkgpath>...\n",
>  		    "\tsummary [<logname>]\n",
>  		    "\twipe <fullpkgpath>...\n",
> +		    "\twipe-all\n",
>  		    "\twipehost <hostname>...\n"
>  		);
>  	} else {
> 

-- 
wbr, Kirill