[csw-devel] SF.net SVN: gar:[13419] csw/mgar/gar/v2

dmichelsen at users.sourceforge.net dmichelsen at users.sourceforge.net
Sun Feb 20 20:17:33 CET 2011


Revision: 13419
          http://gar.svn.sourceforge.net/gar/?rev=13419&view=rev
Author:   dmichelsen
Date:     2011-02-20 19:17:33 +0000 (Sun, 20 Feb 2011)

Log Message:
-----------
mGAR v2: Add OBSOLETED_*

Modified Paths:
--------------
    csw/mgar/gar/v2/gar.mk
    csw/mgar/gar/v2/gar.pkg.mk

Modified: csw/mgar/gar/v2/gar.mk
===================================================================
--- csw/mgar/gar/v2/gar.mk	2011-02-20 15:48:06 UTC (rev 13418)
+++ csw/mgar/gar/v2/gar.mk	2011-02-20 19:17:33 UTC (rev 13419)
@@ -803,7 +803,7 @@
 
 
 # The basic merge merges the compiles for all ISAs on the current architecture
-merge: checksum pre-merge merge-do merge-license merge-classutils merge-checkpkgoverrides merge-alternatives $(if $(COMPILE_ELISP),compile-elisp) $(if $(NOSOURCEPACKAGE),,merge-src) merge-README.CSW $(if $(AP2_MODS),post-merge-ap2mod) post-merge
+merge: checksum pre-merge merge-do merge-license merge-classutils merge-checkpkgoverrides merge-alternatives $(if $(COMPILE_ELISP),compile-elisp) $(if $(NOSOURCEPACKAGE),,merge-src) merge-README.CSW merge-obsoleted-by $(if $(AP2_MODS),post-merge-ap2mod) post-merge
 	banner merge
 	@$(MAKECOOKIE)
 
@@ -887,7 +887,7 @@
 .PHONY: remerge reset-merge reset-merge-modulated
 remerge: reset-merge merge
 
-reset-merge: reset-package $(addprefix reset-merge-,$(MODULATIONS)) reset-merge-license reset-merge-classutils reset-merge-checkpkgoverrides reset-merge-alternatives reset-merge-README.CSW reset-merge-ap2mod reset-merge-src
+reset-merge: reset-package $(addprefix reset-merge-,$(MODULATIONS)) reset-merge-license reset-merge-classutils reset-merge-checkpkgoverrides reset-merge-alternatives reset-merge-README.CSW reset-merge-obsoleted-by reset-merge-ap2mod reset-merge-src
 	@rm -f $(COOKIEDIR)/pre-merge $(foreach M,$(MODULATIONS),$(COOKIEDIR)/merge-$M) $(COOKIEDIR)/merge $(COOKIEDIR)/post-merge
 	@rm -rf $(PKGROOT)
 

Modified: csw/mgar/gar/v2/gar.pkg.mk
===================================================================
--- csw/mgar/gar/v2/gar.pkg.mk	2011-02-20 15:48:06 UTC (rev 13418)
+++ csw/mgar/gar/v2/gar.pkg.mk	2011-02-20 19:17:33 UTC (rev 13419)
@@ -40,7 +40,8 @@
 CATALOGNAME    ?= $(if $(filter-out $(firstword $(PACKAGES)),$(PACKAGES)),,$(subst -,_,$(patsubst CSW%,%,$(PACKAGES))))
 SRCPACKAGE_BASE = $(firstword $(PACKAGES))
 SRCPACKAGE     ?= $(SRCPACKAGE_BASE)-src
-SPKG_SPECS     ?= $(sort $(basename $(filter %.gspec,$(DISTFILES))) $(PACKAGES) $(if $(NOSOURCEPACKAGE),,$(SRCPACKAGE)))
+OBSOLETED_PKGS ?= $(sort $(foreach P,$(PACKAGES),$(OBSOLETES_$P)))
+SPKG_SPECS     ?= $(sort $(basename $(filter %.gspec,$(DISTFILES))) $(PACKAGES) $(OBSOLETED_PKGS) $(if $(NOSOURCEPACKAGE),,$(SRCPACKAGE)))
 endif
 
 # Automatic definitions for source package
@@ -54,6 +55,21 @@
 RUNTIME_DEP_PKGS_$(SRCPACKAGE) ?= $(or $(GARPKG_$(GARSYSTEMVERSION)),$(error GAR version $(GARSYSTEMVERSION) unknown))
 CATALOG_RELEASE ?= current
 
+define obsoleted_pkg
+CATALOGNAME_$(1) = $(call catalogname,$(1))
+SPKG_DESC_$(1) = Transitional package as contents moved to $(foreach P,$(PACKAGES),$(if $(filter $(1),$(OBSOLETES_$P)),$P))
+RUNTIME_DEP_PKGS_$(1) = $(foreach P,$(PACKAGES),$(if $(filter $(1),$(OBSOLETES_$P)),$P))
+PKGFILES_$(1) = NOFILES
+ARCHALL_$(1) = 1
+$(foreach P,$(PACKAGES),$(if $(filter $(1),$(OBSOLETES_$P)),
+  CHECKPKG_OVERRIDES_$(1) += surplus-dependency|$P
+))
+endef
+
+$(warning O: $(OBSOLETED_PKGS))
+
+$(foreach P,$(OBSOLETED_PKGS),$(eval $(call obsoleted_pkg,$P)))
+
 _PKG_SPECS      = $(filter-out $(NOPACKAGE),$(SPKG_SPECS))
 
 # The is the name of the package containing the sourcefiles for all packages generated from this GAR recipe.
