Re: fix "PLIST.orig already exists"

2024-03-24 Thread Klemens Nanni
On Sun, Mar 24, 2024 at 08:34:42AM +, Klemens Nanni wrote:
> On Sat, Mar 23, 2024 at 04:11:04PM +0100, Peter Hessler wrote:
> > this error is worthless and a waste of time, stop generating it:
> >   /usr/ports/www/yt-dlp/pkg/PLIST changed but 
> > /usr/ports/www/yt-dlp/pkg/PLIST.orig exists
> 
> It says PLIST changed, but only internal plist info changed and not the
> actual file, so this is in fact an indicator to 'mv PLIST.new PLIST'.

> Just dropping this means, in addition to PLIST.new semantics, you then have
> to find out about all of this yourself, which is not an improvement, imho.

Sorry, I (re)read the code and you remove the $cantmove logic, so PLIST and
PLIST.orig are always written, that's what I had in mind.

patch(1) also just overwrites existing .orig files, I see no reason for
update-plist(1) to differ.

> > OK?

OK kn with the newline merged into the "changed" printf and with
update-plist(1) DESCRIPTION's last paragraph updated accordingly.


Index: share/man/man1/update-plist.1
===
RCS file: /cvs/src/share/man/man1/update-plist.1,v
diff -u -p -r1.9 update-plist.1
--- share/man/man1/update-plist.1   28 May 2021 18:45:09 -  1.9
+++ share/man/man1/update-plist.1   24 Mar 2024 09:41:38 -
@@ -304,8 +304,8 @@ will first write files as
 .Pa .new ,
 then it will display which files are new and which files have changed.
 If old packing-lists already exist, it will move old packing lists into
-.Pa .orig
-unless these already exist, then move the new files into position.
+.Pa .orig ,
+then move the new files into position.
 .Sh SEE ALSO
 .Xr pkg_add 1 ,
 .Xr pkg_create 1 ,

