Bug 207966 - ports-mgmt/pkg: pkg(8) is not checking/returning +PRE_INSTALL/+POST_INSTALL error
Summary: ports-mgmt/pkg: pkg(8) is not checking/returning +PRE_INSTALL/+POST_INSTALL e...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-pkg (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-14 05:18 UTC by Maxim Sobolev
Modified: 2016-05-22 15:20 UTC (History)
3 users (show)

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


Attachments
Proposed fix to pass error forward. (1.80 KB, patch)
2016-03-14 05:18 UTC, Maxim Sobolev
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maxim Sobolev freebsd_committer freebsd_triage 2016-03-14 05:18:15 UTC
Created attachment 168125 [details]
Proposed fix to pass error forward.

pkg(8) is not propagating error from running scripts when installing port, making it impossible to pass an error back to the make. For some reason warning is issued but error is not passed forward. The attached patch fixes the issue for us.
Comment 1 Maxim Sobolev freebsd_committer freebsd_triage 2016-04-08 05:49:38 UTC
Hi Bapt/guys, can someone look into this? Thanks!

-Max
Comment 2 Baptiste Daroussin freebsd_committer freebsd_triage 2016-04-08 06:35:59 UTC
Oups sorry I missed that one.

Yes it is known, it is a choice since day one because too many scripts where failing. The level of failures here has reduced a lot so it maybe time to revisit it.

Second pkg installation is not supporting a "rollback" if package fails in post installation then you are left the new binaries but the package is not registered as such.

The plan is the following:
- improve the transactional nature of pkg installation process (working on it right now)
- apply a patch like yours to make sure things fails.

For the first point I just need 2 days of free time, so that should now happen soon!
Comment 3 Mathieu Arnold freebsd_committer freebsd_triage 2016-04-08 08:41:39 UTC
Already assigned to the maintainer.
Comment 4 Franco Fichtner 2016-04-08 08:54:09 UTC
Yay, cool.  This is going to cause a headache for many existing scripts and users along with multiple flags that need to be introduced to restore previous behaviour(s). Sometimes the scripts will fail, sometimes people will want to break at the first trouble, other times they will need the script/install to resume. Rollback is nice, but if a file system oddity (e.g. missing dir) causes a package not to persist, that's going to be awkward, especially in an upgrade phase where the old package is gone and the new one can't be installed so it ends up missing.
Comment 5 Baptiste Daroussin freebsd_committer freebsd_triage 2016-05-10 08:42:28 UTC
Just as a followup it has been implemented in pkg (1.8) which should be released very very soonish