[csw-devel] SF.net SVN: gar:[13365] csw/mgar/gar/v2/lib/python/integrate_catalogs.py
wahwah at users.sourceforge.net
wahwah at users.sourceforge.net
Fri Feb 18 16:57:01 CET 2011
Revision: 13365
http://gar.svn.sourceforge.net/gar/?rev=13365&view=rev
Author: wahwah
Date: 2011-02-18 15:57:01 +0000 (Fri, 18 Feb 2011)
Log Message:
-----------
integrate-catalogs: Use shell functions
In order to make catalog integration reviews easier, create shell functions
and call them at the end of the file.
Modified Paths:
--------------
csw/mgar/gar/v2/lib/python/integrate_catalogs.py
Modified: csw/mgar/gar/v2/lib/python/integrate_catalogs.py
===================================================================
--- csw/mgar/gar/v2/lib/python/integrate_catalogs.py 2011-02-18 15:56:26 UTC (rev 13364)
+++ csw/mgar/gar/v2/lib/python/integrate_catalogs.py 2011-02-18 15:57:01 UTC (rev 13365)
@@ -33,29 +33,57 @@
#for catalogname in $sorted($diffs_by_catalogname):
#if "new_pkgs" in $diffs_by_catalogname[$catalogname]:
+function new_pkg_$catalogname {
#for arch, osrel, new_pkg in $diffs_by_catalogname[$catalogname]["new_pkgs"]:
-# adding $new_pkg["basename"]
-\${PKGDB} add-to-cat $osrel $arch $catrel_to $new_pkg["md5_sum"]
+ # adding $new_pkg["basename"]
+ \${PKGDB} add-to-cat $osrel $arch $catrel_to $new_pkg["md5_sum"]
#end for
+}
#end if
#if "removed_pkgs" in $diffs_by_catalogname[$catalogname]:
+function remove_pkg_$catalogname {
#for arch, osrel, rem_pkg in $diffs_by_catalogname[$catalogname]["removed_pkgs"]:
-# removing $rem_pkg["basename"]
-\${PKGDB} del-from-cat $osrel $arch $catrel_to $rem_pkg["md5_sum"]
+ # removing $rem_pkg["basename"]
+ \${PKGDB} del-from-cat $osrel $arch $catrel_to $rem_pkg["md5_sum"]
#end for
+}
#end if
#if "updated_pkgs" in $diffs_by_catalogname[$catalogname]:
+function #
+#if $diffs_by_catalogname[$catalogname]["updated_pkgs"][0][2]["direction"] == "downgrade":
+downgrade_#
+#else
+upgrade_#
+#end if
+$catalogname {
#for arch, osrel, up_pkg_pair in $diffs_by_catalogname[$catalogname]["updated_pkgs"]:
#if $up_pkg_pair["direction"] == "downgrade":
-# WARNING: DOWNGRADE
+ # WARNING: DOWNGRADE
#end if
-# $catalogname $up_pkg_pair["direction"] from $up_pkg_pair["from"]["version"] to $up_pkg_pair["to"]["version"]
-\${PKGDB} del-from-cat $osrel $arch $catrel_to $up_pkg_pair["from"]["md5_sum"]
-\${PKGDB} add-to-cat $osrel $arch $catrel_to $up_pkg_pair["to"]["md5_sum"]
+ # $catalogname $up_pkg_pair["direction"] from $up_pkg_pair["from"]["version"] to $up_pkg_pair["to"]["version"]
+ \${PKGDB} del-from-cat $osrel $arch $catrel_to $up_pkg_pair["from"]["md5_sum"]
+ \${PKGDB} add-to-cat $osrel $arch $catrel_to $up_pkg_pair["to"]["md5_sum"]
#end for
+}
#end if
#end for
+#for catalogname in $sorted($diffs_by_catalogname):
+#if "new_pkgs" in $diffs_by_catalogname[$catalogname]:
+new_pkg_$catalogname
+#end if
+#if "removed_pkgs" in $diffs_by_catalogname[$catalogname]:
+remove_pkg_$catalogname
+#end if
+#if "updated_pkgs" in $diffs_by_catalogname[$catalogname]:
+#if $diffs_by_catalogname[$catalogname]["updated_pkgs"][0][2]["direction"] == "downgrade":
+downgrade_#
+#else
+upgrade_#
+#end if
+$catalogname
+#end if
+#end for
"""
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