← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~linuxdcpp-team/linuxdcpp/linuxdcpp-i18n] Rev 396: Properly install mo files

 

------------------------------------------------------------
revno: 396
committer: Steven Sheehy <steven.sheehy@xxxxxxxxx>
branch nick: linuxdcpp-i18n
timestamp: Sun 2010-10-31 01:05:43 -0500
message:
  Properly install mo files
modified:
  SConstruct


--
lp:~linuxdcpp-team/linuxdcpp/linuxdcpp-i18n
https://code.launchpad.net/~linuxdcpp-team/linuxdcpp/linuxdcpp-i18n

Your team LinuxDC++ Team is subscribed to branch lp:~linuxdcpp-team/linuxdcpp/linuxdcpp-i18n.
To unsubscribe from this branch go to https://code.launchpad.net/~linuxdcpp-team/linuxdcpp/linuxdcpp-i18n/+edit-subscription
=== modified file 'SConstruct'
--- SConstruct	2010-10-14 06:00:38 +0000
+++ SConstruct	2010-10-31 06:05:43 +0000
@@ -85,6 +85,16 @@
 			src = os.path.join(root, file)
 			env.Alias('install', env.Install(dir = target, source = src))
 
+def recursive_install(env, source, target):
+	nodes = env.Glob(os.path.join(source, '*'))
+	target = os.path.join(target, os.path.basename(source))
+
+	for node in nodes:
+		if node.isdir():
+			env.RecursiveInstall(str(node), target)
+		else:
+			env.Alias('install', env.Install(target, node))
+
 def generate_message_catalogs(env):
 	mo_path = os.path.join(BUILD_LOCALE_PATH, '%s', 'LC_MESSAGES', env['package'] + '.mo')
 	po_files = env.Glob('po/*.po', strings = True)
@@ -169,6 +179,7 @@
 
 env.AddMethod(generate_message_catalogs, 'GenerateMessageCatalogs')
 env.AddMethod(install_icons, 'InstallIcons')
+env.AddMethod(recursive_install, 'RecursiveInstall')
 
 conf = env.Configure(
 	custom_tests =
@@ -342,7 +353,7 @@
 	desktop_file = os.path.join('data', PACKAGE + '.desktop')
 
 	env.InstallIcons('icons/hicolor/')
-	env.Alias('install', env.Install(dir = os.path.join(prefix, 'share', 'locale'), source = BUILD_LOCALE_PATH))
+	env.RecursiveInstall(BUILD_LOCALE_PATH, os.path.join(prefix, 'share', 'locale'))
 	env.Alias('install', env.Install(dir = os.path.join(prefix, 'share', PACKAGE, 'glade'), source = glade_files))
 	env.Alias('install', env.Install(dir = os.path.join(prefix, 'share', 'doc', PACKAGE), source = text_files))
 	env.Alias('install', env.Install(dir = os.path.join(prefix, 'share', 'applications'), source = desktop_file))