executable_insinto'ya glob desteği. #468 kapanıyor...
This commit is contained in:
@@ -30,7 +30,7 @@ def dobin(sourceFile, destinationDirectory = '/usr/bin'):
|
||||
'''insert a executable file into /bin or /usr/bin'''
|
||||
|
||||
''' example call: pisitools.dobin("bin/xloadimage", "/bin", "xload") '''
|
||||
executable_insinto(sourceFile, get.installDIR() + destinationDirectory)
|
||||
executable_insinto(get.installDIR() + destinationDirectory, sourceFile)
|
||||
|
||||
def dodir(destinationDirectory):
|
||||
'''creates a directory tree'''
|
||||
@@ -44,8 +44,7 @@ def doexe(sourceFile, destinationDirectory):
|
||||
'''insert a executable file into destination directory'''
|
||||
|
||||
''' example call: pisitools.doexe("kde-3.4.sh", "/etc/X11/Sessions")'''
|
||||
for file in glob.glob(sourceFile):
|
||||
executable_insinto(file, get.installDIR() + destinationDirectory)
|
||||
executable_insinto(get.installDIR() + destinationDirectory, sourceFile)
|
||||
|
||||
def dohard(sourceFile, destinationFile):
|
||||
'''creates hard link between sourceFile and destinationFile'''
|
||||
@@ -175,7 +174,7 @@ def dosbin(sourceFile, destinationDirectory = '/usr/sbin'):
|
||||
'''insert a executable file into /sbin or /usr/sbin'''
|
||||
|
||||
''' example call: pisitools.dobin("bin/xloadimage", "/sbin") '''
|
||||
executable_insinto(sourceFile, get.installDIR() + destinationDirectory)
|
||||
executable_insinto(get.installDIR() + destinationDirectory, sourceFile)
|
||||
|
||||
def dosym(sourceFile, destinationFile):
|
||||
'''creates soft link between sourceFile and destinationFile'''
|
||||
|
||||
@@ -31,19 +31,18 @@ class ArgumentError(pisi.actionsapi.Error):
|
||||
def __init__(self, Exception):
|
||||
ctx.ui.error(Exception)
|
||||
|
||||
def executable_insinto(sourceFile, destinationDirectory):
|
||||
def executable_insinto(destinationDirectory, *sourceFiles):
|
||||
'''insert a executable file into destinationDirectory'''
|
||||
|
||||
if not sourceFile or not destinationDirectory:
|
||||
if not sourceFiles or not destinationDirectory:
|
||||
raise ArgumentError('Insufficient arguments...')
|
||||
|
||||
if not can_access_file(sourceFile):
|
||||
raise FileError('File doesn\'t exists or permission denied...')
|
||||
|
||||
if not can_access_directory(destinationDirectory):
|
||||
makedirs(destinationDirectory)
|
||||
|
||||
system('install -m0755 -o root -g root %s %s' % (sourceFile, destinationDirectory))
|
||||
|
||||
for sourceFile in sourceFiles:
|
||||
for source in glob.glob(sourceFile):
|
||||
system('install -m0755 -o root -g root %s %s' % (source, destinationDirectory))
|
||||
|
||||
def readable_insinto(destinationDirectory, *sourceFiles):
|
||||
'''inserts file list into destinationDirectory'''
|
||||
|
||||
Reference in New Issue
Block a user