4592 Need to deliver script that generates the GUI Package Manager package classifications.
--- a/src/gui/data/opensolaris.org Fri Nov 07 07:35:50 2008 -0800
+++ b/src/gui/data/opensolaris.org Fri Nov 07 07:39:37 2008 -0800
@@ -437,7 +437,7 @@
category = Source Code Management
[SUNWcxwsvr]
-category = X11
+category = X11 (System)
[SUNWdbus]
category = Libraries (System)
@@ -536,7 +536,7 @@
category = Plug-ins and Run-times
[SUNWdexwsvr]
-category = X11
+category = X11 (System)
[SUNWdfb]
category = Display
@@ -614,7 +614,7 @@
category = Core
[SUNWesxwsvr]
-category = X11
+category = X11 (System)
[SUNWevolution]
category = Internet
@@ -740,7 +740,7 @@
category = Localizations (System)
[SUNWfrxwsvr]
-category = X11
+category = X11 (System)
[SUNWfsexam]
category = System Utilities
@@ -1193,7 +1193,7 @@
category = Python
[SUNWgnome-remote-desktop]
-category = X11
+category = X11 (System)
[SUNWgnome-screenshot]
category = Graphics and Imaging
@@ -1379,7 +1379,7 @@
category = Other Peripherals
[SUNWhkxwsvr]
-category = X11
+category = X11 (System)
[SUNWhos]
category = Localizations (System)
@@ -1394,7 +1394,7 @@
category = Networking
[SUNWhxwsvr]
-category = X11
+category = X11 (System)
[SUNWib]
category = Hardware
@@ -1568,7 +1568,7 @@
category = Localizations (System)
[SUNWitxwsvr]
-category = X11
+category = X11 (System)
[SUNWiwh]
category = Networking
@@ -1643,7 +1643,7 @@
category = Services
[SUNWjxwsvr]
-category = X11
+category = X11 (System)
[SUNWkdc]
category = Security
@@ -1664,7 +1664,7 @@
category = Core
[SUNWkxwsvr]
-category = X11
+category = X11 (System)
[SUNWlang-ar]
category = Localizations (System)
@@ -2192,7 +2192,7 @@
category = Storage
[SUNWmeld]
-category = System U
+category = System Utilities
[SUNWmemcached]
category = Application and Web Servers
@@ -2279,19 +2279,19 @@
category = Localizations (System)
[SUNWmysql]
-category = Databases
+category = Databases (System)
[SUNWmysql-base]
-category = Databases
+category = Databases (System)
[SUNWmysql-python]
category = Databases
[SUNWmysql5]
-category = Databases
+category = Databases (System)
[SUNWmysql5jdbc]
-category = Databases
+category = Databases (System)
[SUNWmysql5test]
category = Databases
@@ -2465,7 +2465,7 @@
category = Perl
[SUNWpgadmin3]
-category = Databases
+category = Databases (System)
[SUNWpgbouncer-pg83]
category = Administration and Configuration
@@ -2534,7 +2534,7 @@
category = System Utilities
[SUNWplxwsvr]
-category = X11
+category = X11 (System)
[SUNWpm]
category = Administration and Configuration
@@ -2558,25 +2558,25 @@
category = Core
[SUNWpostgr]
-category = Databases
+category = Databases (System)
[SUNWpostgr-82-client]
-category = Databases
+category = Databases (System)
[SUNWpostgr-82-contrib]
-category = Databases
+category = Databases (System)
[SUNWpostgr-82-devel]
category = Databases
[SUNWpostgr-82-docs]
-category = Databases
+category = Databases (System)
[SUNWpostgr-82-jdbc]
-category = Databases
+category = Databases (System)
[SUNWpostgr-82-l10n-ja]
-category = Databases
+category = Databases (System)
[SUNWpostgr-82-libs]
category = Databases
@@ -2585,25 +2585,25 @@
category = Databases
[SUNWpostgr-82-server]
-category = Databases
+category = Databases (System)
[SUNWpostgr-82-server-data-root]
-category = Databases
+category = Databases (System)
[SUNWpostgr-82-tcl]
-category = Databases
+category = Databases (System)
[SUNWpostgr-83-client]
-category = Databases
+category = Databases (System)
[SUNWpostgr-83-contrib]
-category = Databases
+category = Databases (System)
[SUNWpostgr-83-devel]
category = Databases
[SUNWpostgr-83-docs]
-category = Databases
+category = Databases (System)
[SUNWpostgr-83-libs]
category = Databases
@@ -2612,40 +2612,40 @@
category = Databases
[SUNWpostgr-83-server]
-category = Databases
+category = Databases (System)
[SUNWpostgr-83-tcl]
category = Databases
[SUNWpostgr-contrib]
-category = Databases
+category = Databases (System)
[SUNWpostgr-docs]
-category = Databases
+category = Databases (System)
[SUNWpostgr-jdbc]
-category = Databases
+category = Databases (System)
[SUNWpostgr-l10n-ja]
-category = Databases
+category = Databases (System)
[SUNWpostgr-libs]
-category = Databases
+category = Databases (System)
[SUNWpostgr-pl]
category = Databases
[SUNWpostgr-server]
-category = Databases
+category = Databases (System)
[SUNWpostgr-server-data]
-category = Databases
+category = Databases (System)
[SUNWpostgr-tcl]
category = Databases
[SUNWpostgr-upgrade]
-category = Databases
+category = Databases (System)
[SUNWpostrun]
category = System Utilities
@@ -2711,7 +2711,7 @@
category = Printing
[SUNWptxwsvr]
-category = X11
+category = X11 (System)
[SUNWpycups]
category = Printing
@@ -2834,7 +2834,7 @@
category = Ruby
[SUNWruxwsvr]
-category = X11
+category = X11 (System)
[SUNWsacom]
category = Enterprise Management
@@ -3029,10 +3029,10 @@
category = Storage
[SUNWsqlite3]
-category = Databases
+category = Databases (System)
[SUNWsqlite3docs]
-category = Databases
+category = Databases (System)
[SUNWsqlite3tcl]
category = Databases
@@ -3083,7 +3083,7 @@
category = Localizations (System)
[SUNWsvxwsvr]
-category = X11
+category = X11 (System)
[SUNWswig]
category = Other Languages
@@ -3128,58 +3128,58 @@
category = System Utilities
[SUNWtgnome-l10n-ui-de]
-category = Trusted
+category = Trusted Extensions
[SUNWtgnome-l10n-ui-es]
-category = Trusted
+category = Trusted Extensions
[SUNWtgnome-l10n-ui-fr]
-category = Trusted
+category = Trusted Extensions
[SUNWtgnome-l10n-ui-it]
-category = Trusted
+category = Trusted Extensions
[SUNWtgnome-l10n-ui-ja]
-category = Trusted
+category = Trusted Extensions
[SUNWtgnome-l10n-ui-ko]
-category = Trusted
+category = Trusted Extensions
[SUNWtgnome-l10n-ui-ptBR]
-category = Trusted
+category = Trusted Extensions
[SUNWtgnome-l10n-ui-ru]
-category = Trusted
+category = Trusted Extensions
[SUNWtgnome-l10n-ui-sv]
-category = Trusted
+category = Trusted Extensions
[SUNWtgnome-l10n-ui-zhCN]
-category = Trusted
+category = Trusted Extensions
[SUNWtgnome-l10n-ui-zhHK]
-category = Trusted
+category = Trusted Extensions
[SUNWtgnome-l10n-ui-zhTW]
-category = Trusted
+category = Trusted Extensions
[SUNWtgnome-tsol-libs]
-category = Trusted
+category = Trusted Extensions
[SUNWtgnome-tsoljdsdevmgr]
-category = Trusted
+category = Trusted Extensions
[SUNWtgnome-tsoljdslabel]
-category = Trusted
+category = Trusted Extensions
[SUNWtgnome-tsoljdsselmgr]
-category = Trusted
+category = Trusted Extensions
[SUNWtgnome-tstripe]
-category = Trusted
+category = Trusted Extensions
[SUNWtgnome-xagent]
-category = Trusted
+category = Trusted Extensions
[SUNWthunderbird]
category = Internet
@@ -3434,7 +3434,7 @@
category = System Utilities
[SUNWxcursor-themes]
-category = X11
+category = X11 (System)
[SUNWxdg-sound-theme]
category = Libraries
@@ -3455,25 +3455,25 @@
category = Networking
[SUNWxorg-cfg]
-category = X11
+category = X11 (System)
[SUNWxorg-client-docs]
category = X11
[SUNWxorg-client-programs]
-category = X11
+category = X11 (System)
[SUNWxorg-clientlibs]
category = X11
[SUNWxorg-compatlinks]
-category = X11
+category = X11 (System)
[SUNWxorg-devel-docs]
category = X11
[SUNWxorg-doc]
-category = X11
+category = X11 (System)
[SUNWxorg-graphics-ddx]
category = Display
@@ -3482,31 +3482,31 @@
category = X11
[SUNWxorg-mesa]
-category = X11
+category = X11 (System)
[SUNWxorg-server]
-category = X11
+category = X11 (System)
[SUNWxorg-tsol-module]
category = Trusted
[SUNWxorg-xkb]
-category = X11
+category = X11 (System)
[SUNWxprint-server]
-category = X11
+category = X11 (System)
[SUNWxsane]
category = System Utilities
[SUNWxscreensaver-hacks]
-category = X11
+category = X11 (System)
[SUNWxscreensaver-hacks-gl]
-category = X11
+category = X11 (System)
[SUNWxsvc]
-category = X11
+category = X11 (System)
[SUNWxvm]
category = Virtualization
@@ -3521,58 +3521,58 @@
category = Virtualization
[SUNWxvnc]
-category = X11
+category = X11 (System)
[SUNWxwacx]
-category = X11
+category = X11 (System)
[SUNWxwdem]
-category = X11
+category = X11 (System)
[SUNWxwdv]
-category = X11
+category = X11 (System)
[SUNWxwfsw]
-category = X11
+category = X11 (System)
[SUNWxwice]
-category = X11
+category = X11 (System)
[SUNWxwinc]
category = X11
[SUNWxwman]
-category = X11
+category = X11 (System)
[SUNWxwmod]
-category = X11
+category = X11 (System)
[SUNWxwopt]
-category = X11
+category = X11 (System)
[SUNWxwpft]
-category = X11
+category = X11 (System)
[SUNWxwplr]
-category = X11
+category = X11 (System)
[SUNWxwplt]
-category = X11
+category = X11 (System)
[SUNWxwpmn]
category = X11
[SUNWxwrtl]
-category = X11
+category = X11 (System)
[SUNWxwslb]
category = X11
[SUNWxwsvr]
-category = X11
+category = X11 (System)
[SUNWxwxft]
-category = X11
+category = X11 (System)
[SUNWyp]
category = Administration and Configuration
--- a/src/gui/data/opensolaris.org.sections Fri Nov 07 07:35:50 2008 -0800
+++ b/src/gui/data/opensolaris.org.sections Fri Nov 07 07:39:37 2008 -0800
@@ -2,23 +2,23 @@
category = Builds,Releases,Developer Tools,AMP Stack,Office Tools
[Applications]
-category = Accessories,Configuration and Preferences,Education,Games,Graphics and Imaging,Internet,Office,Applets,Plug-ins and Run-times,Science,Sound and Video,System Utilities,Universal Access
+category = Accessories,Applets,Configuration and Preferences,Games,Graphics and Imaging,Internet,Office,Plug-ins and Run-times,Sound and Video,System Utilities,Universal Access
[Desktop (GNOME)]
category = Documentation,File Managers,Libraries,Localizations (Desktop),Scripts,Sessions,Trusted Extensions,Window Managers
[Development]
-category = Integrated Development Environments,Source Code Management,Distribution Tools,C,C++,Databases,GNOME and GTK+,GNU,Java,Other Languages,Perl,PHP,Python,Ruby,System,X11
+category = C,C++,Databases,Distribution Tools,GNOME and GTK+,GNU,Integrated Development Environments,Java,Other Languages,PHP,Perl,Python,Ruby,Source Code Management,System,X11
[Distributions]
-category = Desktop,Server
+category = Desktop
[Drivers]
-category = Display,Input devices,Networking,Ports,Media,Storage,Other Peripherals
+category = Display,Media,Networking,Other Peripherals,Ports,Storage
[System]
-category = Administration and Configuration,Cluster,Core,Databases (System),Enterprise Management,File System,Fonts,Hardware,High Performance Computing,Internationalization,Libraries (System),Localizations (System),Media,Packaging,Printing,Security,Services,Shells,Software Management,Text Tools,Trusted,X11 (System),Virtualization
+category = Administration and Configuration,Core,Databases (System),Enterprise Management,File System,Fonts,Hardware,High Performance Computing,Internationalization,Libraries (System),Localizations (System),Media,Packaging,Printing,Security,Services,Shells,Software Management,Text Tools,Trusted,Virtualization,X11 (System)
[Web Services]
-category = Application and Web Servers,Business Applications,Identity,Portals,SOA,Social Applications
+category = Application and Web Servers
--- a/src/util/distro-import/00/common/loc/SUNWtgnome-l10n-ui-de Fri Nov 07 07:35:50 2008 -0800
+++ b/src/util/distro-import/00/common/loc/SUNWtgnome-l10n-ui-de Fri Nov 07 07:39:37 2008 -0800
@@ -1,4 +1,4 @@
package SUNWtgnome-l10n-ui-de
-classification "Desktop (GNOME)/Trusted"
+classification "Desktop (GNOME)/Trusted Extensions"
import SUNWtgnome-l10n-ui-de
end package
--- a/src/util/distro-import/00/common/loc/SUNWtgnome-l10n-ui-es Fri Nov 07 07:35:50 2008 -0800
+++ b/src/util/distro-import/00/common/loc/SUNWtgnome-l10n-ui-es Fri Nov 07 07:39:37 2008 -0800
@@ -1,4 +1,4 @@
package SUNWtgnome-l10n-ui-es
-classification "Desktop (GNOME)/Trusted"
+classification "Desktop (GNOME)/Trusted Extensions"
import SUNWtgnome-l10n-ui-es
end package
--- a/src/util/distro-import/00/common/loc/SUNWtgnome-l10n-ui-fr Fri Nov 07 07:35:50 2008 -0800
+++ b/src/util/distro-import/00/common/loc/SUNWtgnome-l10n-ui-fr Fri Nov 07 07:39:37 2008 -0800
@@ -1,4 +1,4 @@
package SUNWtgnome-l10n-ui-fr
-classification "Desktop (GNOME)/Trusted"
+classification "Desktop (GNOME)/Trusted Extensions"
import SUNWtgnome-l10n-ui-fr
end package
--- a/src/util/distro-import/00/common/loc/SUNWtgnome-l10n-ui-it Fri Nov 07 07:35:50 2008 -0800
+++ b/src/util/distro-import/00/common/loc/SUNWtgnome-l10n-ui-it Fri Nov 07 07:39:37 2008 -0800
@@ -1,4 +1,4 @@
package SUNWtgnome-l10n-ui-it
-classification "Desktop (GNOME)/Trusted"
+classification "Desktop (GNOME)/Trusted Extensions"
import SUNWtgnome-l10n-ui-it
end package
--- a/src/util/distro-import/00/common/loc/SUNWtgnome-l10n-ui-ja Fri Nov 07 07:35:50 2008 -0800
+++ b/src/util/distro-import/00/common/loc/SUNWtgnome-l10n-ui-ja Fri Nov 07 07:39:37 2008 -0800
@@ -1,4 +1,4 @@
package SUNWtgnome-l10n-ui-ja
-classification "Desktop (GNOME)/Trusted"
+classification "Desktop (GNOME)/Trusted Extensions"
import SUNWtgnome-l10n-ui-ja
end package
--- a/src/util/distro-import/00/common/loc/SUNWtgnome-l10n-ui-ko Fri Nov 07 07:35:50 2008 -0800
+++ b/src/util/distro-import/00/common/loc/SUNWtgnome-l10n-ui-ko Fri Nov 07 07:39:37 2008 -0800
@@ -1,4 +1,4 @@
package SUNWtgnome-l10n-ui-ko
-classification "Desktop (GNOME)/Trusted"
+classification "Desktop (GNOME)/Trusted Extensions"
import SUNWtgnome-l10n-ui-ko
end package
--- a/src/util/distro-import/00/common/loc/SUNWtgnome-l10n-ui-ptBR Fri Nov 07 07:35:50 2008 -0800
+++ b/src/util/distro-import/00/common/loc/SUNWtgnome-l10n-ui-ptBR Fri Nov 07 07:39:37 2008 -0800
@@ -1,4 +1,4 @@
package SUNWtgnome-l10n-ui-ptBR
-classification "Desktop (GNOME)/Trusted"
+classification "Desktop (GNOME)/Trusted Extensions"
import SUNWtgnome-l10n-ui-ptBR
end package
--- a/src/util/distro-import/00/common/loc/SUNWtgnome-l10n-ui-ru Fri Nov 07 07:35:50 2008 -0800
+++ b/src/util/distro-import/00/common/loc/SUNWtgnome-l10n-ui-ru Fri Nov 07 07:39:37 2008 -0800
@@ -1,4 +1,4 @@
package SUNWtgnome-l10n-ui-ru
-classification "Desktop (GNOME)/Trusted"
+classification "Desktop (GNOME)/Trusted Extensions"
import SUNWtgnome-l10n-ui-ru
end package
--- a/src/util/distro-import/00/common/loc/SUNWtgnome-l10n-ui-sv Fri Nov 07 07:35:50 2008 -0800
+++ b/src/util/distro-import/00/common/loc/SUNWtgnome-l10n-ui-sv Fri Nov 07 07:39:37 2008 -0800
@@ -1,4 +1,4 @@
package SUNWtgnome-l10n-ui-sv
-classification "Desktop (GNOME)/Trusted"
+classification "Desktop (GNOME)/Trusted Extensions"
import SUNWtgnome-l10n-ui-sv
end package
--- a/src/util/distro-import/00/common/loc/SUNWtgnome-l10n-ui-zhCN Fri Nov 07 07:35:50 2008 -0800
+++ b/src/util/distro-import/00/common/loc/SUNWtgnome-l10n-ui-zhCN Fri Nov 07 07:39:37 2008 -0800
@@ -1,4 +1,4 @@
package SUNWtgnome-l10n-ui-zhCN
-classification "Desktop (GNOME)/Trusted"
+classification "Desktop (GNOME)/Trusted Extensions"
import SUNWtgnome-l10n-ui-zhCN
end package
--- a/src/util/distro-import/00/common/loc/SUNWtgnome-l10n-ui-zhHK Fri Nov 07 07:35:50 2008 -0800
+++ b/src/util/distro-import/00/common/loc/SUNWtgnome-l10n-ui-zhHK Fri Nov 07 07:39:37 2008 -0800
@@ -1,4 +1,4 @@
package SUNWtgnome-l10n-ui-zhHK
-classification "Desktop (GNOME)/Trusted"
+classification "Desktop (GNOME)/Trusted Extensions"
import SUNWtgnome-l10n-ui-zhHK
end package
--- a/src/util/distro-import/00/common/loc/SUNWtgnome-l10n-ui-zhTW Fri Nov 07 07:35:50 2008 -0800
+++ b/src/util/distro-import/00/common/loc/SUNWtgnome-l10n-ui-zhTW Fri Nov 07 07:39:37 2008 -0800
@@ -1,4 +1,4 @@
package SUNWtgnome-l10n-ui-zhTW
-classification "Desktop (GNOME)/Trusted"
+classification "Desktop (GNOME)/Trusted Extensions"
import SUNWtgnome-l10n-ui-zhTW
end package
--- a/src/util/distro-import/75a/common/SUNWtgnome-tsol-libs Fri Nov 07 07:35:50 2008 -0800
+++ b/src/util/distro-import/75a/common/SUNWtgnome-tsol-libs Fri Nov 07 07:39:37 2008 -0800
@@ -1,5 +1,5 @@
package SUNWtgnome-tsol-libs
-classification "Desktop (GNOME)/Trusted"
+classification "Desktop (GNOME)/Trusted Extensions"
import SUNWtgnome-tsol-libs
import SUNWtgnome-tsol-libs-devel
end package
--- a/src/util/distro-import/75a/common/SUNWtgnome-tsoljdsdevmgr Fri Nov 07 07:35:50 2008 -0800
+++ b/src/util/distro-import/75a/common/SUNWtgnome-tsoljdsdevmgr Fri Nov 07 07:39:37 2008 -0800
@@ -1,4 +1,4 @@
package SUNWtgnome-tsoljdsdevmgr
-classification "Desktop (GNOME)/Trusted"
+classification "Desktop (GNOME)/Trusted Extensions"
import SUNWtgnome-tsoljdsdevmgr
end package
--- a/src/util/distro-import/75a/common/SUNWtgnome-tsoljdslabel Fri Nov 07 07:35:50 2008 -0800
+++ b/src/util/distro-import/75a/common/SUNWtgnome-tsoljdslabel Fri Nov 07 07:39:37 2008 -0800
@@ -1,4 +1,4 @@
package SUNWtgnome-tsoljdslabel
-classification "Desktop (GNOME)/Trusted"
+classification "Desktop (GNOME)/Trusted Extensions"
import SUNWtgnome-tsoljdslabel
end package
--- a/src/util/distro-import/75a/common/SUNWtgnome-tsoljdsselmgr Fri Nov 07 07:35:50 2008 -0800
+++ b/src/util/distro-import/75a/common/SUNWtgnome-tsoljdsselmgr Fri Nov 07 07:39:37 2008 -0800
@@ -1,4 +1,4 @@
package SUNWtgnome-tsoljdsselmgr
-classification "Desktop (GNOME)/Trusted"
+classification "Desktop (GNOME)/Trusted Extensions"
import SUNWtgnome-tsoljdsselmgr
end package
--- a/src/util/distro-import/75a/common/SUNWtgnome-tstripe Fri Nov 07 07:35:50 2008 -0800
+++ b/src/util/distro-import/75a/common/SUNWtgnome-tstripe Fri Nov 07 07:39:37 2008 -0800
@@ -1,4 +1,4 @@
package SUNWtgnome-tstripe
-classification "Desktop (GNOME)/Trusted"
+classification "Desktop (GNOME)/Trusted Extensions"
import SUNWtgnome-tstripe
end package
--- a/src/util/distro-import/75a/common/SUNWtgnome-xagent Fri Nov 07 07:35:50 2008 -0800
+++ b/src/util/distro-import/75a/common/SUNWtgnome-xagent Fri Nov 07 07:39:37 2008 -0800
@@ -1,4 +1,4 @@
package SUNWtgnome-xagent
-classification "Desktop (GNOME)/Trusted"
+classification "Desktop (GNOME)/Trusted Extensions"
import SUNWtgnome-xagent
end package
--- a/src/util/distro-import/99/common/SUNWmeld Fri Nov 07 07:35:50 2008 -0800
+++ b/src/util/distro-import/99/common/SUNWmeld Fri Nov 07 07:39:37 2008 -0800
@@ -1,5 +1,5 @@
package SUNWmeld
-classification "Applications/System U"
+classification "Applications/System Utilities"
import SUNWmeld
version 1.1.5.1
end package
--- a/src/util/distro-import/Makefile Fri Nov 07 07:35:50 2008 -0800
+++ b/src/util/distro-import/Makefile Fri Nov 07 07:39:37 2008 -0800
@@ -424,6 +424,13 @@
$(MAKE) $(BUILDID)/$(UNBUNDLED_CLUSTERS)
+#
+# Used to generate the GUI Package Manager classification files from the
+# current package classifications.
+#
+guiclassification:
+ ./gen_os_files.py
+
%/SUNWipkg %/backpublish:
$(MAKE) BUILDID=$(@D) $(@F)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/util/distro-import/gen_os_files.py Fri Nov 07 07:39:37 2008 -0800
@@ -0,0 +1,348 @@
+#!/usr/bin/python2.4
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+# gen_os_files.py - create GUI package classification files.
+#
+
+import gettext
+import getopt
+import os
+import sys
+
+# Alias gettext.gettext to _
+_ = gettext.gettext
+
+class GenOSFiles:
+ """Simple script to create the the two files ("opensolaris.org" and
+ "opensolaris.org.sections") used by the GUI Package Manager, from
+ the existing package classification lines.
+
+ See bug #4483 for more details.
+
+ Usage:
+ $ cd .../gate/src/util/distro-import
+ $ python gen_os_file.py
+
+ By default, it will automatically overwrite:
+ ../../gui/data/opensolaris.org and
+ ../../gui/data/opensolaris.org.sections
+ in the pkg source workspace.
+
+ It is expected that this will be run (typically using the
+ "make guiclassification" target in the Makefile), as part of the
+ preparation for turning a new WOS build into a new OpenSolaris
+ development release. In other words, the new versions of
+ "opensolaris.org" and "opensolaris.org.sections" will be checked
+ in as part of that update.
+ """
+
+ def __init__(self):
+ """Creates a new instance of the GenOSFiles class.
+ """
+
+ self.prefix = "." # Directory prefix for finding files.
+
+ self.debug = False # Whether to output debug messages to stderr.
+
+ # Name of the file containing package categories.
+ #
+ self.os_cat_name = "../../gui/data/opensolaris.org.sections"
+
+ # Name of the file containing package subcategories.
+ #
+ self.os_subcat_name = "../../gui/data/opensolaris.org"
+
+ # Dictionary of packages found.
+ #
+ self.packages = {}
+
+ # Number of different packages found.
+ #
+ self.package_count = 0
+
+ def do_classification(self, pathname, line):
+ """Extract category and subcategory values. Add package
+ classification info to the dictionary of packages. If any
+ entry already exists, replace it, if this info is for a newer
+ build number.
+ """
+
+ tokens = line.split(None, 1)[1].strip('"').split("/")
+ if len(tokens) != 2:
+ message = "**** Malformed classification line: %s:\n" % line
+ sys.stderr.write(message)
+ return
+
+ category = tokens[0]
+ sub_category = tokens[1]
+ if self.debug:
+ sys.stderr.write("category: %s\n" % category)
+ sys.stderr.write("sub_category: %s\n" % sub_category)
+
+ # The following adjustments are made because the GUI Package
+ # Manager code is currently unable to handle sub-categories
+ # with the same name in different categories:
+ #
+ # Desktop (GNOME)/Localizations
+ # -> Desktop (GNOME)/Localizations (Desktop)
+ # System/Databases -> System/Databases (System)
+ # System/Libraries -> System/Libraries (System)
+ # System/Localizations -> System/Localizations (System)
+ # System/X11 -> System/X11 (System)
+ #
+ if self.package_name:
+ old_sub_category = sub_category
+
+ if category == "Desktop (GNOME)" and \
+ sub_category == "Localizations":
+ sub_category = "Localizations (Desktop)"
+
+ elif category == "System" and sub_category == "Databases":
+ sub_category = "Databases (System)"
+
+ elif category == "System" and sub_category == "Libraries":
+ sub_category = "Libraries (System)"
+
+ elif category == "System" and sub_category == "Localizations":
+ sub_category = "Localizations (System)"
+
+ elif category == "System" and sub_category == "X11":
+ sub_category = "X11 (System)"
+
+ if self.debug:
+ if old_sub_category != sub_category:
+ sys.stderr.write("CHANGED: sub_category: %s\n" %
+ sub_category)
+
+ if len(sub_category) == 0:
+ message = "**** Package %s: empty sub-category\n" % \
+ self.package_name
+ sys.stderr.write(message)
+ return
+
+ tokens = pathname[len(self.prefix):-1].split("/")
+ if self.debug:
+ sys.stderr.write("tokens[0]: %s\n" % tokens[0])
+
+ try:
+ new_build_no = int(tokens[0])
+ except ValueError:
+ try:
+ new_build_no = int(tokens[0][:-1])
+ except ValueError:
+ new_build_no = 0 # For unbundleds files.
+
+ # If we already have a dictionary entry for this
+ # package, check to see if this one is for a newer
+ # build.
+ #
+ if self.package_name in self.packages:
+ build_no, old_category, old_sub_category = \
+ self.packages[self.package_name]
+
+ if self.debug:
+ sys.stderr.write("*** EXISTS: %s\n" %
+ self.package_name)
+ sys.stderr.write("OLD: %d NEW: %d\n" %
+ (build_no, new_build_no))
+
+ if new_build_no > build_no:
+ if self.debug:
+ sys.stderr.write("NEW: %s (%d) %s\n" %
+ (self.package_name, new_build_no, sub_category))
+
+ self.packages[self.package_name] = \
+ [new_build_no, category, sub_category]
+
+ else:
+ self.packages[self.package_name] = \
+ [new_build_no, category, sub_category]
+ self.package_count += 1
+
+ else:
+ message = \
+ "**** Classification (%s) with no package name in %s" % \
+ (line[:-1], pathname)
+ sys.stderr.write(message)
+
+ self.package_name = None
+
+ def extract_info(self, pathname):
+ """Extract information that we are interested in. This will be the
+ package name from "package" lines and category/sub-category from
+ "classification" lines.
+ """
+
+ fin = open(pathname, 'r')
+ lines = fin.readlines()
+ fin.close()
+
+ if self.debug:
+ sys.stderr.write("Pathname: %s\n" % pathname)
+
+ self.package_name = None
+ for line in lines:
+ if line.startswith("package"):
+ tokens = line.split()
+ try:
+ self.package_name = tokens[1]
+ if self.debug:
+ sys.stderr.write("Package name: %s\n" %
+ self.package_name)
+ except IndexError:
+ pass
+
+ elif line.startswith("classification"):
+ self.do_classification(pathname, line.rstrip())
+
+ def usage(self, usage_error = None):
+ """Emit a usage message and optionally prefix it with a more
+ specific error message. Causes program to exit.
+
+ Argument:
+ - usage_error: optional usage error message.
+ """
+
+ pname = os.path.basename(sys.argv[0])
+ if usage_error:
+ print >> sys.stderr, pname + ": " + usage_error
+
+ print >> sys.stderr, _("""\
+Usage:
+ gen_os_files [OPTION...]
+
+-h, --help
+ Show this help message
+
+-d, --debug
+ Turn on debugging.
+
+-c, --category=category-file-name
+ Specify an alternate file name to write out the
+ package category values to.
+
+-s, --subcategory=subcategory-file-name
+ Specify an alternate file name to write out the
+ package sub-category values to.""")
+
+ sys.exit(2)
+
+ def write_cat_file(self):
+ """Sort the dictionary keys (package names) and write out the
+ category information to the category file.
+ """
+
+ categories = {}
+ for key in sorted(self.packages.keys()):
+ build_no, category, sub_category = self.packages[key]
+
+ if category in categories:
+ # If we already have a list started for this category,
+ # then just append this sub-category to it, if it isn't
+ # already there.
+ #
+ sub_categories = categories[category]
+ if not sub_category in sub_categories:
+ sub_categories.append(sub_category)
+ categories[category] = sub_categories
+ else:
+ categories[category] = [ sub_category ]
+
+
+ fout = open(self.os_cat_name, 'w')
+
+ # Write out the part that we can't derive from the package
+ # classifications.
+ #
+ fout.write("[Meta Packages]\n")
+ fout.write(
+ "category = Builds,Releases,Developer Tools,AMP Stack,Office Tools")
+ fout.write("\n\n")
+
+ # For each of the categories, write out a sorted comma separated
+ # list of all of the sub-categories.
+ #
+ for key in sorted(categories.keys()):
+ sub_categories = ",".join(sorted(categories[key]))
+ if self.debug:
+ sys.stderr.write("Category: %s\n" % key)
+ sys.stderr.write("Subcategories: %s\n" % sub_categories)
+
+ fout.write("[%s]\ncategory = %s\n\n" % (key, sub_categories))
+ fout.close()
+
+ def write_subcat_file(self):
+ """Sort the dictionary keys (package names) and write out the
+ sub-category information to the sub-category file.
+ """
+
+ fout = open(self.os_subcat_name, 'w')
+ for key in sorted(self.packages.keys()):
+ build_no, category, sub_category = self.packages[key]
+ fout.write("[%s]\ncategory = %s\n\n" % (key, sub_category))
+ fout.close()
+
+ def main(self):
+ """Read command line options, find a list of all files (as
+ opposed to directories) under the prefix directory, and for
+ each one, call extract_info to get category, subcategory
+ and build number. Finally create new versions of the new
+ GUI classification files.
+ """
+
+ try:
+ opts, args = getopt.getopt(sys.argv[1:], "c:dhs:",
+ ["category=", "debug", "help", "subcategory="])
+ except getopt.GetoptError, e:
+ self.usage(_("Illegal option -- %s") % e.opt)
+
+ for opt, val in opts:
+ if opt in ("-c", "--category"):
+ self.os_cat_name = val.strip()
+ if opt in ("-d", "--debug"):
+ self.debug = True
+ if opt in ("-h", "--help"):
+ self.usage()
+ if opt in ("-s", "--subcategory"):
+ self.os_subcat_name = val.strip()
+
+ cmd = 'find %s -type f -print' % self.prefix
+ lines = os.popen(cmd).readlines()
+ for package_file in lines:
+ self.extract_info(package_file[:-1])
+
+ if self.debug:
+ sys.stderr.write("Number of classified packages: %d\n" %
+ self.package_count)
+ sys.stderr.write("Number of keys: %d\n" %
+ len(self.packages.keys()))
+
+ self.write_subcat_file()
+ self.write_cat_file()
+
+ return 0
+
+if __name__ == "__main__":
+ gen_files = GenOSFiles()
+ sys.exit(gen_files.main())