Bug 268351 - ports-mgmt/pkg_replace: 20221212 quits just after reading pkg_replace.conf
Summary: ports-mgmt/pkg_replace: 20221212 quits just after reading pkg_replace.conf
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords: crash, needs-qa
Depends on:
Blocks:
 
Reported: 2022-12-13 12:56 UTC by Tomoaki AOKI
Modified: 2022-12-22 14:28 UTC (History)
2 users (show)

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


Attachments
Log of stderr with `pkg_replace -a -c -m 'WITH+="NVIDIA,NVIDIA_GL" DISABLE_VULNERABILITIES=yes' -x py27-\* -x vscode\* -F -k --debug` (220.19 KB, text/plain)
2022-12-14 00:15 UTC, Tomoaki AOKI
no flags Details
Update to pkg_replace-20221214 (955 bytes, patch)
2022-12-14 04:53 UTC, Ken DEGUCHI
kdeguchi: maintainer-approval+
Details | Diff
Debug output updating www/chromium with pkg_replace 20221214 (33.60 KB, text/plain)
2022-12-14 21:22 UTC, Tomoaki AOKI
no flags Details
Update to pkg_replace-20221215 (955 bytes, patch)
2022-12-14 23:49 UTC, Ken DEGUCHI
no flags Details | Diff
Update to pkg_replace-20221216 (955 bytes, patch)
2022-12-16 01:25 UTC, Ken DEGUCHI
kdeguchi: maintainer-approval+
Details | Diff
Update to pkg_replace-20221216 (955 bytes, patch)
2022-12-16 02:09 UTC, Ken DEGUCHI
kdeguchi: maintainer-approval+
Details | Diff
Failed log 1 for deskutils/xdg-desktop-portal (33.60 KB, text/plain)
2022-12-16 07:17 UTC, Tomoaki AOKI
no flags Details
Failed log 2 for deskutils/xdg-desktop-portal (33.60 KB, text/plain)
2022-12-16 07:21 UTC, Tomoaki AOKI
no flags Details
Failed log 3 for deskutils/xdg-desktop-portal (33.41 KB, text/plain)
2022-12-16 07:24 UTC, Tomoaki AOKI
no flags Details
Reproduced failed log 1 for deskutils/xdg-desktop-portal with command line fixed (425.50 KB, text/plain)
2022-12-16 09:07 UTC, Tomoaki AOKI
no flags Details
Reproduced failed log 2 for deskutils/xdg-desktop-portal with command line fixed (446.52 KB, text/plain)
2022-12-16 09:12 UTC, Tomoaki AOKI
no flags Details
Finally succeeded log: Re-ran previous command again. (445.28 KB, text/plain)
2022-12-16 09:17 UTC, Tomoaki AOKI
no flags Details
Update to pkg_replace-20221216.1 (Pre-release) (961 bytes, patch)
2022-12-16 09:51 UTC, Ken DEGUCHI
kdeguchi: maintainer-approval+
Details | Diff
Redone as reproduced log 1 with 20221216.1 (442.55 KB, text/plain)
2022-12-16 12:55 UTC, Tomoaki AOKI
no flags Details
Redone as reproduced log 2 with 20221216.1 (470.51 KB, text/plain)
2022-12-16 12:58 UTC, Tomoaki AOKI
no flags Details
Update to pkg_replace-20221217 (955 bytes, patch)
2022-12-17 04:42 UTC, Ken DEGUCHI
kdeguchi: maintainer-approval+
Details | Diff
Redone as reproduced log 1 with 20221217 (22.09 KB, application/x-xz-compressed-tar)
2022-12-17 05:54 UTC, Tomoaki AOKI
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomoaki AOKI 2022-12-13 12:56:06 UTC
After updating to 20221212, pkg_replace quits just after reading pkg_replace.conf and doesn't go through dependencies check.
Restoring previous (20221128) fixes the issue.
Comment 1 Ken DEGUCHI 2022-12-13 23:48:59 UTC
(In reply to Tomoaki AOKI from comment #0)

Thanks for reporting the bug. However, I could not reproduce your situation in my environment.

Please get the logs when you run pkg_replace with the --debug option. The logs will help me to find the cause of the problem.
Comment 2 Tomoaki AOKI 2022-12-14 00:15:58 UTC
Created attachment 238773 [details]
Log of stderr with `pkg_replace -a -c -m 'WITH+="NVIDIA,NVIDIA_GL" DISABLE_VULNERABILITIES=yes' -x py27-\* -x vscode\* -F -k --debug`

Log of stderr invoking the command below (as root).

pkg_replace -a -c -m 'WITH+="NVIDIA,NVIDIA_GL" DISABLE_VULNERABILITIES=yes' -x py27-\* -x vscode\* -F -k --debug

At the moment, www/chromium is not yet updated, with x11-wm/compiz-plugins-extra and x11-wm/compiz-plugins-main `pkg lock`ed. All others should be up-to-date at git: a6a5e0a9af98.
Comment 3 Ken DEGUCHI 2022-12-14 04:53:14 UTC
Created attachment 238775 [details]
Update to pkg_replace-20221214

Fix bugs in pkg_replace-20221214. I found the old variables in function main().
I have created a patch to ports-mgmt/pkg_replace. Please try this patch.
Thank you.
Comment 4 Tomoaki AOKI 2022-12-14 09:16:18 UTC
(In reply to kdeguchi from comment #3)

Thanks! 20221214 worked as expected for me.

Currently, tested on stable/13 with
 *Manually update ports tree with git and build INDEX,
 *Fetch distfiles using pkg_replace,
 *Build updated ports using poudriere (started trying),
 *Copy updated packages from poudriere directory to /usr/ports/packages/,and
 *Update actual system using pkg_replace with -PP option.

I'll report back if there are problems on main, which I haven't start testing poudriere.
(Possibly requires a fair amount of time.)

 *I've forced poudriere to null-mount default /usr/ports.
Comment 5 Tomoaki AOKI 2022-12-14 21:16:57 UTC
Unfortunately, encountered a new error on updating www/chromium to 108.0.5359.124 using package built with poudriere. pkg_replace 20221214.

As (automatic) reinstall of old version also failed, tried manually
  pkg add -f /usr/ports/packages/All/chromium-108.0.5359.124.pkg
which succeeded.

Errors copy/pasted from terminal are as follows. (No -debug option and redirects.)

--->  Replacing 'chromium-108.0.5359.98_1' with 'chromium-108.0.5359.124'
--->  Installing dependencies for '--->  Found a package of 'chromium-108.0.5359.124': /var/cache/pkg/All/chromium-108.0.5359.124.pkg
/var/cache/pkg/All/chromium-108.0.5359.124.pkg'
pkg: archive_read_open_filename(--->): Error reading '--->'
--->  Preserving the shared libraries
--->  Deinstalling 'chromium-108.0.5359.98_1'
Updating database digests format: 100%
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
	chromium: 108.0.5359.98_1

Number of packages to be removed: 1

The operation will free 313 MiB.
[1/1] Deinstalling chromium-108.0.5359.98_1...
[1/1] Deleting files for chromium-108.0.5359.98_1: 100%
vidcontrol: getting active vty: Inappropriate ioctl for device
vidcontrol: getting active vty: Inappropriate ioctl for device
Building cache database of MIME types
Generating GTK icon cache for /usr/local/share/icons/hicolor
--->  Installing '--->'
pkg: unrecognized option `--->'
Usage: pkg add [-IAfqM] <pkg-name> ...
       pkg add [-IAfqM] <protocol>://<path>/<pkg-name> ...

For more information see 'pkg help add'.
** Command failed (exit code 1): pkg add --->
** Failed to restore the old version, please reinstall '--->  Found a package of 'chromium-108.0.5359.98_1': /var/cache/pkg/All/chromium-108.0.5359.98_1.pkg
/var/cache/pkg/All/chromium-108.0.5359.98_1.pkg' manually.
** Fix the problem and try again.
--->  ** [62/62] - 0 done, 61 ignored, 0 skipped, 1 failed
--->  Listing the results (+:done / -:ignored / !:failed)
  (snip)
        ! chromium-108.0.5359.98_1 (install error)
rmdir: /var/tmp/pkg_replace.WnmNsb: Directory not empty
** Command failed (exit code 1): rmdir /var/tmp/pkg_replace.WnmNsb
** Couldn't remove the working direcotry: /var/tmp/pkg_replace.WnmNsb
Comment 6 Tomoaki AOKI 2022-12-14 21:22:19 UTC
Created attachment 238796 [details]
Debug output updating www/chromium with pkg_replace 20221214

Debug output from pkg_replace 20221214.
Ran after reinstalling (but the latest one) directly by pkg.

`pkg_replace -c -v -m 'DISABLE_VULNERABILITIES=yes' -R -W -w -PP -b www/chromium --debug 2>/var/tmp/pkg_replace_20221214_chromium.log`
Comment 7 Tomoaki AOKI 2022-12-14 21:49:31 UTC
Additional note.
The following was successful.
So possibly processing " -R", "-m", and/or "-PP" option have problem.

pkg_replace -c -v -f -W -w -b print/ghostscript9-agpl-base print/ghostscript9-agpl-x11
Comment 8 Ken DEGUCHI 2022-12-14 23:49:01 UTC
Created attachment 238804 [details]
Update to pkg_replace-20221215

*Fix bugs in find_package() and get_binary_pkgname()

Fix bugs in pkg_replace-20221215. I have created a patch to ports-mgmt/pkg_replace. Presumably, these bugs should be gone.
Comment 9 Tomoaki AOKI 2022-12-15 09:20:43 UTC
(In reply to kdeguchi from comment #8)

Thanks!

But unfortunately, some new issues. All seems to be related with "-PP" option using 20221215.

 *"-N" option works as reverse in some cases.
   Deleting www/chromium and try installing with "-N" and "-PP" does nothing.
   Installing old www/chromium and update with "-PP" does not recognize installed one.
   After that, with "-N" in conjunction with "-PP" updated sanely.

 *Fails to install new dependency and cause infinite loop.
   Updated deskutils/xdg-desktop-portal changed dependency from sysutils/fusefs-libs
   to sysutils/fusefs-libs3, which was not yet installed.
   Updating with "-a" and "-PP" updated other ports sanely, but on updating
   deskutils/xdg-desktop-portal, caused infinite loop on installing new dependency.
   Re-run after interrupting with ^C, manually `pkg add`'ing sysutils/fusefs-libs3
   went OK.


Additional note:
Without "-PP", using "-f" in conjunction with "-N" for already-installed port caused forced update, which portupgrade errors out as "already installed".
Comment 10 Ken DEGUCHI 2022-12-16 01:25:29 UTC
Created attachment 238824 [details]
Update to pkg_replace-20221216

(In reply to Tomoaki AOKI from comment #9)

Thanks about your report.

Perhaps, I could fix the bugs related "-PP" option.
Please try this patch.

This patch updates ports-mgmt/pkg_replace to pkg_replace-20221216.
Comment 11 Ken DEGUCHI 2022-12-16 02:09:33 UTC
Created attachment 238825 [details]
Update to pkg_replace-20221216

Sorry, another bug fixed related "-dd" option.
Please use this patch.
Comment 12 Tomoaki AOKI 2022-12-16 07:17:29 UTC
Created attachment 238827 [details]
Failed log 1 for deskutils/xdg-desktop-portal

Failed log 1 for deskutils/xdg-desktop-portal.
Nothing done.

Started from up-to-date state at git: caf21b157e15 - main.
pkg_deinstall -f sysutils/fusefs-libs3

then

pkg_replace -c -v -m 'DISABLE_VULNERABILITIES=yes' -R -W -w -PP -b deskutils/xdg-desktop-portal --debug 2>/var/tmp/pkg_replace_20221216_xdg-desktop-portal.log
Comment 13 Tomoaki AOKI 2022-12-16 07:21:40 UTC
Created attachment 238828 [details]
Failed log 2 for deskutils/xdg-desktop-portal

Failed log 2 for deskutils/xdg-desktop-portal.
Nothing done, too.

After failed log 1.
pkg_deinstall -f deskutils/xdg-desktop-portal
pkg add -f /usr/ports/packages/All/xdg-desktop-portal-1.10.1.pkg # previous version.

then

pkg_replace -c -v -m 'DISABLE_VULNERABILITIES=yes' -R -W -w -PP -b deskutils/xdg-desktop-portal --debug 2>/var/tmp/pkg_replace_20221216_xdg-desktop-portal-2.log
Comment 14 Tomoaki AOKI 2022-12-16 07:24:24 UTC
Created attachment 238829 [details]
Failed log 3 for deskutils/xdg-desktop-portal

Failed log 3 for deskutils/xdg-desktop-portal.
Nothing done, too.

After failed log 2,
pkg_replace -c -v -m 'DISABLE_VULNERABILITIES=yes' -R -W -w -PP -N deskutils/xdg-desktop-portal --debug 2>/var/tmp/pkg_replace_20221216_xdg-desktop-portal-3.log
Comment 15 Tomoaki AOKI 2022-12-16 07:28:22 UTC
(In reply to kdeguchi from comment #11)

Thanks.
Uploaded 3 unfortunate logs.

Also, the below after failed log 3 did nothing, too.
As the log is too large (177.1MB in size), didn't uploaded the 4th log.

pkg_replace -a -c -m 'WITH+="NVIDIA,NVIDIA_GL"' -v -R -l /usr/ports/all-`date "+%Y%m%d%H%M%S"`.log -x openoffice\* -x palemoon -x electron\* -x vscode\* -x \*compiz\* -x pkg_replace -W -w -b -PP --debug 2>/var/tmp/pkg_replace_20221216_xdg-desktop-portal-4.log
Comment 16 Ken DEGUCHI 2022-12-16 08:32:08 UTC
(In reply to Tomoaki AOKI from comment #13)

"--debug" option should appear before the package name or origin name.
Please try again.
Comment 17 Tomoaki AOKI 2022-12-16 09:07:40 UTC
Created attachment 238830 [details]
Reproduced failed log 1 for deskutils/xdg-desktop-portal with command line fixed

Reproduced failed log 1 for deskutils/xdg-desktop-portal with command line fixed.
Nothing done.

After the state of my previous post,

# pkg_deinstall -f deskutils/xdg-desktop-portal
# pkg add -f /usr/ports/packages/All/xdg-desktop-portal-1.16.0.pkg
# pkg_deinstall -f sysutils/fusefs-libs3
# pkg_replace -c -v -m 'DISABLE_VULNERABILITIES=yes' -R -W -w -PP -b --debug deskutils/xdg-desktop-portal 2>/var/tmp/pkg_replace_20221216_xdg-desktop-portal-6.log

(stdout)
--->  Loading /usr/local/etc/pkg_replace/pkg_replace.conf
Checking dependencies............done.
--->  ** [1/8] - 0 done, 1 ignored, 0 skipped, 0 failed
--->  ** [2/8] - 0 done, 2 ignored, 0 skipped, 0 failed
--->  ** [3/8] - 0 done, 3 ignored, 0 skipped, 0 failed
--->  ** [4/8] - 0 done, 3 ignored, 1 skipped, 0 failed
--->  ** [5/8] - 0 done, 4 ignored, 1 skipped, 0 failed
--->  ** [6/8] - 0 done, 5 ignored, 1 skipped, 0 failed
--->  ** [7/8] - 0 done, 6 ignored, 1 skipped, 0 failed
--->  ** [8/8] - 0 done, 7 ignored, 1 skipped, 0 failed
--->  Listing the results (+:done / -:ignored / *:skipped)
        - gettext-runtime-0.21.1
        - glib-2.74.3_1,2
        - json-glib-1.6.6
        * fusefs-libs3-(null) (not installed or no origin recorded)
        - geoclue-2.5.7
        - libportal-0.6
        - pipewire-0.3.62
        - xdg-desktop-portal-1.16.0
Comment 18 Tomoaki AOKI 2022-12-16 09:12:53 UTC
Created attachment 238831 [details]
Reproduced failed log 2 for deskutils/xdg-desktop-portal with command line fixed

Reproduced failed log 2 for deskutils/xdg-desktop-portal with command line fixed.
Missing dependency was installed, but specicfied port itself wasn't.

After reproduced failed log 1,

# pkg_deinstall -f deskutils/xdg-desktop-portal
# pkg add -f /usr/ports/packages/All/xdg-desktop-portal-1.10.1.pkg # previous version

then

# pkg_replace -c -v -m 'DISABLE_VULNERABILITIES=yes' -R -W -w -PP -b --debug deskutils/xdg-desktop-portal 2>/var/tmp/pkg_replace_20221216_xdg-desktop-portal-7.log

(stdout)
--->  Loading /usr/local/etc/pkg_replace/pkg_replace.conf
Checking dependencies............done.
--->  ** [1/8] - 0 done, 1 ignored, 0 skipped, 0 failed
--->  ** [2/8] - 0 done, 2 ignored, 0 skipped, 0 failed
--->  ** [3/8] - 0 done, 3 ignored, 0 skipped, 0 failed
--->  ** [4/8] - 0 done, 4 ignored, 0 skipped, 0 failed
--->  ** [5/8] - 0 done, 5 ignored, 0 skipped, 0 failed
--->  ** [6/8] - 0 done, 6 ignored, 0 skipped, 0 failed
--->  ** [7/8] - 0 done, 7 ignored, 0 skipped, 0 failed
--->  Replacing 'xdg-desktop-portal-1.10.1' with 'xdg-desktop-portal-1.16.0'
--->  Found a package of 'xdg-desktop-portal-1.10.1': /var/cache/pkg/All/xdg-desktop-portal-1.16.0.pkg
--->  Installing dependencies for '/var/cache/pkg/All/xdg-desktop-portal-1.16.0.pkg'
--->   Required installed package: fusefs-libs3-3.12.0 - not installed
--->  Installing 'fusefs-libs3-3.12.0' from 'sysutils/fusefs-libs3'
--->  Installing dependencies for '/var/cache/pkg/All/fusefs-libs3-3.12.0.pkg'
--->  Installing '/var/cache/pkg/All/fusefs-libs3-3.12.0.pkg'
Installing fusefs-libs3-3.12.0...
Extracting fusefs-libs3-3.12.0: 100%
=====
Message from fusefs-libs3-3.12.0:

--
Install the FUSE kernel module (kldload fusefs) to use this port.
--->  Returning to install of '/var/cache/pkg/All/xdg-desktop-portal-1.16.0.pkg'
--->  Listing the results (+:done / -:ignored)
        - gettext-runtime-0.21.1
        - glib-2.74.3_1,2
        - json-glib-1.6.6
        - fusefs-libs-2.9.9_2
        - geoclue-2.5.7
        - libportal-0.6
        - pipewire-0.3.62
Comment 19 Tomoaki AOKI 2022-12-16 09:17:05 UTC
Created attachment 238832 [details]
Finally succeeded log: Re-ran previous command again.

Finally succeeded log: Re-ran previous command again.
The specified port itself was updated.

After previous one (half-done), ran the same command (except stderr logfile name).

# pkg_replace -c -v -m 'DISABLE_VULNERABILITIES=yes' -R -W -w -PP -b --debug deskutils/xdg-desktop-portal 2>/var/tmp/pkg_replace_20221216_xdg-desktop-portal-8.log

(stdout)
--->  Loading /usr/local/etc/pkg_replace/pkg_replace.conf
Checking dependencies............done.
--->  ** [1/8] - 0 done, 1 ignored, 0 skipped, 0 failed
--->  ** [2/8] - 0 done, 2 ignored, 0 skipped, 0 failed
--->  ** [3/8] - 0 done, 3 ignored, 0 skipped, 0 failed
--->  ** [4/8] - 0 done, 4 ignored, 0 skipped, 0 failed
--->  ** [5/8] - 0 done, 5 ignored, 0 skipped, 0 failed
--->  ** [6/8] - 0 done, 6 ignored, 0 skipped, 0 failed
--->  ** [7/8] - 0 done, 7 ignored, 0 skipped, 0 failed
--->  Replacing 'xdg-desktop-portal-1.10.1' with 'xdg-desktop-portal-1.16.0'
--->  Found a package of 'xdg-desktop-portal-1.10.1': /var/cache/pkg/All/xdg-desktop-portal-1.16.0.pkg
--->  Installing dependencies for '/var/cache/pkg/All/xdg-desktop-portal-1.16.0.pkg'
--->   Required installed package: fusefs-libs3-3.12.0 - installed
--->   Required installed package: geoclue-2.5.7 - installed
--->   Required installed package: gettext-runtime-0.21.1 - installed
--->   Required installed package: glib-2.74.3_1,2 - installed
--->   Required installed package: json-glib-1.6.6 - installed
--->   Required installed package: libportal-0.6 - installed
--->   Required installed package: pipewire-0.3.62 - installed
--->  Found a package of 'xdg-desktop-portal-1.10.1': /var/cache/pkg/All/xdg-desktop-portal-1.10.1.pkg
--->  Deinstalling 'xdg-desktop-portal-1.10.1'
Updating database digests format: 100%
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
	xdg-desktop-portal: 1.10.1

Number of packages to be removed: 1

The operation will free 2 MiB.
[1/1] Deinstalling xdg-desktop-portal-1.10.1...
[1/1] Deleting files for xdg-desktop-portal-1.10.1: 100%
--->  Installing '/var/cache/pkg/All/xdg-desktop-portal-1.16.0.pkg'
Installing xdg-desktop-portal-1.16.0...
Extracting xdg-desktop-portal-1.16.0: 100%
--->  ** [8/8] - 1 done, 7 ignored, 0 skipped, 0 failed
--->  Listing the results (+:done / -:ignored)
        - gettext-runtime-0.21.1
        - glib-2.74.3_1,2
        - json-glib-1.6.6
        - fusefs-libs-2.9.9_2
        - geoclue-2.5.7
        - libportal-0.6
        - pipewire-0.3.62
        + xdg-desktop-portal-1.10.1
Comment 20 Tomoaki AOKI 2022-12-16 09:20:06 UTC
(In reply to kdeguchi from comment #16)

Uploaded logs.
Needed updating twice (first for new dependency, and second for the port itself) to finish.
Possibly, requires more runs if multiple dependencies are newly added.
Comment 21 Ken DEGUCHI 2022-12-16 09:48:11 UTC
(In reply to Tomoaki AOKI from comment #17)

Please let me check.

Does /usr/ports/packages/All/xdg-desktop-portal-1.16.0.pkg depend on sysutils/fusefs-libs3?
Comment 22 Ken DEGUCHI 2022-12-16 09:51:38 UTC
Created attachment 238833 [details]
Update to pkg_replace-20221216.1 (Pre-release)

*Fix more bugs related "-P" or "-PP" option.
Comment 23 Tomoaki AOKI 2022-12-16 12:55:50 UTC
Created attachment 238834 [details]
Redone as reproduced log 1 with 20221216.1

Redone as reproduced log 1 with 20221216.1.
Nothing done.

# pkg_deinstall -f sysutils/fusefs-libs3
# pkg_replace -c -v -m 'DISABLE_VULNERABILITIES=yes' -R -W -w -PP -b --debug deskutils/xdg-desktop-portal 2>/var/tmp/pkg_replace_20221216.1_xdg-desktop-portal-9.log && portsclean -C

(stdout)
--->  Loading /usr/local/etc/pkg_replace/pkg_replace.conf
Checking dependencies............done.
--->  ** [1/8] - 0 done, 1 ignored, 0 skipped, 0 failed
--->  ** [2/8] - 0 done, 2 ignored, 0 skipped, 0 failed
--->  ** [3/8] - 0 done, 3 ignored, 0 skipped, 0 failed
--->  ** [4/8] - 0 done, 3 ignored, 1 skipped, 0 failed
--->  ** [5/8] - 0 done, 4 ignored, 1 skipped, 0 failed
--->  ** [6/8] - 0 done, 5 ignored, 1 skipped, 0 failed
--->  ** [7/8] - 0 done, 6 ignored, 1 skipped, 0 failed
--->  ** [8/8] - 0 done, 7 ignored, 1 skipped, 0 failed
--->  Listing the results (+:done / -:ignored / *:skipped)
        - gettext-runtime-0.21.1
        - glib-2.74.3_1,2
        - json-glib-1.6.6
        * fusefs-libs3-(null) (not installed or no origin recorded)
        - geoclue-2.5.7
        - libportal-0.6
        - pipewire-0.3.62
        - xdg-desktop-portal-1.16.0
Comment 24 Tomoaki AOKI 2022-12-16 12:58:40 UTC
Created attachment 238835 [details]
Redone as reproduced log 2 with 20221216.1

Redone as reproduced log 2 with 20221216.1.
Sanely added missing dependency and specified port itself.

# pkg_deinstall -f deskutils/xdg-desktop-portal
# pkg add -f /usr/ports/packages/All/xdg-desktop-portal-1.10.1.pkg
# pkg_replace -c -v -m 'DISABLE_VULNERABILITIES=yes' -R -W -w -PP -b --debug deskutils/xdg-desktop-portal 2>/var/tmp/pkg_replace_20221216.1_xdg-desktop-portal-10.log && portsclean -C

(stdout)
--->  Loading /usr/local/etc/pkg_replace/pkg_replace.conf
Checking dependencies............done.
--->  ** [1/8] - 0 done, 1 ignored, 0 skipped, 0 failed
--->  ** [2/8] - 0 done, 2 ignored, 0 skipped, 0 failed
--->  ** [3/8] - 0 done, 3 ignored, 0 skipped, 0 failed
--->  ** [4/8] - 0 done, 4 ignored, 0 skipped, 0 failed
--->  ** [5/8] - 0 done, 5 ignored, 0 skipped, 0 failed
--->  ** [6/8] - 0 done, 6 ignored, 0 skipped, 0 failed
--->  ** [7/8] - 0 done, 7 ignored, 0 skipped, 0 failed
--->  Replacing 'xdg-desktop-portal-1.10.1' with 'xdg-desktop-portal-1.16.0'
--->  Found a package of 'xdg-desktop-portal-1.10.1': /var/cache/pkg/All/xdg-desktop-portal-1.16.0.pkg
--->  Installing dependencies for '/var/cache/pkg/All/xdg-desktop-portal-1.16.0.pkg'
--->   Required installed package: fusefs-libs3-3.12.0 - not installed
--->  Installing 'fusefs-libs3-3.12.0' from 'sysutils/fusefs-libs3'
--->  Installing dependencies for '/var/cache/pkg/All/fusefs-libs3-3.12.0.pkg'
--->  Installing '/var/cache/pkg/All/fusefs-libs3-3.12.0.pkg'
Installing fusefs-libs3-3.12.0...
Extracting fusefs-libs3-3.12.0: 100%
=====
Message from fusefs-libs3-3.12.0:

--
Install the FUSE kernel module (kldload fusefs) to use this port.
--->  Returning to install of '/var/cache/pkg/All/xdg-desktop-portal-1.16.0.pkg'
--->   Required installed package: geoclue-2.5.7 - installed
--->   Required installed package: gettext-runtime-0.21.1 - installed
--->   Required installed package: glib-2.74.3_1,2 - installed
--->   Required installed package: json-glib-1.6.6 - installed
--->   Required installed package: libportal-0.6 - installed
--->   Required installed package: pipewire-0.3.62 - installed
--->  Found a package of 'xdg-desktop-portal-1.10.1': /var/cache/pkg/All/xdg-desktop-portal-1.10.1.pkg
--->  Deinstalling 'xdg-desktop-portal-1.10.1'
Updating database digests format: 100%
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
	xdg-desktop-portal: 1.10.1

Number of packages to be removed: 1

The operation will free 2 MiB.
[1/1] Deinstalling xdg-desktop-portal-1.10.1...
[1/1] Deleting files for xdg-desktop-portal-1.10.1: 100%
--->  Installing '/var/cache/pkg/All/xdg-desktop-portal-1.16.0.pkg'
Installing xdg-desktop-portal-1.16.0...
Extracting xdg-desktop-portal-1.16.0: 100%
--->  ** [8/8] - 1 done, 7 ignored, 0 skipped, 0 failed
--->  Listing the results (+:done / -:ignored)
        - gettext-runtime-0.21.1
        - glib-2.74.3_1,2
        - json-glib-1.6.6
        - fusefs-libs-2.9.9_2
        - geoclue-2.5.7
        - libportal-0.6
        - pipewire-0.3.62
        + xdg-desktop-portal-1.10.1
Comment 25 Tomoaki AOKI 2022-12-16 13:00:08 UTC
(In reply to kdeguchi from comment #21)

Yes.
% pkg info --dependencies -F /usr/ports/packages/All/xdg-desktop-portal-1.16.0.pkg 
xdg-desktop-portal-1.16.0:
        fusefs-libs3-3.12.0
        geoclue-2.5.7
        gettext-runtime-0.21.1
        glib-2.74.3_1,2
        json-glib-1.6.6
        libportal-0.6
        pipewire-0.3.62
Comment 26 Tomoaki AOKI 2022-12-16 13:10:17 UTC
(In reply to kdeguchi from comment #22)

Thanks! Looks working fine now.
Logs uploaded.

It would be nice if cases like Comment 23 works fine, but usually OK now.

Cases like Comment 23 would be happen when...

 *Changed option(s) for already-installed port, thus causing new dependencies,
  and build new package with poudriere (or jenkins, synth, ...).

 *The port missingly updated without version bump, with new dependencies added.
Comment 27 Ken DEGUCHI 2022-12-17 04:37:30 UTC
(In reply to Tomoaki AOKI from comment #23)

Fix this bug.

If package binary file exists, pkg_replace gets dependencies from it.
Comment 28 Ken DEGUCHI 2022-12-17 04:42:29 UTC
Created attachment 238858 [details]
Update to pkg_replace-20221217

*Fix bugs related "-P" and "-PP" options.

Please try this patch. If it works out, I will try to reflect this to ports.
Thank you.
Comment 29 Tomoaki AOKI 2022-12-17 05:54:58 UTC
Created attachment 238859 [details]
Redone as reproduced log 1 with 20221217

Redone as reproduced log 1 with 20221217.
Works as expected. Thanks!
Log file was a bit too large, so archived as .txz.

From up-to-date state,

# pkg_deinstall -f sysutils/fusefs-libs3
# pkg_replace -c -v -m 'DISABLE_VULNERABILITIES=yes' -R -W -w -PP -b --debug deskutils/xdg-desktop-portal 2>/var/tmp/pkg_replace_20221217_xdg-desktop-portal-1.log

(stdout)
--->  Loading /usr/local/etc/pkg_replace/pkg_replace.conf
Checking dependencies............done.
+ pkg query -g %n-%v gettext-runtime-0.21.1
+ return 0
+ pkg query -g %n-%v glib-2.74.3_1,2
+ return 0
+ pkg query -g %n-%v json-glib-1.6.6
+ return 0
+ pkg query -g %n-%v fusefs-libs3-3.12.0
+ return 1
+ pkg query -g %n-%v geoclue-2.5.7
+ return 0
+ pkg query -g %n-%v libportal-0.6
+ return 0
+ pkg query -g %n-%v pipewire-0.3.62
+ return 0
+ pkg query -g %n-%v xdg-desktop-portal-1.16.0
+ return 0
--->  Installing 'fusefs-libs3-3.12.0' from 'fusefs-libs3-3.12.0'
--->  Installing dependencies for '/var/cache/pkg/All/fusefs-libs3-3.12.0.pkg'
--->  Installing '/var/cache/pkg/All/fusefs-libs3-3.12.0.pkg'
Installing fusefs-libs3-3.12.0...
Extracting fusefs-libs3-3.12.0: 100%
=====
Message from fusefs-libs3-3.12.0:

--
Install the FUSE kernel module (kldload fusefs) to use this port.
--->  ** [1/1] - 1 done, 0 ignored, 0 skipped, 0 failed
--->  ** [1/7] - 1 done, 1 ignored, 0 skipped, 0 failed
--->  ** [2/7] - 1 done, 2 ignored, 0 skipped, 0 failed
--->  ** [3/7] - 1 done, 3 ignored, 0 skipped, 0 failed
--->  ** [4/7] - 1 done, 4 ignored, 0 skipped, 0 failed
--->  ** [5/7] - 1 done, 5 ignored, 0 skipped, 0 failed
--->  ** [6/7] - 1 done, 6 ignored, 0 skipped, 0 failed
--->  ** [7/7] - 1 done, 7 ignored, 0 skipped, 0 failed
--->  Listing the results (+:done / -:ignored)
        + fusefs-libs3-3.12.0
        - gettext-runtime-0.21.1
        - glib-2.74.3_1,2
        - json-glib-1.6.6
        - geoclue-2.5.7
        - libportal-0.6
        - pipewire-0.3.62
        - xdg-desktop-portal-1.16.0
Comment 30 Tomoaki AOKI 2022-12-17 05:58:42 UTC
(In reply to kdeguchi from comment #28)

Thanks! Now works as expected.
Uploaded log as tar xz (.txz) format. It was a bit too large to upload here.

Just to be sure, tried reproduced log 2 case without problem.
I'll upload the log if you need, too.
Comment 31 Ken DEGUCHI 2022-12-17 06:29:23 UTC
(In reply to Tomoaki AOKI from comment #30)

Thanks for your report!
I will reflect pkg_replace-20221217 in the ports.
Comment 32 Ken DEGUCHI 2022-12-22 06:47:39 UTC
Update to pkg_replace-20221222.

See also, bug #268364
Comment 33 Tomoaki AOKI 2022-12-22 14:25:05 UTC
(In reply to kdeguchi from comment #32)

Tested just as with 20221217.
Working as expected, too.
(No log uploaded this time.)

Thanks! Will close this soon.
Comment 34 Tomoaki AOKI 2022-12-22 14:28:27 UTC
Close this as with Bug 268364.