# -*- coding: iso-8859-1 -*- import os import sys import string import popen2 import stat import re import time from os import path import getopt import tempfile import signal import cmt tempprefix = '' tempfile1 = '' tempfile2 = '' tempcopydir = '' tempcmtusercontext = '' patch_requirements = '' release = '' cyclefile = '' patch_dir = '' minimal = False pacman_only = False platform = '' platform_suffix = '' override = False do_source_kit = False url = '' pacman_base = '' cache_dir = '' kits_dir = '' patch_requirements = '' here = '' cmt = cmt.CMT () def get_project (cmtpath): if cmtpath != '': rr = os.path.basename (cmtpath) pr = os.path.dirname (cmtpath) pr = os.path.basename (pr) return os.path.join (pr, rr) def cleanup (): print 'Cleanup' cmt.removedirs (tempprefix) def build_pacman (url, package, version, cmtpath, project_id, is_internal): #print url, package, version, cmtpath, project_id, is_internal source = '../kits' # External packages (those with export_paths) are split into two kits: # o The internal part, which follows the naming convention for internal packages # o The external part, which only refers to the package version (no mention of # the project) # Naming cnvention: # external packages : -- # internal packages : /- if not is_internal: # first build the pacman file for the external stuff if native_version == None: #vv=`echo ${version} | sed -e 's#'^${package}-'##'` vv = '' else: vv = native_version download_filename="${package}-${vv}${platform_suffix}" download_filename = package + '-' + vv + platform_suffix pacman_filename = download_filename + '.pacman' print 'build_pacman> Create pacman file for external stuff ' + pacman_filename pacman_file_version = get_pacman_file_version (os.path.join (cache_dir, pacman_filename)) #if test -f ${cache_dir}/${pacman_filename}; then # mv ${cache_dir}/${pacman_filename} ${cache_dir}/${pacman_filename}.bak # if test ! $? = 0; then # print 'create_kit> failed to rename ' + cache_dir + '/' + pacman_filename + ' to ' + cache_dir + '/' + pacman_filename' + '.bak' # exit 1 # write pacman file # end build_pacman def usage (): print "Make a distribution kit for a CMT package" print "Usage: create_kit.sh [