Bug 242964 - UPDATING instructions for updating python to 3.7 via portmaster fail under default root shell
Summary: UPDATING instructions for updating python to 3.7 via portmaster fail under de...
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: Danilo G. Baio
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-29 17:14 UTC by Robert William Vesterman
Modified: 2020-05-01 21:10 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert William Vesterman 2019-12-29 17:14:20 UTC
/usr/ports/UPDATING has an entry on 20191216 for updating python to 3.7.  There's a specific section in there describing how to do it if you're using portmaster.  The instructions in that section do not work when using the default root shell.  Specifically, the line...

# REINSTALL="$(pkg info -o py36-\* | awk '{printf "%s ", $2}')"

... fails with "Illegal variable name."

The instructions work fine if you switch to bash, but perhaps they should be changed to work in the default shell.  At the very least, it should be noted in the UPDATING entry that the instructions require a specific non-default shell to be used.
Comment 1 Walter Schwarzenfeld freebsd_triage 2019-12-30 08:24:38 UTC
The instruction is correct:

  This may ease the upgrade for users of pre-build packages:
==>  # sh
  # for i in $(pkg query -g %n 'py36-*'); do pkg set -yn ${i}:py37-${i#py36-}; done
  # pkg upgrade

The first command is "sh" the change to the sh-shell.
Comment 2 Robert William Vesterman 2019-12-30 18:00:25 UTC
(In reply to Walter Schwarzenfeld from comment #1)

The part you're quoting begins with "This may ease the upgrade for users of pre-build packages".  I don't use pre-built packages, and so did not do that.  I instead proceeded to the next step, "For portmaster users", as I do use portmaster.  That portmaster section -- nor any other applicable section -- does not say to change shell.

The way I followed these instructions is, I believe, consistent with a whole lot of /usr/ports/UPDATING instructions that I have successfully used in the past.  They often have different sections for users of different port management schemes.
Comment 3 Edinilson 2020-02-06 19:06:16 UTC
(In reply to Robert William Vesterman from comment #2)

Robert, you are right! The portmaster section is wrong and sh is missing!
Comment 4 Edinilson 2020-02-06 19:09:01 UTC
(In reply to Walter Schwarzenfeld from comment #1)

The portmaster section was wrong and today, 02/06/2020 is wrong yet and misleading to errors for those using portmaster
Comment 5 Edinilson 2020-02-07 10:45:20 UTC
......

For portmaster users:

# sh
# cd /usr/ports

......
Comment 6 commit-hook freebsd_committer freebsd_triage 2020-05-01 21:09:32 UTC
A commit references this bug:

Author: dbaio
Date: Fri May  1 21:08:51 UTC 2020
New revision: 533589
URL: https://svnweb.freebsd.org/changeset/ports/533589

Log:
  Improve entry for Python 3.7 upgrade

  Portmaster instruction fails under default root shell.

  PR:		242964
  Reported by:	Robert William Vesterman <bob@vesterman.com>

Changes:
  head/UPDATING
Comment 7 Danilo G. Baio freebsd_committer freebsd_triage 2020-05-01 21:10:14 UTC
Thank you and sorry for the delay.