#!/usr/bin/perl #--------------------------------------------------------------- # Migrate kicker file to new mdk style menu # Copyright: MandrivaSoft, licensed under the GPL v2. # Original file from spec-helper/translate_menu.pl # # modified by Laurent Montel <lmontel@mandrivasoft.com> # #--------------------------------------------------------------- # use strict; # use diagnostics; use MDK::Common; my @nested = ([ "Configuration", "System/Configuration" ], [ "Applications/Monitoring", "System/Monitoring" ], [ "Applications/Publishing", "Office/Publishing" ], [ "Applications/File tools", "System/File Tools" ], [ "Applications/Text tools", "System/Text Tools" ], [ "Applications/Archiving", "System/Archiving" ], [ "Applications", "More Applications" ], [ "Terminals", "System/Terminals" ], [ "Documentation", "More Applications/Documentation" ], [ "Office/PDA", "Office/Communications/PDA" ], [ "Networking/IRC", "Internet/Chat" ], [ "Networking/WWW", "Internet/Web Browsers" ], [ "Networking", "Internet" ], [ "Amusement", "More Applications/Games" ], [ "Session/Windowmanagers", "System/Session/Windowmanagers" ], [ "More applications", "More Applications" ], [ "Internet/Web browsers", "Internet/Web Browsers" ], [ "Internet/Web browser", "Internet/Web Browsers" ], [ "Networking/Web browser", "Internet/Web Browsers" ], [ "System/Text tools", "System/Text Tools" ], [ "System/File tools", "System/File Tools" ], [ "Internet/Instant messaging", "Internet/Instant Messaging" ], [ "Networking/Instant messaging", "Internet/Instant Messaging" ], [ "Office/Tasks management", "Office/Tasks Management" ], [ "Office/Time management", "Office/Time Management" ], [ "Office/Address books", "Office/Address Books" ], [ "Office/Tasks management", "Office/Tasks Management" ], [ "Office/Time management", "Office/Time Management" ], [ "Internet/File transfer", "Internet/File Transfer" ], [ "Internet/File transfer", "Internet/File Transfer" ], [ "Internet/Remote access", "Internet/Remote Access" ], [ "Internet/Web editors", "Internet/Web Editors" ], [ "Networking/Web editors", "Internet/Web Editors" ], [ "Internet/Video conference", "Internet/Video Conference" ], [ "Networking/Video conference", "Internet/Video Conference" ], [ "Networking/Remote access", "Internet/Remote Access" ], [ "Administer your system", "Administer Your System" ], [ "Administer your system", "Administer Your System" ], [ "Play games", "Play Games" ], [ "Use office tools", "Use Office Tools" ], [ "View, modify and create graphics", "View, Modify and Create Graphics" ], [ "Use scientific software", "Use Scientific Software" ], [ "Enjoy music and video", "Enjoy Music and Video" ], [ "More applications/Development/Code generators", "More Applications/Developement/Code Generators" ], [ "Applications/Development/Code generators", "More Applications/Development/Code Generators" ], [ "More applications/Development/Developement environments", "More Applications/Development/Development Environments" ], [ "Applications/Development/Developement environments", "More Applications/Development/Development Environments" ], [ "More applications/Sciences/Artificial intelligence", "More Applications/Sciences/Artificial Intelligence" ], [ "Applications/Sciences/Artificial intelligence", "More Applications/Sciences/Artificial Intelligence" ], [ "More applications/Sciences/Data visualization", "More Applications/Sciences/Data Visualization" ], [ "Applications/Sciences/Data visualization", "More Applications/Sciences/Data Visualization" ], [ "More applications/Sciences/Image processing", "More Applications/Sciences/Image Processing" ], [ "Applications/Sciences/Image processing", "More Applications/Sciences/Image Processing" ], [ "More applications/Sciences/Numeric analysis", "More Applications/Sciences/Numeric Analysis" ], [ "Applications/Sciences/Numeric analysis", "More Applications/Sciences/Numeric Analysis" ], [ "More applications/Sciences/Parallel computing", "More Applications/Sciences/Parallel Computing" ], [ "Applications/Sciences/Parallel computing", "More Applications/Sciences/Parallel Computing" ], [ "System/Archiving/Cd burning", "System/Archiving/CD Burning" ], [ "Applications/Archiving/Cd burning", "System/Archiving/CD Burning" ], ); sub translate { my ($str) = @_; foreach my $t (@nested) { $str =~ s/(\d )$t->[0]/$1$t->[1]/ if $str =~ /\d $t->[0]/ && $str !~ /$t->[1]/; } return $str; } foreach my $file (@ARGV) { substInFile { $_ = translate($_) if /RecentAppsStat=/; } $file; } # translate_menu.pl ends here