Bug 257406 - ports-mgmt/portupgrade: no support for .pkg
Summary: ports-mgmt/portupgrade: no support for .pkg
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Bryan Drewery
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-25 10:32 UTC by Helmut Ritter
Modified: 2021-07-31 11:45 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (bdrewery)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Helmut Ritter 2021-07-25 10:32:58 UTC
Hi,

from https://github.com/freebsd/pkg/blob/master/NEWS:

Changes from 1.16.99.2 to 1.16.99.3
[...]
- change the package extension to .pkg (with symlink on the old format)

[helmut@BSDHelmut ~]$ sudo portupgrade -fPP mysql80-client
[Reading data from pkg(8) ... - 499 packages found - done]
--->  Checking for the latest package of 'databases/mysql80-client'
--->  Fetching the package(s) for 'mysql80-client-8.0.25_2' (databases/mysql80-client)
Updating MyRepo repository catalogue...
MyRepo repository is up to date.
All repositories are up to date.
--->  Fetching mysql80-client-8.0.25_2
[...]
New packages to be FETCHED:
        mysql80-client: 8.0.25_2 (4 MiB: 100.00% of the 4 MiB to download)

Number of packages to be fetched: 1

The process will require 4 MiB more space.
4 MiB to be downloaded.
Fetching mysql80-client-8.0.25_2.pkg: 100%    4 MiB   4.1MB/s    00:01
** Failed to fetch mysql80-client-8.0.25_2.txz
** Failed to fetch mysql80-client-8.0.25_2
** Listing the failed packages (-:ignored / *:skipped / !:failed)
        ! mysql80-client-8.0.25_2       (fetch error)
** Could not find the latest version (8.0.25_2)
** No package available: databases/mysql80-client
** Listing the failed packages (-:ignored / *:skipped / !:failed)
        ! databases/mysql80-client (mysql80-client-8.0.25_2)    (package not found)
[helmut@BSDHelmut ~]$

It downloads .pkg but then searches for .txz.
Comment 1 peter.larsen 2021-07-29 14:00:44 UTC
I found this since I was modering why my mesa-libs did not want to install my package..


pkg_fetch:
found 3 references for .txz, added .pkg in line 54, replaced txz with pkg in two other places


still no dice ;)


[Reading data from pkg(8) ... - 354 packages found - done]
--->  Checking for the latest package of 'graphics/mesa-libs'
--->  Fetching the package(s) for 'mesa-libs-21.1.5' (graphics/mesa-libs)
Updating poudriere repository catalogue...
poudriere repository is up to date.
All repositories are up to date.
--->  Fetching mesa-libs-21.1.5
The following packages will be fetched:

New packages to be FETCHED:
	mesa-libs: 21.1.5 (258 KiB: 100.00% of the 258 KiB to download)

Number of packages to be fetched: 1

258 KiB to be downloaded.
Fetching mesa-libs-21.1.5.pkg: 100%  258 KiB 263.7kB/s    00:01    
--->  Downloaded as mesa-libs-21.1.5.pkg
--->  Identifying the package /var/tmp/portupgrade74yuLKjb/All/mesa-libs-21.1.5.pkg
--->  Saved as /usr/ports/packages/All/mesa-libs-21.1.5.pkg
** Could not find the latest version (21.1.5)
** No package available: graphics/mesa-libs
** Listing the failed packages (-:ignored / *:skipped / !:failed)
	! graphics/mesa-libs (mesa-libs-21.1.5)	(package not found)

what did I miss ?
Comment 2 peter.larsen 2021-07-31 11:45:57 UTC
this helps, but a manual rename from *.pkg to .txz is needed


I do that by (below patch is needed for it to work)

portupgrade --batch -PPF something


do the rename:
cd /usr/ports/packages/All 
for x in *.pkg; do cp "$x" "${x%.pkg}.txz"; done


install it:
portupgrade --batch -PP something





pkg_fetch diff's
# diff pkg_fetch pkg_fetch.old 
54c54
<   PKG_SUFFIXES = ['.tbz', '.txz', '.tgz', '.pkg']  
---
>   PKG_SUFFIXES = ['.tbz', '.txz', '.tgz']  
329c329
<     suffix = '.pkg'
---
>     suffix = '.txz'
368c368
<                      File.basename(uri, '.pkg'))
---
>                      File.basename(uri, '.txz'))





would be nice with a smart solution, please help  :)