onu: futile to change stickiness of a system publisher
On OpenIndiana (and I believe OmniOS CE) zone with repository from which
osnet-incorporation comes from being a system repository:
$ pkg list -Hv osnet-incorporation pkg://firstname.lastname@example.org:20190615T015246Z i-- $ pkg publisher PUBLISHER TYPE STATUS P LOCATION openindiana.org (non-sticky, syspub) origin online T <system-repository>
onu script fails while attempting to set non-stickiness to the openindiana.org publisher:
$ pfexec ~/ws/illumos-gate/usr/src/tools/proto/root_i386-nd/opt/onbld/bin/onu \ -t "$(date -u +nightly-%Y%m%d-%H%MZ)" \ -d "/export/home/newman/ws/illumos-gate/packages/i386/nightly/" Created successfully Mounted successfully on: '/tmp/onu.4eaOv1' pkg set-publisher: Cannot change the stickiness of a system publisher pkg -R /tmp/onu.4eaOv1 set-publisher --no-refresh --non-sticky openindiana.org failed: exit code 1
Such an attempt to set a system repository from within a zone is futile.
The script better check if the repository is non-system before attempting to set non-stickiness, and check if it perhaps already is non-sticky (thus not bother further), otherwise error out asking the administrator to set non-stickiness from global zone.