Index | Thread | Search

From:
Marc Espie <marc.espie.openbsd@gmail.com>
Subject:
Re: dpb: wipe all packages in an error state
To:
Rafael Sadowski <rafael@sizeofvoid.org>
Cc:
ports@openbsd.org
Date:
Sat, 1 Nov 2025 12:22:08 +0100

Download raw body.

Thread
  • Marc Espie:

    dpb: wipe all packages in an error state

  • On Sat, Nov 01, 2025 at 11:09:02AM +0100, Rafael Sadowski wrote:
    > Simple diff to add the external control "wipe-all". This wiped all
    > packages in an error state.
    > 
    > Is this useful for anyone else?
    
    
    Sure.
    
    Just make it more silent. Commands like wipehost don't chatter away
    even though they take just as much time
    
    You need to add a corresponding blurb to dpb(8) as well, so that it
    stays documented.
    
    > 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");
    Not that line.
    > +
    > +	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 {
    > 
    
    
  • Marc Espie:

    dpb: wipe all packages in an error state