openepaperlink: keep deleted products linked
This allows commenting a product in revbank.products to temporarily make it unavailable, which is useful in the workflow that @PI4DEC wants.
This commit is contained in:
parent
d703638e68
commit
65e387d84b
2 changed files with 4 additions and 17 deletions
|
@ -78,18 +78,8 @@ sub hook_products_changed($class, $changes, $mtime, @) {
|
|||
$product2mac{$id} or next;
|
||||
|
||||
push @macs, $product2mac{$id};
|
||||
$deleted{$id} = 1 if not defined $new;
|
||||
}
|
||||
|
||||
if (%deleted) {
|
||||
rewrite $fn, sub($line) {
|
||||
my ($mac, $product_id, $hwtype) = split " ", $line;
|
||||
|
||||
return "$mac _DELETED_ $hwtype\n" if $deleted{$product_id};
|
||||
return $line;
|
||||
};
|
||||
}
|
||||
|
||||
@macs or return;
|
||||
_run @macs;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue