Ticket #544 (closed defect: worksforme)

Opened 2 years ago

Last modified 2 years ago

Value of default-scope variable is not preserved to pkg_postinst

Reported by: ulm Owned by: ciaranm
Priority: Sometime Milestone:
Component: core/paludis Version: 0.26.0_alpha13
Keywords: Cc:
Blocked By: Blocking:
Distribution:

Description

The value of a default-scope variable (set in src_unpack) is not preserved. It is void in pkg_postinst.

The concrete case is emacs-cvs-23.0.60-!r2.ebuild, variable FULL_VERSION. It is set in src_unpack, still available in src_install, but no longer in pkg_postinst.

PMS says in 11.2, The state of variables between functions: "Exported and default scope variables are saved between functions. A non-local variable set in a function earlier in the call sequence must have its value preserved for later functions, including functions executed as part of a later uninstall. Variables that were exported must remain exported in later functions; variables with default visibility may retain default visibility or be exported."

(And it also works in Portage, even for installation of a binpkg.)

Change History

follow-up: ↓ 5   Changed 2 years ago by ciaranm

Hrm. I can't get that ebuild to work without nuking src_compile, so I can't test it properly... But adding echo "FULL_VERSION is ${FULL_VERSION}" to pkg_postinst shows 23.0.60 as expected. Does something else happen for you?

Failing that... sudo paludis --info app-editors/emacs-cvs::gentoo app-editors/emacs-cvs::installed~~ please.

  Changed 2 years ago by ciaranm

(Those tildes shouldn't be there. I can't type.)

  Changed 2 years ago by creidiki

paludis --info app-editors/emacs-cvs::gentoo app-editors/emacs-cvs::installed | grep FULL_VERSION

show nuffin' - do you want the full output of that pasted? Its quite long.

  Changed 2 years ago by ciaranm

I want the full output *if* you get an empty value displayed when updating the ebuild as suggested.

in reply to: ↑ 1   Changed 2 years ago by ulm

Replying to ciaranm:

But adding echo "FULL_VERSION is ${FULL_VERSION}" to pkg_postinst shows 23.0.60 as expected. Does something else happen for you?

No, same here (with 0.26.0_alpha13, and compile succeeds for me). Looks like it is not reproducible...

@creidiki: Yesterday you had two clear indications of a failure, namely the missing file and the output from the added einfo command. Can you still reproduce the issue?

  Changed 2 years ago by ciaranm

  • status changed from new to closed
  • resolution set to worksforme

Can't reproduce this one...

Note: See TracTickets for help on using tickets.