Bug 202384 - ports-mgmt/portupgrade: -PP fails using pkg
Summary: ports-mgmt/portupgrade: -PP fails using pkg
Status: Closed Overcome By Events
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: 2015-08-17 12:27 UTC by Helmut Ritter
Modified: 2018-01-18 15:31 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 2015-08-17 12:27:09 UTC
When I try to portupgrade with pkg I receive a fetch error. Running the invoked command manually fetches the package properly. Tested on 2 installations, both 10.1-RELEASE.

[helmut@BSDHelmut ~]$ sudo portupgrade -PPv perl5-5.20.2_5
--->  Session started at: Mon, 17 Aug 2015 13:32:35 +0200
[Reading data from pkg(8) ... - 346 packages found - done]
--->  Checking for the latest package of 'lang/perl5.20'
--->  Found a package of 'lang/perl5.20': /usr/ports/packages/All/perl5-5.20.2_5.txz (perl5-5.20.2_5)
--->  Fetching the package(s) for 'perl5-5.20.2_6' (lang/perl5.20)
Updating MyRepo repository catalogue...
MyRepo repository is up-to-date.
All repositories are up-to-date.
[Reading data from pkg(8) ... - 346 packages found - done]
--->  Fetching perl5-5.20.2_6
--->  Invoking a command: /usr/local/sbin/pkg fetch -U -y -o '/var/tmp/portupgradeTzsTpMQb' 'perl5-5.20.2_6'
The following packages will be fetched:

New packages to be FETCHED:
        perl5-5.20.2_6 (100.00% of 13 MiB: 13 MiB)

The process will require 13 MiB more space.
13 MiB to be downloaded.
Fetching perl5-5.20.2_6.txz: 100%   13 MiB  13.8MB/s    00:01
** Failed to fetch perl5-5.20.2_6.txz
** Failed to fetch perl5-5.20.2_6
--->  Listing the results (+:done / -:ignored / *:skipped / !:failed)
        ! perl5-5.20.2_6        (fetch error)
--->  Packages processed: 0 done, 0 ignored, 0 skipped and 1 failed
--->  Found a package of 'lang/perl5.20': /usr/ports/packages/All/perl5-5.20.2_5.txz (perl5-5.20.2_5)
--->  Located a package version 5.20.2_5 (/usr/ports/packages/All/perl5-5.20.2_5.txz)
** Ignoring the package, which is the same version as is installed (5.20.2_5)
** No package available: lang/perl5.20
--->  ** Upgrade tasks 1: 0 done, 0 ignored, 0 skipped and 1 failed
--->  Listing the results (+:done / -:ignored / *:skipped / !:failed)
        ! lang/perl5.20 (perl5-5.20.2_5)        (package not found)
--->  Packages processed: 0 done, 0 ignored, 0 skipped and 1 failed
--->  Session ended at: Mon, 17 Aug 2015 13:32:39 +0200 (consumed 00:00:03)
[helmut@BSDHelmut ~]$ /usr/local/sbin/pkg fetch -U -y -o /var/tmp/portupgradeTzsTpMQb perl5-5.20.2_6
The following packages will be fetched:

New packages to be FETCHED:
        perl5-5.20.2_6 (100.00% of 13 MiB: 13 MiB)

The process will require 13 MiB more space.
13 MiB to be downloaded.
Fetching perl5-5.20.2_6.txz: 100%   13 MiB  13.8MB/s    00:01
[helmut@BSDHelmut ~]$ ls -la /var/tmp/portupgradeTzsTpMQb/
total 13480
drwxr-xr-x   2 helmut  wheel       512 Aug 17 13:32 .
drwxrwxrwt  12 root    wheel       512 Aug 17 13:32 ..
-rw-r--r--   1 helmut  wheel  13754532 Aug 17 13:05 perl5-5.20.2_6.txz
[helmut@BSDHelmut ~]$ sudo /usr/local/sbin/pkg install /var/tmp/portupgradeTzsTpMQb/perl5-5.20.2_6.txz
Updating MyRepo repository catalogue...
MyRepo repository is up-to-date.
All repositories are up-to-date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        perl5: 5.20.2_6