> > 
> > Index: infrastructure/bin/update-plist
> > ===
> > RCS file: /cvs/openbsd/ports/infrastructure/bin/update-plist,v
> > diff -u -p -u -p -r1.214 update-plist
> > --- infrastructure/bin/update-plist 14 May 2023 09:18:05 -  1.214
> > +++ infrastructure/bin/update-plist 23 Mar 2024 15:07:59 -
> > @@ -1392,7 +1392,6 @@ $self->write_new_files;
> >  
> >  # and now, we figure out where to move the new files
> >  my @towrite = ();
> > -my $cantmove = 0;
> >  
> >  my $exitcode = 0;
> >  
> > @@ -1412,22 +1411,13 @@ for my $p (@{$self->{lists}}) {
> > } else {
> > print "$k changed";
> > push(@towrite, $k);
> > -   if (-f "$k$orig") {
> > -   print " but $k$orig exists\n";
> > -   $cantmove = 1;
> > -   } else {
> > -   print "\n";
> > -   }
> > +   print "\n";
> > }
> > } else {
> > print "$k is new\n";
> > push(@towrite, $k);
> > }
> > }
> > -}
> > -
> > -if ($cantmove) {
> > -   exit(2);
> >  }
> >  
> >  if ($self->{state}->not) {
> > 
> > 
> > -- 
> > Facts are stubborn, but statistics are more pliable.
> > 
> 



Re: fix "PLIST.orig already exists"

2024-03-24 Thread Landry Breuil
Le Sun, Mar 24, 2024 at 08:34:42AM +, Klemens Nanni a écrit :
> On Sat, Mar 23, 2024 at 04:11:04PM +0100, Peter Hessler wrote:
> > this error is worthless and a waste of time, stop generating it:
> >   /usr/ports/www/yt-dlp/pkg/PLIST changed but 
> > /usr/ports/www/yt-dlp/pkg/PLIST.orig exists
> 
> It says PLIST changed, but only internal plist info changed and not the
> actual file, so this is in fact an indicator to 'mv PLIST.new PLIST'.

fwiw, when doing port updates, i have this in my $SHELL history that i
frequently recall:
rm pkg/PLIST.orig ; mv pkg/PLIST.new  pkg/PLIST

PLIST.orig is usually from a previous update in the same port that i
never cleaned up. Iff we'd want to keep it, maybe we could move .orig to
.orig.$epoch, but other than that i'd silently (or verbosely ?) do:
mv pkg/PLIST pkg/PLIST.orig
mv pkg/PLIST.new pkg/PLIST

instead of manually having to act about a .orig i generally dont care
about.



Re: fix "PLIST.orig already exists"

2024-03-24 Thread Klemens Nanni
On Sat, Mar 23, 2024 at 04:11:04PM +0100, Peter Hessler wrote:
> this error is worthless and a waste of time, stop generating it:
>   /usr/ports/www/yt-dlp/pkg/PLIST changed but 
> /usr/ports/www/yt-dlp/pkg/PLIST.orig exists

It says PLIST changed, but only internal plist info changed and not the
actual file, so this is in fact an indicator to 'mv PLIST.new PLIST'.

Quick test in sysutils/portroach-cli:

Index: Makefile
===
RCS file: /cvs/ports/sysutils/portroach-cli/Makefile,v
diff -u -p -U0 -r1.15 Makefile
--- Makefile9 Mar 2023 13:03:33 -   1.15
+++ Makefile24 Mar 2024 08:30:27 -
@@ -6,0 +7 @@ MAINTAINER =  Klemens Nanni   Updating plist for portroach-cli-1.9
Reading existing plist for portroach-cli-1.9
Scanning /usr/ports/pobj/portroach-cli-1.9/fake-amd64
Removing .debug artefacts
Figuring out tie points
Tieing loose objects
Copying objects
Looking for unregistered conflicts
/p/sysutils/portroach-cli/pkg/PLIST changed but 
/p/sysutils/portroach-cli/pkg/PLIST.orig exists
$ cvs diff pkg/PLIST
$ ls pkg/
CVS/DESCR   PLIST   PLIST.new   PLIST.orig


Just dropping this means, in addition to PLIST.new semantics, you then have
to find out about all of this yourself, which is not an improvement, imho.

Instead, it could either ensure PLIST is updated and silently do whatever
with PLIST.orig, or it could instruct what to do:

plist changed, can't move PLIST because PLIST.orig exists, use PLIST.new

> 
> OK?
> 
> Index: infrastructure/bin/update-plist
> ===
> RCS file: /cvs/openbsd/ports/infrastructure/bin/update-plist,v
> diff -u -p -u -p -r1.214 update-plist
> --- infrastructure/bin/update-plist   14 May 2023 09:18:05 -  1.214
> +++ infrastructure/bin/update-plist   23 Mar 2024 15:07:59 -
> @@ -1392,7 +1392,6 @@ $self->write_new_files;
>  
>  # and now, we figure out where to move the new files
>  my @towrite = ();
> -my $cantmove = 0;
>  
>  my $exitcode = 0;
>  
> @@ -1412,22 +1411,13 @@ for my $p (@{$self->{lists}}) {
>   } else {
>   print "$k changed";
>   push(@towrite, $k);
> - if (-f "$k$orig") {
> - print " but $k$orig exists\n";
> - $cantmove = 1;
> - } else {
> - print "\n";
> - }
> + print "\n";
>   }
>   } else {
>   print "$k is new\n";
>   push(@towrite, $k);
>   }
>   }
> -}
> -
> -if ($cantmove) {
> - exit(2);
>  }
>  
>  if ($self->{state}->not) {
> 
> 
> -- 
> Facts are stubborn, but statistics are more pliable.
> 



Re: fix "PLIST.orig already exists"

2024-03-23 Thread Rafael Sadowski
On Sat Mar 23, 2024 at 04:11:04PM +0100, Peter Hessler wrote:
> this error is worthless and a waste of time, stop generating it:
>   /usr/ports/www/yt-dlp/pkg/PLIST changed but 
> /usr/ports/www/yt-dlp/pkg/PLIST.orig exists
> 
> OK?

+1

> 
> Index: infrastructure/bin/update-plist
> ===
> RCS file: /cvs/openbsd/ports/infrastructure/bin/update-plist,v
> diff -u -p -u -p -r1.214 update-plist
> --- infrastructure/bin/update-plist   14 May 2023 09:18:05 -  1.214
> +++ infrastructure/bin/update-plist   23 Mar 2024 15:07:59 -
> @@ -1392,7 +1392,6 @@ $self->write_new_files;
>  
>  # and now, we figure out where to move the new files
>  my @towrite = ();
> -my $cantmove = 0;
>  
>  my $exitcode = 0;
>  
> @@ -1412,22 +1411,13 @@ for my $p (@{$self->{lists}}) {
>   } else {
>   print "$k changed";
>   push(@towrite, $k);
> - if (-f "$k$orig") {
> - print " but $k$orig exists\n";
> - $cantmove = 1;
> - } else {
> - print "\n";
> - }
> + print "\n";
>   }
>   } else {
>   print "$k is new\n";
>   push(@towrite, $k);
>   }
>   }
> -}
> -
> -if ($cantmove) {
> - exit(2);
>  }
>  
>  if ($self->{state}->not) {
> 
> 
> -- 
> Facts are stubborn, but statistics are more pliable.
> 



Re: fix "PLIST.orig already exists"

2024-03-23 Thread Omar Polo
On 2024/03/23 16:11:04 +0100, Peter Hessler  wrote:
> this error is worthless and a waste of time, stop generating it:
>   /usr/ports/www/yt-dlp/pkg/PLIST changed but 
> /usr/ports/www/yt-dlp/pkg/PLIST.orig exists
> 
> OK?

oh yes please, it's annoying for no reason IMHO.

one small nit:

> --- infrastructure/bin/update-plist   14 May 2023 09:18:05 -  1.214
> +++ infrastructure/bin/update-plist   23 Mar 2024 15:07:59 -
> @@ -1392,7 +1392,6 @@ $self->write_new_files;
>  
>  # and now, we figure out where to move the new files
>  my @towrite = ();
> -my $cantmove = 0;
>  
>  my $exitcode = 0;
>  
> @@ -1412,22 +1411,13 @@ for my $p (@{$self->{lists}}) {
>   } else {
>   print "$k changed";

could add the \n here (or use `say')

>   push(@towrite, $k);
> - if (-f "$k$orig") {
> - print " but $k$orig exists\n";
> - $cantmove = 1;
> - } else {
> - print "\n";
> - }
> + print "\n";

instead of printing \n here now.

>   }
>   } else {
>   print "$k is new\n";
>   push(@towrite, $k);
>   }
>   }
> -}
> -
> -if ($cantmove) {
> - exit(2);
>  }
>  
>  if ($self->{state}->not) {



fix "PLIST.orig already exists"

2024-03-23 Thread Peter Hessler
this error is worthless and a waste of time, stop generating it:
  /usr/ports/www/yt-dlp/pkg/PLIST changed but 
/usr/ports/www/yt-dlp/pkg/PLIST.orig exists

OK?

Index: infrastructure/bin/update-plist
===
RCS file: /cvs/openbsd/ports/infrastructure/bin/update-plist,v
diff -u -p -u -p -r1.214 update-plist
--- infrastructure/bin/update-plist 14 May 2023 09:18:05 -  1.214
+++ infrastructure/bin/update-plist 23 Mar 2024 15:07:59 -
@@ -1392,7 +1392,6 @@ $self->write_new_files;
 
 # and now, we figure out where to move the new files
 my @towrite = ();
-my $cantmove = 0;
 
 my $exitcode = 0;
 
@@ -1412,22 +1411,13 @@ for my $p (@{$self->{lists}}) {
} else {
print "$k changed";
push(@towrite, $k);
-   if (-f "$k$orig") {
-   print " but $k$orig exists\n";
-   $cantmove = 1;
-   } else {
-   print "\n";
-   }
+   print "\n";
}
} else {
print "$k is new\n";
push(@towrite, $k);
}
}
-}
-
-if ($cantmove) {
-   exit(2);
 }
 
 if ($self->{state}->not) {


-- 
Facts are stubborn, but statistics are more pliable.