Initial snapshot

This commit is contained in:
Mercier Pierre-Olivier 2013-02-11 22:04:30 +01:00
commit fee4dd4e6d
373 changed files with 62144 additions and 0 deletions

37
export/modules/Makefile Normal file
View file

@ -0,0 +1,37 @@
#
# ---------- header -----------------------------------------------------------
#
# project kaneton
#
# license kaneton
#
# file /home/mycure/kaneton/export/Makefile
#
# created julien quintard [sun jun 10 14:53:00 2007]
# updated julien quintard [mon jun 11 19:29:21 2007]
#
#
# ---------- dependencies -----------------------------------------------------
#
include ../../environment/env.mk
#
# ---------- directives -------------------------------------------------------
#
.PHONY: main clear prototypes headers
#
# ---------- rules ------------------------------------------------------------
#
main:
clear:
$(call env_purge)
prototypes:
headers:

72
export/modules/bremove.py Normal file
View file

@ -0,0 +1,72 @@
#
# ---------- header -----------------------------------------------------------
#
# project kaneton
#
# license kaneton
#
# file /home/mycure/kaneton/export/modules/bremove.py
#
# created francois goudal [sat oct 25 20:57:38 2008]
# updated julien quintard [sat feb 5 10:33:21 2011]
#
#
# ---------- imports ----------------------------------------------------------
#
import env
import re
#
# ---------- functions --------------------------------------------------------
#
#
# module_init()
#
# called by export.py on startup, to discover the available actions
# returns an array of strings, the index 0 is the action name, and the
# others are the parameters required in the YAML file.
#
def module_init():
return ['bremove','id']
#
# module_action(export_dir, arg)
#
# called by export.py when required by the YAML file.
# this function does the job of the action.
# arg contains the parameters required as specified in the module_init return
# value.
#
def module_action(export_dir, arg):
strip = 0
env.display(env.HEADER_OK, 'action bremove ' + arg['id'], env.OPTION_NONE)
id = arg['id'].split('::', 1)
filepath = id[0]
label = id[1]
tmpfilepath = env.temporary(env.OPTION_FILE)
srcf = open(export_dir + '/' + filepath, 'r')
dstf = open(tmpfilepath, 'w')
line = srcf.readline()
startpattern = re.compile(".*[[]block\:\:" + label + "[]].*")
endpattern = re.compile(".*[[]/block\:\:" + label + "[]].*")
while line != "":
if strip == 0:
if startpattern.match(line) != None:
strip = 1
if strip != 1:
dstf.write(line)
if strip == 1:
if endpattern.match(line) != None:
strip = 2
line = srcf.readline()
dstf.close()
srcf.close()
env.copy(tmpfilepath, export_dir + '/' + filepath, env.OPTION_NONE)
env.remove(tmpfilepath, env.OPTION_NONE)
if strip == 0:
env.display(env.HEADER_ERROR, 'no block ' + label + ' in file ' + filepath, env.OPTION_NONE)
return -1
return 0

View file

@ -0,0 +1,73 @@
#
# ---------- header -----------------------------------------------------------
#
# project kaneton
#
# license kaneton
#
# file /home/mycure/kaneton/export/modules/breplace.py
#
# created francois goudal [sat oct 25 20:57:38 2008]
# updated julien quintard [sat feb 5 10:33:33 2011]
#
#
# ---------- imports ----------------------------------------------------------
#
import env
import re
#
# ---------- functions --------------------------------------------------------
#
#
# module_init()
#
# called by export.py on startup, to discover the available actions
# returns an array of strings, the index 0 is the action name, and the
# others are the parameters required in the YAML file.
#
def module_init():
return ['breplace','id','data']
#
# module_action(export_dir, arg)
#
# called by export.py when required by the YAML file.
# this function does the job of the action.
# arg contains the parameters required as specified in the module_init return
# value.
#
def module_action(export_dir, arg):
strip = 0
env.display(env.HEADER_OK, 'action breplace ' + arg['id'], env.OPTION_NONE)
id = arg['id'].split('::', 1)
filepath = id[0]
label = id[1]
tmpfilepath = env.temporary(env.OPTION_FILE)
srcf = open(export_dir + '/' + filepath, 'r')
dstf = open(tmpfilepath, 'w')
line = srcf.readline()
startpattern = re.compile(".*[[]block\:\:" + label + "[]].*")
endpattern = re.compile(".*[[]/block\:\:" + label + "[]].*")
while line != "":
if strip == 0:
if startpattern.match(line) != None:
strip = 1
dstf.write(arg['data'])
if strip != 1:
dstf.write(line)
if strip == 1:
if endpattern.match(line) != None:
strip = 2
line = srcf.readline()
dstf.close()
srcf.close()
env.copy(tmpfilepath, export_dir + '/' + filepath, env.OPTION_NONE)
env.remove(tmpfilepath, env.OPTION_NONE)
if strip == 0:
env.display(env.HEADER_ERROR, 'no block ' + label + ' in file ' + filepath, env.OPTION_NONE)
return -1
return 0