@@ -111,7 +127,7 @@
     $(CATALOGNAME_$(1)),
     $(if $(CATALOGNAME),
       $(CATALOGNAME),
-      $(if $(filter $(1),$(PACKAGES)),
+      $(if $(filter $(1),$(PACKAGES) $(OBSOLETED_PKGS)),
         $(subst -,_,$(patsubst CSW%,%,$(1))),
         $(if $(realpath files/$(1).gspec),
           $(shell perl -F'\s+' -ane 'print "$$F[2]" if( $$F[0] eq "%var" && $$F[1] eq "bitname")' files/$(1).gspec),
@@ -394,6 +410,10 @@
   | ( cat; if test -f "$(WORKDIR_GLOBAL)/$(1).cswreleasenotes";then echo "i cswreleasenotes=$(1).cswreleasenotes"; fi)
 endef
 
+define obsoleted_filter
+  | ( cat; if test -f "$(WORKDIR_GLOBAL)/$(1).obsoleted-by";then echo "i obsoleted-by=$(1).obsoleted-by"; fi)
+endef
+
 # This file contains all installed pathes. This can be used as a starting point
 # for distributing files to individual packages.
 PROTOTYPE = $(WORKDIR)/prototype
@@ -444,9 +464,9 @@
 	               ) \
 	              <$(PROTOTYPE); \
 	   if [ -n "$(EXTRA_PKGFILES_$*)" ]; then echo "$(EXTRA_PKGFILES_$*)"; fi \
-	  ) $(call checkpkg_override_filter,$*) $(call cswreleasenotes_filter,$*) $(_CSWCLASS_FILTER) $(_CATEGORY_FILTER) $(_PROTOTYPE_MODIFIERS) $(_PROTOTYPE_FILTER_$*) >$@; \
+	  ) $(call checkpkg_override_filter,$*) $(call cswreleasenotes_filter,$*) $(call obsoleted_filter,$*) $(_CSWCLASS_FILTER) $(_CATEGORY_FILTER) $(_PROTOTYPE_MODIFIERS) $(_PROTOTYPE_FILTER_$*) >$@; \
 	else \
-	  cat $(PROTOTYPE) $(call checkpkg_override_filter,$*) $(call cswreleasenotes_filter,$*) $(_CSWCLASS_FILTER) $(_CATEGORY_FILTER) $(_PROTOTYPE_MODIFIERS) $(_PROTOTYPE_FILTER_$*) >$@; \
+	  cat $(PROTOTYPE) $(call checkpkg_override_filter,$*) $(call cswreleasenotes_filter,$*) $(call obsoleted_filter,$*) $(_CSWCLASS_FILTER) $(_CATEGORY_FILTER) $(_PROTOTYPE_MODIFIERS) $(_PROTOTYPE_FILTER_$*) >$@; \
 	fi
 	$(if $(ALLOW_RELOCATE),$(call dontrelocate,opt,$(PROTOTYPE)))
 
@@ -665,6 +685,19 @@
 reset-merge-README.CSW:
 	$(_DBG)rm -f $(COOKIEDIR)/merge-README.CSW $(foreach SPEC,$(_PKG_SPECS),$(PKGROOT)$(docdir)/$(call catalogname,$(SPEC))/README.CSW)
 
+merge-obsoleted-by: $(WORKDIR_GLOBAL)
+	$(_DBG)$(foreach P,$(OBSOLETED_PKGS),$(foreach Q,$(PACKAGES),$(if $(filter $P,$(OBSOLETES_$Q)), \
+		$(if $(SPKG_DESC_$Q), \
+			echo "$Q $(call catalogname,$Q) - $(SPKG_DESC_$Q)" >> $(WORKDIR_GLOBAL)/$P.obsoleted-by;, \
+			echo "$(shell (/usr/bin/pkginfo $Q || echo "$Q - ") | $(GAWK) '{ $$1 = "P"; print } ')" $(WORKDIR_GLOBAL)/$P.obsoleted-by; \
+		) \
+	)))
+	@$(MAKECOOKIE)
+
+.PHONY: reset-merge-obsoleted-by
+reset-merge-obsoleted-by:
+	$(_DBG)rm -f $(COOKIEDIR)/merge-obsoleted-by $(WORKDIR_GLOBAL)/obsoleted-by.*
+
 merge-classutils: merge-migrateconf merge-usergroup merge-inetdconf merge-etcservices
 
 reset-merge-classutils: reset-merge-migrateconf reset-merge-usergroup reset-merge-inetdconf reset-merge-etcservices


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list