The process will require 49 MiB more space.

Proceed with this action? [y/N]: y
[1/1] Installing perl5-5.20.2_6...
[1/1] Extracting perl5-5.20.2_6: 100%
Message for perl5-5.20.2_6:
The /usr/bin/perl symlink has been removed starting with Perl 5.20.
For shebangs, you should either use:

#!/usr/local/bin/perl

or

#!/usr/bin/env perl

The first one will only work if you have a /usr/local/bin/perl,
the second will work as long as perl is in PATH.
[helmut@BSDHelmut ~]$ uname -a
FreeBSD BSDHelmut.charlieroot.de 10.1-RELEASE-p10 FreeBSD 10.1-RELEASE-p10 #1 r283138: Wed May 20 12:14:31 CEST 2015     root@BSDHelmut1064.charlieroot.de:/usr/obj/usr/src/sys/GENERIC-PF-ALTQ  amd64
[helmut@BSDHelmut ~]$
Comment 1 Bryan Drewery freebsd_committer freebsd_triage 2015-08-18 17:23:12 UTC
pkg fetch is probably returning the wrong exit status.
Comment 2 Helmut Ritter 2015-08-18 18:08:14 UTC
(In reply to Bryan Drewery from comment #1)

My Python knowledge is very bad, if you provide a patch that outputs the return code I can further test.
Comment 3 Bryan Drewery freebsd_committer freebsd_triage 2015-08-18 18:12:08 UTC
Just run the command on the shell and then echo $? right after.
Comment 4 Helmut Ritter 2015-08-18 18:14:21 UTC
(In reply to Bryan Drewery from comment #3)

[helmut@BSDHelmut ~]$ /usr/local/sbin/pkg fetch -U -y -o /var/tmp/portupgradeTzsTpMQb perl5-5.20.2_6; echo $?
The following packages will be fetched:

New packages to be FETCHED:
        perl5-5.20.2_6 (100.00% of 13 MiB: 13 MiB)

The process will require 13 MiB more space.
13 MiB to be downloaded.
Fetching perl5-5.20.2_6.txz: 100%   13 MiB  13.8MB/s    00:01
0
[helmut@BSDHelmut ~]$
Comment 5 Helmut Ritter 2015-08-31 10:42:23 UTC
Where does portupgrade look for the downloaded package? If I move all files of my Repo to All/, 'portupgrade -PP' is successful:

[helmut@BSDHelmut ~]$ sudo portupgrade -fvvvPP p5-Archive-Zip
--->  Session started at: Mon, 31 Aug 2015 12:34:44 +0200
[Reading data from pkg(8) ... - 369 packages found - done]
--->  Checking for the latest package of 'archivers/p5-Archive-Zip'
--->  Fetching the package(s) for 'p5-Archive-Zip-1.50' (archivers/p5-Archive-Zip)
Updating MyRepo repository catalogue...
MyRepo repository is up-to-date.
All repositories are up-to-date.
--->  Fetching p5-Archive-Zip-1.50
--->  Invoking a command: /usr/local/sbin/pkg fetch -U -y -o '/var/tmp/portupgradeYP45H1fn' 'p5-Archive-Zip-1.50'
Updating database digests format: 100%
The following packages will be fetched:

New packages to be FETCHED:
        p5-Archive-Zip-1.50 (100.00% of 79 KiB: 79 KiB)

The process will require 79 KiB more space.
79 KiB to be downloaded.
Fetching p5-Archive-Zip-1.50.txz: 100%   79 KiB  80.6kB/s    00:01
--->  Downloaded as p5-Archive-Zip-1.50.txz
--->  Identifying the package /var/tmp/portupgradeYP45H1fn/All/p5-Archive-Zip-1.50.txz
--->  Saved as /usr/ports/packages/All/p5-Archive-Zip-1.50.txz
--->  Listing the results (+:done / -:ignored / *:skipped / !:failed)
        + p5-Archive-Zip-1.50
--->  Packages processed: 1 done, 0 ignored, 0 skipped and 0 failed
--->  Found a package of 'archivers/p5-Archive-Zip': /usr/ports/packages/All/p5-Archive-Zip-1.50.txz (p5-Archive-Zip-1.50)
--->  Located a package version 1.50 (/usr/ports/packages/All/p5-Archive-Zip-1.50.txz)
--->  Reinstallation of archivers/p5-Archive-Zip started at: Mon, 31 Aug 2015 12:34:47 +0200
--->  Reinstalling 'p5-Archive-Zip-1.50' (archivers/p5-Archive-Zip) using a package
--->  Uninstallation of p5-Archive-Zip-1.50 started at: Mon, 31 Aug 2015 12:34:47 +0200
--->  Fixing up dependencies before creating a package
--->  Backing up the old version
--->  Uninstalling the old version
[Reading data from pkg(8) ... - 369 packages found - done]
--->  Deinstalling 'p5-Archive-Zip-1.50'
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:
        p5-Archive-Zip-1.50

The operation will free 228 KiB.
[1/1] Deinstalling p5-Archive-Zip-1.50...
[1/1] Deleting files for p5-Archive-Zip-1.50: 100%
[Reading data from pkg(8) ... - 368 packages found - done]
--->  Uninstallation of p5-Archive-Zip-1.50 ended at: Mon, 31 Aug 2015 12:34:51 +0200 (consumed 00:00:03)
--->  Installation of p5-Archive-Zip-1.50 started at: Mon, 31 Aug 2015 12:34:51 +0200
--->  Installing the new version via the package
Installing p5-Archive-Zip-1.50...
Extracting p5-Archive-Zip-1.50: 100%
--->  Removing temporary files and directories
--->  Removing old package'
--->  Installation of p5-Archive-Zip-1.50 ended at: Mon, 31 Aug 2015 12:34:52 +0200 (consumed 00:00:01)
--->  Cleaning out obsolete shared libraries
--->  Reinstallation of archivers/p5-Archive-Zip ended at: Mon, 31 Aug 2015 12:34:56 +0200 (consumed 00:00:08)
--->  ** Upgrade tasks 1: 1 done, 0 ignored, 0 skipped and 0 failed
--->  Listing the results (+:done / -:ignored / *:skipped / !:failed)
        + archivers/p5-Archive-Zip (p5-Archive-Zip-1.50 -> p5-Archive-Zip-1.50)
--->  Packages processed: 1 done, 0 ignored, 0 skipped and 0 failed
--->  Session ended at: Mon, 31 Aug 2015 12:34:57 +0200 (consumed 00:00:12)
[helmut@BSDHelmut ~]$

pkg help repo does not state anything about specific package directory names:

     To create a package repository catalogue you must specify the top-level
     directory where all the packages are stored as repo-path.  pkg repo will
     search the filesystem beneath repo-path to find all the packages it con-
     tains.  Directories starting with ".
     "" or named Latest are not traversed.
Comment 6 Bryan Drewery freebsd_committer freebsd_triage 2017-02-15 16:07:22 UTC
Why was this closed? It's still an issue. Please do not drive-by close things without an explanation.
Comment 7 Helmut Ritter 2017-02-15 16:19:08 UTC
(In reply to Bryan Drewery from comment #6)

Sorry, my fault, though I should close my own PR as it seems fixed (See also Comment 5):

[helmut@BSDHelmut ~]$ sudo portupgrade -fvvvPP perl5-5.20.3_15
--->  Session started at: Wed, 15 Feb 2017 17:15:39 +0100
[Reading data from pkg(8) ... - 349 packages found - done]
--->  Checking for the latest package of 'lang/perl5.20'
--->  Fetching the package(s) for 'perl5-5.20.3_15' (lang/perl5.20)
Updating MyRepo repository catalogue...
MyRepo repository is up-to-date.
All repositories are up-to-date.
--->  Fetching perl5-5.20.3_15
--->  Invoking a command: /usr/local/sbin/pkg fetch -U -y -o '/var/tmp/portupgradezTIxQKoG' 'perl5-5.20.3_15'
Updating database digests format: 100%
The following packages will be fetched:

New packages to be FETCHED:
        perl5-5.20.3_15 (13 MiB: 100.00% of the 13 MiB to download)

Number of packages to be fetched: 1

The process will require 13 MiB more space.
13 MiB to be downloaded.
Fetching perl5-5.20.3_15.txz: 100%   13 MiB  13.8MB/s    00:01
--->  Downloaded as perl5-5.20.3_15.txz
--->  Identifying the package /var/tmp/portupgradezTIxQKoG/All/perl5-5.20.3_15.txz
--->  Saved as /usr/ports/packages/All/perl5-5.20.3_15.txz
--->  Listing the results (+:done / -:ignored / *:skipped / !:failed)
        + perl5-5.20.3_15
--->  Packages processed: 1 done, 0 ignored, 0 skipped and 0 failed
--->  Found a package of 'lang/perl5.20': /usr/ports/packages/All/perl5-5.20.3_15.txz (perl5-5.20.3_15)
--->  Located a package version 5.20.3_15 (/usr/ports/packages/All/perl5-5.20.3_15.txz)
--->  Reinstallation of lang/perl5.20 started at: Wed, 15 Feb 2017 17:15:43 +0100
--->  Reinstalling 'perl5-5.20.3_15' (lang/perl5.20) using a package
--->  Uninstallation of perl5-5.20.3_15 started at: Wed, 15 Feb 2017 17:15:43 +0100
--->  Fixing up dependencies before creating a package
--->  Backing up the old version
--->  Uninstalling the old version
[Reading data from pkg(8) ... - 349 packages found - done]
--->  Deinstalling 'perl5-5.20.3_15'
--->  Preserving /usr/local/lib/perl5/5.20/mach/CORE/libperl.so.5.20.3 as /usr/local/lib/compat/pkg/libperl.so.5.20.3
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:
        perl5-5.20.3_15

Number of packages to be removed: 1

The operation will free 49 MiB.
[1/1] Deinstalling perl5-5.20.3_15...
[1/1] Deleting files for perl5-5.20.3_15: 100%
[Reading data from pkg(8) ... - 348 packages found - done]
--->  Uninstallation of perl5-5.20.3_15 ended at: Wed, 15 Feb 2017 17:16:32 +0100 (consumed 00:00:48)
--->  Installation of perl5-5.20.3_15 started at: Wed, 15 Feb 2017 17:16:32 +0100
--->  Installing the new version via the package
Installing perl5-5.20.3_15...
Extracting perl5-5.20.3_15: 100%
Message from perl5-5.20.3_15:
The /usr/bin/perl symlink has been removed starting with Perl 5.20.
For shebangs, you should either use:

#!/usr/local/bin/perl

or

#!/usr/bin/env perl

The first one will only work if you have a /usr/local/bin/perl,
the second will work as long as perl is in PATH.
--->  Removing temporary files and directories
--->  Removing old package'
--->  Installation of perl5-5.20.3_15 ended at: Wed, 15 Feb 2017 17:16:41 +0100 (consumed 00:00:08)
--->  Cleaning out obsolete shared libraries
--->  Reinstallation of lang/perl5.20 ended at: Wed, 15 Feb 2017 17:16:46 +0100 (consumed 00:01:02)
--->  ** Upgrade tasks 1: 1 done, 0 ignored, 0 skipped and 0 failed
--->  Listing the results (+:done / -:ignored / *:skipped / !:failed)
        + lang/perl5.20 (perl5-5.20.3_15 -> perl5-5.20.3_15)
--->  Packages processed: 1 done, 0 ignored, 0 skipped and 0 failed
--->  Session ended at: Wed, 15 Feb 2017 17:16:47 +0100 (consumed 00:01:07)
[helmut@BSDHelmut ~]$
Comment 8 Walter Schwarzenfeld 2018-01-16 11:04:31 UTC
Is this still relevant?
Comment 9 Helmut Ritter 2018-01-18 10:25:55 UTC
No. See history, I already wanted to close this PR.