45
export/modules/fmove.py Normal file
View file

@ -0,0 +1,45 @@
#
# ---------- header -----------------------------------------------------------
#
# project kaneton
#
# license kaneton
#
# file /Users/francois/kaneton/tool/export/modules/fmove.py
#
# created francois goudal [sat oct 25 20:57:38 2008]
# updated francois goudal [wed nov 12 05:26:29 2008]
#
#
# ---------- imports ----------------------------------------------------------
#
import env
#
# ---------- functions --------------------------------------------------------
#
#
# module_init()
#
# called by export.py on startup, to discover the available actions
# returns an array of strings, the index 0 is the action name, and the
# others are the parameters required in the YAML file.
#
def module_init():
return ['fmove','src','dst']
#
# module_action(export_dir, arg)
#
# called by export.py when required by the YAML file.
# this function does the job of the action.
# arg contains the parameters required as specified in the module_init return
# value.
#
def module_action(export_dir, arg):
env.display(env.HEADER_OK, 'action fmove ' + arg['src'] + ' to ' + arg['dst'], env.OPTION_NONE)
env.move(export_dir + '/' + arg['src'], export_dir + '/' + arg['dst'], env.OPTION_NONE)
return 0

45
export/modules/fremove.py Normal file
View file

@ -0,0 +1,45 @@
#
# ---------- header -----------------------------------------------------------
#
# project kaneton
#
# license kaneton
#
# file /Users/francois/kaneton/tool/export/modules/remove.py
#
# created francois goudal [sat oct 25 20:57:38 2008]
# updated francois goudal [wed nov 12 05:26:29 2008]
#
#
# ---------- imports ----------------------------------------------------------
#
import env
#
# ---------- functions --------------------------------------------------------
#
#
# module_init()
#
# called by export.py on startup, to discover the available actions
# returns an array of strings, the index 0 is the action name, and the
# others are the parameters required in the YAML file.
#
def module_init():
return ['fremove','path']
#
# module_action(export_dir, arg)
#
# called by export.py when required by the YAML file.
# this function does the job of the action.
# arg contains the parameters required as specified in the module_init return
# value.
#
def module_action(export_dir, arg):
env.display(env.HEADER_OK, 'action fremove ' + arg['path'], env.OPTION_NONE)
env.remove(export_dir + '/' + arg['path'], env.OPTION_NONE)
return 0

View file

@ -0,0 +1,46 @@
#
# ---------- header -----------------------------------------------------------
#
# project kaneton
#
# license kaneton
#
# file /Users/francois/kaneton/tool/export/modules/remove.py
#
# created francois goudal [sat oct 25 20:57:38 2008]
# updated francois goudal [wed nov 12 05:26:29 2008]
#
#
# ---------- imports ----------------------------------------------------------
#
import env
#
# ---------- functions --------------------------------------------------------
#
#
# module_init()
#
# called by export.py on startup, to discover the available actions
# returns an array of strings, the index 0 is the action name, and the
# others are the parameters required in the YAML file.
#
def module_init():
return ['fremovepattern','pattern']
#
# module_action(export_dir, arg)
#
# called by export.py when required by the YAML file.
# this function does the job of the action.
# arg contains the parameters required as specified in the module_init return
# value.
#
def module_action(export_dir, arg):
env.display(env.HEADER_OK, 'action fremovepattern ' + arg['pattern'], env.OPTION_NONE)
for d in env.search(export_dir, arg['pattern'], env.OPTION_RECURSIVE | env.OPTION_DIRECTORY | env.OPTION_FILE):
env.remove(d, env.OPTION_NONE)
return 0

