예제 #1
0
파일: release.py 프로젝트: Grahack/geophar
s.mkdir('build_/wxgeometrie')


# Création du tag de release
tag = 'v' + version
s.command('git tag -am %s %s' %(repr(options.message or 'Version ' + version), tag))

# Récupération des fichiers via git
s.cd('wxgeometrie')
s.command('git archive %s -o ../build_/wxgeometrie.tar' %tag)
s.cd('../build_')
s.command('tar -xf wxgeometrie.tar --directory wxgeometrie')
s.rm('wxgeometrie.tar')

# Personnalisation du contenu
s.cp('../README.md', 'wxgeometrie/README')
s.cp('../INSTALL', 'wxgeometrie/INSTALL')
s.cp('../LICENSE', 'wxgeometrie/LICENSE')
s.mkdir('wxgeometrie/tools')
s.cp('../tools/scriptlib.py', 'wxgeometrie/tools/scriptlib.py')
s.rename('wxgeometrie/param/personnaliser_.py', 'wxgeometrie/param/personnaliser.py')

# Création de l'archive .tar.gz
s.command('tar -cf %s wxgeometrie' %archive_tar)
s.command('gzip %s' %archive_tar)
s.mv(archive_gz, options.output)

print(u'\nPaquet créé dans %s.\n' %os.path.abspath(options.output))

# Nettoyage
s.cd('..')
예제 #2
0
        choice = 'root'
        break
    else:
        print(u"Réponse incorrecte (tapez 'o' ou 'N').")


for loc in locations:
    locations[loc] = join(paths[choice], 'share', locations[loc])
    if not isdir(locations[loc]):
        os.makedirs(locations[loc])

# Copie des fichiers.

cd(join(_module_path, 'resources'))

cp('geophar.desktop', locations['desktop_path'])
cp('geophar.svg', locations['svg_icon_path'])
cp('geophar.png', locations['png_icon_path'])
cp('x-geophar.xml', locations['mime_path'])

cd('../..')

# Création du fichier sh.
if choice == 'root':
    exec_path = '/usr/local/bin'
else:
    exec_path = expanduser('~/bin')
    if not isdir(exec_path):
        os.mkdir(exec_path)

script_name = join(exec_path, 'geophar')