################################################################################
# Creates a LiveCD for Hets.
# depends on a Debian-Based distributions this program just works such systems.
#
# Author: Thiemo Wiedemeyer
# E-Mail: raider@informatik.uni-bremen.de
################################################################################
##
# Invocates 'mv' to move a file from source to dest.
# @param source Source path of the file.
# @param dest Destination path of the file.
# @return Returnvalue of 'mv'.
printStart("Moving file...")
return ret
##
# Invocates 'mmaker' to create a MainMod out of the HetsLiveCD.xml.
# @return Returnvalue of 'mmaker'.
def createMainMod():
printStart("Creating main mod...")
return ret
##
# Invocates 'morphmini' to create MiniMods out of each *Mini.xml file.
# @return Returnvalue of 'morphmini'.
def createMiniMods():
printStart("Creating mini mods...")
ret = 0
continue
if ret != 0:
break
return ret
##
# Invocates 'isomorph' to delete given content from a MorpixIso file.
# @param source Source path of the iso file.
# @param dest Destination path of the iso file.
# @param delete Name of the content that should be deleted. If 'all' all
# content is deleted
# @return A Tupel containing the returnvalue of 'isomorph', the new
# source path of the iso file and the new destination path for
# the next action.
printStart("Deleting old content...")
if delete == "all":
else:
##
# Invocates 'isomorph' to add the MainMod to a MorpixIso file.
# @param source Source path of the iso file.
# @param dest Destination path of the iso file.
# @return A Tupel containing the returnvalue of 'isomorph', the new
# source path of the iso file and the new destination path for
# the next action.
printStart("Insert main mod...")
##
# Invocates 'isomorph' to add the MiniMods to a MorpixIso file.
# @param source Source path of the iso file.
# @param dest Destination path of the iso file.
# @return A Tupel containing the returnvalue of 'isomorph', the new
# source path of the iso file and the new destination path for
# the next action.
printStart("Insert mini mods...")
ret = 0
if ret != 0:
break
##
# Invocates 'isomorph' to add a given file to a given destination path on the
# LiveCD to a MorpixIso file.
# @param file Source path file that should be added.
# @param path Destination path where the file should be added.
# @param source Source path of the iso file.
# @param dest Destination path of the iso file.
# @return A Tupel containing the returnvalue of 'isomorph', the new
# source path of the iso file and the new destination path for
# the next action.
##
# Invocates addFile2Copy for each file in the copy directory.
# @param path Path to look for files that should be added.
# @param root Base path where the files should be added.
# @param source Source path of the iso file.
# @param dest Destination path of the iso file.
# @return A Tupel containing the returnvalue of addFile2Copy, the new
# source path of the iso file and the new destination path for
# the next action.
ret = 0
if ret != 0:
break
##
# Invocates 'isomorph' to add content of the exec directory to a MorpixIso
# file.
# @param source Source path of the iso file.
# @param dest Destination path of the iso file.
# @return A Tupel containing the returnvalue of 'isomorph', the new
# source path of the iso file and the new destination path for
# the next action.
printStart("Insert exec files...")
##
# Invocates 'rm' to remove all content from the given directory.
# @param dir Directory that should be cleaned.
# @return Returnvalue of 'rm'.
return ret
##
# Invocates cleanDir all directories that should be cleaned.
# @param all If True temp, main and mini directories are clened else just temp.
# @return Returnvalue of cleanDir.
if not all:
return -1
return 0
##
# Prints a usage message to the console.
#
def usage():
print "Usage:"
print ""
print "Options:"
print " [copy|exec|main|mini|clean|mkmain|mkmini|mkiso|all|deltmp|delall]"
print ""
print "Description:"
print " copy copies files from './copy' to iso."
print " exec copies files from './exec' to iso."
print " mini copies all mini modules from './mini/' to iso."
print " clean deletes exec, main, copy, mini from iso."
print " mkmain creates the mainmod out of './HetsLiveCD.xml'."
print " mkmini creates minimods for all './*Mini.xml'."
print " mkiso makes a clean and adds exec, main, copy, mini to iso."
print " all makes a clean, creates main and mini mods and adds exec, main, copy,"
print " mini to iso."
print " deltmp deletes content of './temp'."
print " delall deletes content of './mini', './main' and './temp'."
return
if __name__ == "__main__":
# Check argument count
print "Wrong parameter count."
usage()
# Check if command is in available command list
if not sys.argv[1] in ("copy","exec","main","mini","clean","mkmain","mkmini","mkiso","all","deltmp","delall"):
print "Unknown command."
usage()
# Setting source and destination iso files
# If command is a command that manipulates iso files, the HetsLiveCD.iso is moved to source
# copy
if ret != 0:
if ret != 0:
# exec
if ret != 0:
if ret != 0:
# main
if ret != 0:
if ret != 0:
# mini
if ret != 0:
if ret != 0:
# clean
if ret != 0:
# mkmain
if createMainMod() != 0:
# mkmini
if createMiniMods() != 0:
# mkiso
if ret != 0:
if ret != 0:
if ret != 0:
if ret != 0:
if ret != 0:
# all
if createMainMod() != 0:
if createMiniMods() != 0:
if ret != 0:
if ret != 0:
if ret != 0:
if ret != 0:
if ret != 0:
# deltmp
# delall