View file

@ -0,0 +1,45 @@
#
# ---------- header -----------------------------------------------------------
#
# project kaneton
#
# license kaneton
#
# file /home/mycure/kaneton/export/modules/freplace.py
#
# created francois goudal [sat oct 25 20:57:38 2008]
# updated julien quintard [sat feb 5 11:32:56 2011]
#
#
# ---------- imports ----------------------------------------------------------
#
import env
#
# ---------- functions --------------------------------------------------------
#
#
# module_init()
#
# called by export.py on startup, to discover the available actions
# returns an array of strings, the index 0 is the action name, and the
# others are the parameters required in the YAML file.
#
def module_init():
return ['freplace','src','dst']
#
# module_action(export_dir, arg)
#
# called by export.py when required by the YAML file.
# this function does the job of the action.
# arg contains the parameters required as specified in the module_init return
# value.
#
def module_action(export_dir, arg):
env.display(env.HEADER_OK, 'action freplace ' + arg['src'] + ' to ' + arg['dst'], env.OPTION_NONE)
env.copy(export_dir + '/' + arg['src'], export_dir + '/' + arg['dst'], env.OPTION_NONE)
return 0

46
export/modules/initenv.py Normal file
View file

@ -0,0 +1,46 @@
#
# ---------- header -----------------------------------------------------------
#
# project kaneton
#
# license kaneton
#
# file /home/mycure/kaneton/export/modules/initenv.py
#
# created francois goudal [sat oct 25 20:57:38 2008]
# updated julien quintard [mon apr 20 15:03:29 2009]
#
#
# ---------- imports ----------------------------------------------------------
#
import env
#
# ---------- functions --------------------------------------------------------
#
#
# module_init()
#
# called by export.py on startup, to discover the available actions
# returns an array of strings, the index 0 is the action name, and the
# others are the parameters required in the YAML file.
#
def module_init():
return ['initenv']
#
# module_action(export_dir, arg)
#
# called by export.py when required by the YAML file.
# this function does the job of the action.
# arg contains the parameters required as specified in the module_init return
# value.
#
def module_action(export_dir, arg):
env.display(env.HEADER_OK, 'action initenv', env.OPTION_NONE)
env.launch(export_dir + '/environment/initialize.py', "", env.OPTION_QUIET)
env.launch(export_dir + '/Makefile', "clean", env.OPTION_QUIET)
return 0

View file

@ -0,0 +1,46 @@
#
# ---------- header -----------------------------------------------------------
#
# project kaneton
#
# license kaneton
#
# file /Users/francois/kaneton/tool/export/modules/remove.py
#
# created francois goudal [sat oct 25 20:57:38 2008]
# updated francois goudal [wed nov 12 05:26:29 2008]
#
#
# ---------- imports ----------------------------------------------------------
#
import env
#
# ---------- functions --------------------------------------------------------
#
#
# module_init()
#
# called by export.py on startup, to discover the available actions
# returns an array of strings, the index 0 is the action name, and the
# others are the parameters required in the YAML file.
#
def module_init():
return ['localexport']
#
# module_action(export_dir, arg)
#
# called by export.py when required by the YAML file.
# this function does the job of the action.
# arg contains the parameters required as specified in the module_init return
# value.
#
def module_action(export_dir, arg):
env.display(env.HEADER_OK, 'action localexport', env.OPTION_NONE)
env.copy(env._SOURCE_DIR_, export_dir, env.OPTION_NONE)
return 0

45
export/modules/mkdir.py Normal file
View file

@ -0,0 +1,45 @@
#
# ---------- header -----------------------------------------------------------
#
# project kaneton
#
# license kaneton
#
# file /home/mycure/kaneton/export/modules/mkdir.py
#
# created francois goudal [sat oct 25 20:57:38 2008]
# updated julien quintard [sat feb 5 11:36:28 2011]
#
#
# ---------- imports ----------------------------------------------------------
#
import env
#
# ---------- functions --------------------------------------------------------
#
#
# module_init()
#
# called by export.py on startup, to discover the available actions
# returns an array of strings, the index 0 is the action name, and the
# others are the parameters required in the YAML file.
#
def module_init():
return ['mkdir','path']
#
# module_action(export_dir, arg)
#
# called by export.py when required by the YAML file.
# this function does the job of the action.
# arg contains the parameters required as specified in the module_init return
# value.
#
def module_action(export_dir, arg):
env.display(env.HEADER_OK, 'action mkdir ' + arg['path'], env.OPTION_NONE)
env.mkdir(export_dir + '/' + arg['path'], env.OPTION_NONE)
return 0

