Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong info about hplip-plugin port when using search #322

Closed
vmisev opened this issue Jul 28, 2021 · 10 comments
Closed

Wrong info about hplip-plugin port when using search #322

vmisev opened this issue Jul 28, 2021 · 10 comments

Comments

@vmisev
Copy link

vmisev commented Jul 28, 2021

When searching for hplip, two ports are shown, "hplip" and "hplip plugin".
There is wrong info about hplip-plugin :

To add the package, run one of these commands:
• pkg install print/hplip-plugin
• pkg install hplip-plugin
PKGNAME: hplip-plugin

There is no pkg for hplip-plugin.

On hplip-plugin page information is correct:

A package is not available for ports marked as: Forbidden / Broken / Ignore / Restricted
PKGNAME: there is no package for this port: _LICENSE_RESTRICTED = delete-package delete-distfiles

@dlangille
Copy link
Contributor

I think I fixed this at https://dev.freshports.org with this change:

diff --git a/include/constants.php b/include/constants.php
index c91c8a34..f9c44248 100644
--- a/include/constants.php
+++ b/include/constants.php
@@ -183,9 +183,10 @@ const SEARCH_SELECT_FIELD = '
          P.no_package,
          P.package_name,
          P.restricted,
+         P.license_restricted,
+         P.manual_package_build,
          P.no_cdrom,
          P.expiration_date,
-         P.no_package,
          P.license,
          P.last_commit_id,
          P.distinfo,

The key field was P.license_restricted

@vmisev
Copy link
Author

vmisev commented Jul 29, 2021

Now everything looks fine on dev site, previously wrong info about hplip-plugin pkg when using search for hplip is corrected.

Thanks :)

@dlangille
Copy link
Contributor

I am sure this affects all other ports:

freshports.devgit=# select count(*) from ports where license_restricted is not null;
 count 
-------
   322
(1 row)

freshports.devgit=# 

I will leave this open until after this goes to production.

@vmisev
Copy link
Author

vmisev commented Jul 29, 2021

I didn’t hunt for other Freshports issues - I recently noticed that hp-toolbox is not working (pkg installs just fine, printing works, but hp-toolbox crashes); it was easier for me to check dependencies&info here - that's how I noticed wrong info about plugin. Now I have to dig for hp-toolbox problem and file a report to maintainer.

I hope your fix will sort other issues too; good job :).
Thank you for your time & effort :)

@dlangille
Copy link
Contributor

I will find the other ports. It will be easy to do with SQL.

@dlangille
Copy link
Contributor

Reopening this until it hits production, where a script needs to clear the cache for any port where license_restricted is not null

@dlangille dlangille reopened this Jul 31, 2021
@dlangille
Copy link
Contributor

This will clear cache for the affected ports:

freshports.devgit=# begin; insert into cache_clearing_ports (port_id, category, port) select P.id as port_id,
       C.name as category,
       E.name as port
  FROM ports P join categories C on p.category_id = C.id
               join element    E on p.element_id = E.id
 WHERE P.license_restricted is not null;

commit;

notify port_updated;

@dlangille
Copy link
Contributor

This will monitor the cache clearing. Issue this command on the webserver:

[dan@dev-nginx01:~] $ sudo xtail /var/log/freshports/

*** /var/log/freshports//freshports.log ***
...
Aug  2 16:01:33 dev-nginx01 fp-listen[28729]: Just woke up! *************
Aug  2 16:01:33 dev-nginx01 fp-listen[28729]: Got NOTIFY: pid='73902', channel='port_updated', payload=''
Aug  2 16:01:33 dev-nginx01 fp-listen[28729]: found key port_updated
Aug  2 16:01:33 dev-nginx01 fp-listen[28729]: invoking RemoveCacheEntry()
Aug  2 16:01:33 dev-nginx01 fp-listen[28729]: checking for cache entries to remove...
Aug  2 16:01:33 dev-nginx01 fp-listen[28729]: COUNT: 322 entries to process
Aug  2 16:01:33 dev-nginx01 fp-listen[28729]: removing glob /var/db/freshports/cache/ports/multimedia/win32-codecs/*
Aug  2 16:01:33 dev-nginx01 fp-listen[28729]: removing glob /var/db/freshports/cache/categories/multimedia/*
Aug  2 16:01:33 dev-nginx01 fp-listen[28729]: DELETE FROM cache_clearing_ports WHERE id = 27009657
Aug  2 16:01:33 dev-nginx01 fp-listen[28729]: removing glob /var/db/freshports/cache/ports/java/jdk12-doc/*

@dlangille
Copy link
Contributor

Confirmed on test: https://test.freshports.org/search.php?query=hplip

@dlangille
Copy link
Contributor

prod looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants