isaexec and Tcl/Tk

Oliver Kiddle opk at opencsw.org
Tue Feb 18 14:26:53 CET 2014


> 
> Yes, exactly. Same for alternatives —select tclsh /opt/csw/bin/sparcv8plus/tclsh
> The current implementation is a NFS-shared-/opt/csw-friendly reimplementation
> in ksh of the redhat alternatives, but lacking the slave-group syntax. Maybe
> you as shell-superguru can quickly fix it?

It actually seems that alternatives does support the slave syntax.
What it isn't coping with is more than one conflicting alternative
being provided by a single package. In the set_manual_prio function,
it links the selected file in /opt/csw/share/alternatives to
/etc/opt/csw/alternatives. This serves as it's "database" of how things
are selected. According the comment in the source it "uses a symlink, so
that way, the manual set does not take effect if the package has been
removed.. but it is remembered if the package is coming right back". The
trouble is that after selecting an alternative, it is linking to the
file containing both alternatives.

The file in /opt/csw/share/alternatives is named by calling $(call
catalogname, $*) in the GAR makefiles. So both the 32-bit and 64-bit
settings are in a file named tcl there. I think we instead need to
support putting them in a different file from GAR. Something like the
following; this uses different files if more than one ALTERNATIVE is
listed. It might be better to use an explicit variable of some sort.
What do you think?

Oliver

  @echo "[ Generating alternatives for package $* ]"
ifeq ($(word 2,$($(or $(ALTERNATIVES_$*),$(ALTERNATIVES)))),)
  
  $(foreach A,$(or $(ALTERNATIVES_$*),$(ALTERNATIVES)), \
  $(if $(ALTERNATIVE_$A), \
    echo "$(ALTERNATIVE_$A)" > $(PKGROOT)/opt/csw/share/alternatives/$(call catalogname,$*)-$A;, \
    $(error The variable 'ALTERNATIVE_$A' is empty, but must contain an alternative)))
else
  ($(if $(ALTERNATIVE),echo "$(ALTERNATIVE)";) \
    $(foreach A,$(or $(ALTERNATIVES_$*),$(ALTERNATIVES)), \
    $(if $(ALTERNATIVE_$A), \
      echo "$(ALTERNATIVE_$A)";, \
      $(error The variable 'ALTERNATIVE_$A' is empty, but must contain an alternative) \
    ))) > $(PKGROOT)/opt/csw/share/alternatives/$(call catalogname,$*)
endif
  @$(MAKECOOKIE)


More information about the maintainers mailing list