Re: pkg_add -P and cdrom

2019-08-15 Thread Jan Stary
On Aug 15 21:33:23, es...@nerim.net wrote:
> Since we no longer carry cdrom information, asking for cdrom-only should
> either not install, or error out entirely during option parsing.

-P cdrom should ridicule the user for using a cdrom,
enough so that he goes to ports@ to ask for its deletion.



Re: pkg_add -P and cdrom

2019-08-15 Thread Marc Espie
On Fri, Aug 09, 2019 at 11:33:52AM -0400, Daniel Jakots wrote:
> Hi,
> 
> root@caramel:~# pkg_add -P ftp tree 
> quirks-3.165 signed on 2019-08-07T13:50:33Z
> tree-0.62: ok
> root@caramel:~# pkg_delete tree 
> tree-0.62: ok
> root@caramel:~# pkg_add -P cdrom tree
> quirks-3.165 signed on 2019-08-07T13:50:33Z
> |No change in quirks-3.165Use of uninitialized value in string ne
> at /usr/libdata/perl5/OpenBSD/Add.pm line 314. Package tree-0.62 is not
> for cdrom Couldn't install tree-0.62
> 
> Here's a naive and untested diff ;) > Not entirely sure how much -P is useful 
> tho.
> 
> Index: pkg_add.1
> ===
> RCS file: /cvs/src/usr.sbin/pkg_add/pkg_add.1,v
> retrieving revision 1.159
> diff -u -p -r1.159 pkg_add.1
> --- pkg_add.1 4 Jul 2019 15:25:16 -   1.159
> +++ pkg_add.1 9 Aug 2019 15:24:51 -
> @@ -412,8 +412,6 @@ if applicable.
>  Check permissions for distribution, where
>  .Ar type
>  can be
> -.Sq cdrom
> -or
>  .Sq ftp .
>  .It Fl qq
>  Do not bother with checksums for configuration files.
> cvs server: Diffing OpenBSD
> Index: OpenBSD/Add.pm
> ===
> RCS file: /cvs/src/usr.sbin/pkg_add/OpenBSD/Add.pm,v
> retrieving revision 1.182
> diff -u -p -r1.182 Add.pm
> --- OpenBSD/Add.pm10 Jul 2019 11:15:15 -  1.182
> +++ OpenBSD/Add.pm9 Aug 2019 15:24:51 -
> @@ -311,10 +311,6 @@ sub prepare_for_addition
>  {
>   my ($self, $state, $pkgname) = @_;
>  
> - if ($state->{cdrom_only} && $self->{cdrom} ne 'yes') {
> - $state->errsay("Package #1 is not for cdrom", $pkgname);
> - $state->{problems}++;
> - }
>   if ($state->{ftp_only} && $self->{ftp} ne 'yes') {
>   $state->errsay("Package #1 is not for ftp", $pkgname);
>   $state->{problems}++;
> 
> 
> Cheers,
> Daniel

I'll have a look, but at first glance, it's wrong.

The idea of -P is that people might be picky.

Since we no longer carry cdrom information, asking for cdrom-only should
either not install, or error out entirely during option parsing.



pkg_add -P and cdrom

2019-08-09 Thread Daniel Jakots
Hi,

root@caramel:~# pkg_add -P ftp tree 
quirks-3.165 signed on 2019-08-07T13:50:33Z
tree-0.62: ok
root@caramel:~# pkg_delete tree 
tree-0.62: ok
root@caramel:~# pkg_add -P cdrom tree
quirks-3.165 signed on 2019-08-07T13:50:33Z
|No change in quirks-3.165Use of uninitialized value in string ne
at /usr/libdata/perl5/OpenBSD/Add.pm line 314. Package tree-0.62 is not
for cdrom Couldn't install tree-0.62

Here's a naive and untested diff ;)
Not entirely sure how much -P is useful tho.

Index: pkg_add.1
===
RCS file: /cvs/src/usr.sbin/pkg_add/pkg_add.1,v
retrieving revision 1.159
diff -u -p -r1.159 pkg_add.1
--- pkg_add.1   4 Jul 2019 15:25:16 -   1.159
+++ pkg_add.1   9 Aug 2019 15:24:51 -
@@ -412,8 +412,6 @@ if applicable.
 Check permissions for distribution, where
 .Ar type
 can be
-.Sq cdrom
-or
 .Sq ftp .
 .It Fl qq
 Do not bother with checksums for configuration files.
cvs server: Diffing OpenBSD
Index: OpenBSD/Add.pm
===
RCS file: /cvs/src/usr.sbin/pkg_add/OpenBSD/Add.pm,v
retrieving revision 1.182
diff -u -p -r1.182 Add.pm
--- OpenBSD/Add.pm  10 Jul 2019 11:15:15 -  1.182
+++ OpenBSD/Add.pm  9 Aug 2019 15:24:51 -
@@ -311,10 +311,6 @@ sub prepare_for_addition
 {
my ($self, $state, $pkgname) = @_;
 
-   if ($state->{cdrom_only} && $self->{cdrom} ne 'yes') {
-   $state->errsay("Package #1 is not for cdrom", $pkgname);
-   $state->{problems}++;
-   }
if ($state->{ftp_only} && $self->{ftp} ne 'yes') {
$state->errsay("Package #1 is not for ftp", $pkgname);
$state->{problems}++;


Cheers,
Daniel