View file

@ -0,0 +1,46 @@
#
# ---------- header -----------------------------------------------------------
#
# project kaneton
#
# license kaneton
#
# file /home/mycure/kaneton/export/modules/svnexport.py
#
# created francois goudal [sat oct 25 20:57:38 2008]
# updated julien quintard [sat feb 5 11:14:04 2011]
#
#
# ---------- imports ----------------------------------------------------------
#
import env
#
# ---------- functions --------------------------------------------------------
#
#
# module_init()
#
# called by export.py on startup, to discover the available actions
# returns an array of strings, the index 0 is the action name, and the
# others are the parameters required in the YAML file.
#
def module_init():
return ['svnexport']
#
# module_action(export_dir, arg)
#
# called by export.py when required by the YAML file.
# this function does the job of the action.
# arg contains the parameters required as specified in the module_init return
# value.
#
def module_action(export_dir, arg):
env.display(env.HEADER_OK, 'action svnexport', env.OPTION_NONE)
env.launch("svn", "export svn+ssh://subversion@repositories.passeism.org/kaneton " + export_dir,env.OPTION_NONE)
return 0

45
export/modules/symlink.py Normal file
View file

@ -0,0 +1,45 @@
#
# ---------- header -----------------------------------------------------------
#
# project kaneton
#
# license kaneton
#
# file /Users/francois/kaneton/tool/export/modules/symlink.py
#
# created francois goudal [sat oct 25 20:57:38 2008]
# updated francois goudal [wed nov 12 05:26:29 2008]
#
#
# ---------- imports ----------------------------------------------------------
#
import env
#
# ---------- functions --------------------------------------------------------
#
#
# module_init()
#
# called by export.py on startup, to discover the available actions
# returns an array of strings, the index 0 is the action name, and the
# others are the parameters required in the YAML file.
#
def module_init():
return ['symlink','name','target']
#
# module_action(export_dir, arg)
#
# called by export.py when required by the YAML file.
# this function does the job of the action.
# arg contains the parameters required as specified in the module_init return
# value.
#
def module_action(export_dir, arg):
env.display(env.HEADER_OK, 'action symlink ' + arg['name'] + ' to ' + arg['target'], env.OPTION_NONE)
env.link(export_dir + '/' + arg['name'], arg['target'], env.OPTION_NONE)
return 0

49
export/modules/tarball.py Normal file
View file

@ -0,0 +1,49 @@
#
# ---------- header -----------------------------------------------------------
#
# project kaneton
#
# license kaneton
#
# file /home/mycure/kaneton/export/modules/tarball.py
#
# created francois goudal [sat oct 25 20:57:38 2008]
# updated julien quintard [sat feb 5 11:42:05 2011]
#
#
# ---------- imports ----------------------------------------------------------
#
import env
#
# ---------- functions --------------------------------------------------------
#
#
# module_init()
#
# called by export.py on startup, to discover the available actions
# returns an array of strings, the index 0 is the action name, and the
# others are the parameters required in the YAML file.
#
def module_init():
return ['tarball','filename']
#
# module_action(export_dir, arg)
#
# called by export.py when required by the YAML file.
# this function does the job of the action.
# arg contains the parameters required as specified in the module_init return
# value.
#
def module_action(export_dir, arg):
env.display(env.HEADER_OK, 'action tarball ' + arg['filename'], env.OPTION_NONE)
directory = env.cwd(env.OPTION_NONE)
env.cd(env.path(export_dir, env.OPTION_DIRECTORY), env.OPTION_NONE)
env.remove(env._EXPORT_DIR_ + "/output/" + arg['filename'] + ".tar.bz2", env.OPTION_NONE)
env.pack("kaneton", env._EXPORT_DIR_ + "/output/" + arg['filename'] + ".tar.bz2", env.OPTION_NONE)
env.cd(directory, env.OPTION_NONE)
return 0