Commit 6ed737c9 authored by Daniel Baumann's avatar Daniel Baumann
Browse files

Adding upstream version 4.0~alpha30.

parent 68ca1cd4
4.0~alpha29-1
4.0~alpha30-1
......@@ -25,11 +25,11 @@ import sys
def main():
## Parsing Arguments
arguments = argparse.ArgumentParser(
prog = 'lb binary_hooks',
prog = 'lb binary-hooks',
usage = '%(prog)s [arguments]',
description = '''live-build contains the components to build a live system from a configuration directory.
The binary_hooks command executes hooks after the binary stage.''',
epilog = 'See \'man lb_binary_hooks\' for more information.',
The binary-hooks command executes hook files after the binary stage.''',
epilog = 'See \'man lb-binary-hooks\' for more information.',
formatter_class = argparse.ArgumentDefaultsHelpFormatter
)
......@@ -41,12 +41,12 @@ def main():
# --verbose
verbose = args.verbose
## Executing hooks
## Calling binary hooks
# stagefile
if os.path.isfile('.build/binary_hooks'):
if os.path.isfile('.build/binary-hooks'):
if verbose:
print('I: binary_hooks already done - nothing to do')
print('I: binary-hooks already done - nothing to do')
sys.exit(0)
......@@ -101,7 +101,7 @@ def main():
## stagefile
os.makedirs('.build', exist_ok=True)
open('.build/binary_hooks', 'w').close()
open('.build/binary-hooks', 'w').close()
if __name__ == '__main__':
......
#!/usr/bin/python3
## live-build(7) - Live System Build Components
## Copyright (C) 2006-2013 Daniel Baumann <mail@daniel-baumann.ch>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
import argparse
import configparser
import glob
import os
import shutil
import subprocess
import sys
# TODO:
# * logfile output
# * lockfile handling
# * use gettext for i18n
# * derefence or remove symlinks if binary filesystem does not support them
def main():
## Parsing Arguments
arguments = argparse.ArgumentParser(
prog = 'lb binary-includes',
usage = '%(prog)s [arguments]',
description = '''live-build contains the components to build a live system from a configuration directory.
The binary-includes command copies include files into the binary stage.''',
epilog = 'See \'man lb-binary-includes\' for more information.',
formatter_class = argparse.ArgumentDefaultsHelpFormatter
)
arguments.add_argument('--version', help='show program\'s version number and exit', action='version', version='live-build 4')
arguments.add_argument('--verbose', help='set verbose option', action='store_true')
args = arguments.parse_args()
# --verbose
verbose = args.verbose
## Copying binary includes
# stagefile
if os.path.isfile('.build/binary-includes'):
if verbose:
print('I: binary-includes already done - nothing to do')
sys.exit(0)
# dependencies
if not os.path.isfile('.build/bootstrap'):
print('E: bootstrap stage missing - aborting', file=sys.stderr)
if verbose:
print('I: use \'lb bootstrap\' to bootstrap system')
sys.exit(1)
if not os.path.isfile('/bin/cpio'):
print('E: /bin/cpio - no such file', file=sys.stderr)
if verbose:
print('I: cpio can be obtained from:\n'
'I: http://www.gnu.org/software/cpio/\n'
'I: http://ftp.gnu.org/gnu/cpio/\n'
'I: On Debian based systems, cpio can be installed with:\n'
'I: # sudo apt-get install cpio')
sys.exit(1)
# includes
if not glob.glob('config/includes/*') and not glob.glob('config/includes/.*') and not glob.glob('config/includes.binary/*') and not glob.glob('config/includes.binary/.*'):
if verbose:
print ('I: no binary includes found at config/includes{,.binary} - nothing to do')
sys.exit(0)
# process includes
if glob.glob('config/includes/*') or glob.glob('config/includes/.*'):
hooks = glob.glob('config/includes/*') + glob.glob('config/includes/.*')
if verbose:
print('I: Copying config/includes to binary')
cpio = subprocess.call('cd config/includes && find . | cpio -dmpu --no-preserve-owner ../../binary', shell=True)
if glob.glob('config/includes.binary/*') and not glob.glob('config/includes.binary/.*'):
hooks = glob.glob('config/includes.binary/*') + glob.glob('config/includes.binary/.*')
if verbose:
print('I: Copying config/includes.binary to binary')
cpio = subprocess.call('cd config/includes.binary && find . | cpio -dmpu --no-preserve-owner ../../binary', shell=True)
# stagefile
os.makedirs('.build', exist_ok=True)
open('.build/binary-includes', 'w').close()
if __name__ == '__main__':
main()
......@@ -21,17 +21,17 @@ import sys
# * logfile output
# * lockfile handling
# * use gettext for i18n
# * cdebootstrap-options from config
# * take mirrors from config/archives/debian.{bootstrap,chroot}
# * cdebootstrap-options from config/options/cdebootstrap
# * take mirrors from config/archives/mirror.{bootstrap,chroot}
def main():
## Parsing Arguments
arguments = argparse.ArgumentParser(
prog = 'lb bootstrap_cdebootstrap',
prog = 'lb bootstrap-cdebootstrap',
usage = '%(prog)s [arguments]',
description = '''live-build contains the components to build a live system from a configuration directory.
The bootstrap_cdebootstrap command bootstraps the chroot system with cdebootstrap.''',
epilog = 'See \'man lb_bootstrap_cdebootstrap\' for more information.',
The bootstrap-cdebootstrap command bootstraps the chroot system with cdebootstrap.''',
epilog = 'See \'man lb-bootstrap-cdebootstrap\' for more information.',
formatter_class = argparse.ArgumentDefaultsHelpFormatter
)
......@@ -89,7 +89,7 @@ def main():
print('E: /usr/bin/cdebootstrap - no such file', file=sys.stderr)
if verbose:
print('I: cdebootstrap can be optained from:\n'
print('I: cdebootstrap can be obtained from:\n'
'I: http://anonscm.debian.org/gitweb/?p=users/waldi/cdebootstrap.git\n'
'I: http://ftp.debian.org/debian/pool/main/c/cdebootstrap/\n'
'I: On Debian based systems, cdebootstrap can be installed with:\n'
......@@ -105,8 +105,23 @@ def main():
print('I: use \'lb clean\' to clean up a previously incomplete build')
sys.exit(1)
# stage cache
if os.path.exists('cache/bootstrap'):
if verbose:
print('I: Copying cache/bootstrap to chroot')
# Notes:
# * there's no Python equivalent to 'cp -a' that handels both symlinks and device nodes properly.
cache = subprocess.call('cp -a cache/bootstrap chroot', shell=True)
os.makedirs('.build', exist_ok=True)
open('.build/bootstrap', 'w').close()
sys.exit(0)
# packages cache
elif glob.glob('cache/packages.bootstrap/*.deb'):
if glob.glob('cache/packages.bootstrap/*.deb'):
if verbose:
print('I: Copying cache/packages.bootstrap/*.deb to chroot/var/cache/bootstrap/*.deb')
......@@ -150,7 +165,16 @@ def main():
cdebootstrap = subprocess.call('/usr/bin/cdebootstrap ' + cdebootstrap_options, shell=True)
## stagefile
# stage cache
if not os.path.exists('cache/bootstrap'):
if verbose:
print('I: Copying chroot to cache/bootstrap')
# Notes:
# * there's no Python equivalent to 'cp -a' that handels both symlinks and device nodes properly.
cache = subprocess.call('cp -a chroot cache/bootstrap', shell=True)
# stagefile
os.makedirs('.build', exist_ok=True)
open('.build/bootstrap', 'w').close()
......
......@@ -21,17 +21,17 @@ import sys
# * logfile output
# * lockfile handling
# * use gettext for i18n
# * debootstrap-options from config
# * take mirrors from config/archives/debian.{bootstrap,chroot}
# * debootstrap-options from config/options/debootstrap
# * take mirrors from config/archives/mirror.{bootstrap,chroot}
def main():
## Parsing Arguments
arguments = argparse.ArgumentParser(
prog = 'lb bootstrap_debootstrap',
prog = 'lb bootstrap-debootstrap',
usage = '%(prog)s [arguments]',
description = '''live-build contains the components to build a live system from a configuration directory.
The bootstrap_debootstrap command bootstraps the chroot system with debootstrap.''',
epilog = 'See \'man lb_bootstrap_debootstrap\' for more information.',
The bootstrap-debootstrap command bootstraps the chroot system with debootstrap.''',
epilog = 'See \'man lb-bootstrap-debootstrap\' for more information.',
formatter_class = argparse.ArgumentDefaultsHelpFormatter
)
......@@ -94,7 +94,7 @@ def main():
print('E: /usr/sbin/debootstrap - no such file', file=sys.stderr)
if verbose:
print('I: debootstrap can be optained from:\n'
print('I: debootstrap can be obtained from:\n'
'I: http://anonscm.debian.org/gitweb/?p=d-i/debootstrap.git\n'
'I: http://ftp.debian.org/debian/pool/main/d/debootstrap/\n'
'I: On Debian based systems, debootstrap can be installed with:\n'
......@@ -110,8 +110,23 @@ def main():
print('I: use \'lb clean\' to clean up a previously incomplete build')
sys.exit(1)
# stage cache
if os.path.exists('cache/bootstrap'):
if verbose:
print('I: Copying cache/bootstrap to chroot')
# Notes:
# * there's no Python equivalent to 'cp -a' that handels both symlinks and device nodes properly.
cache = subprocess.call('cp -a cache/bootstrap chroot', shell=True)
os.makedirs('.build', exist_ok=True)
open('.build/bootstrap', 'w').close()
sys.exit(0)
# packages cache
elif glob.glob('cache/packages.bootstrap/*.deb'):
if glob.glob('cache/packages.bootstrap/*.deb'):
if verbose:
print('I: Copying cache/packages.bootstrap/*.deb to chroot/var/cache/apt/archives/*.deb')
......@@ -147,7 +162,16 @@ def main():
for package in glob.glob('chroot/var/cache/apt/archives/*.deb'):
shutil.move(package, 'cache/packages.bootstrap')
## stagefile
# stage cache
if not os.path.exists('cache/bootstrap'):
if verbose:
print('I: Copying chroot to cache/bootstrap')
# Notes:
# * there's no Python equivalent to 'cp -a' that handels both symlinks and device nodes properly.
cache = subprocess.call('cp -a chroot cache/bootstrap', shell=True)
# stagefile
os.makedirs('.build', exist_ok=True)
open('.build/bootstrap', 'w').close()
......
......@@ -25,11 +25,11 @@ import sys
def main():
## Parsing Arguments
arguments = argparse.ArgumentParser(
prog = 'lb bootstrap_hooks',
prog = 'lb bootstrap-hooks',
usage = '%(prog)s [arguments]',
description = '''live-build contains the components to build a live system from a configuration directory.
The bootstrap_hooks command executes hooks after the bootstrap stage.''',
epilog = 'See \'man lb_bootstrap_hooks\' for more information.',
The bootstrap-hooks command executes hook files after the bootstrap stage.''',
epilog = 'See \'man lb-bootstrap-hooks\' for more information.',
formatter_class = argparse.ArgumentDefaultsHelpFormatter
)
......@@ -41,12 +41,12 @@ def main():
# --verbose
verbose = args.verbose
## Executing hooks
## Calling bootstrap hooks
# stagefile
if os.path.isfile('.build/bootstrap_hooks'):
if os.path.isfile('.build/bootstrap-hooks'):
if verbose:
print('I: bootstrap_hooks already done - nothing to do')
print('I: bootstrap-hooks already done - nothing to do')
sys.exit(0)
......@@ -99,9 +99,9 @@ def main():
os.rmdir('chroot/live-build/config')
os.rmdir('chroot/live-build')
## stagefile
# stagefile
os.makedirs('.build', exist_ok=True)
open('.build/bootstrap_hooks', 'w').close()
open('.build/bootstrap-hooks', 'w').close()
if __name__ == '__main__':
......
#!/usr/bin/python3
## live-build(7) - Live System Build Components
## Copyright (C) 2006-2013 Daniel Baumann <mail@daniel-baumann.ch>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
import argparse
import configparser
import glob
import os
import shutil
import subprocess
import sys
# TODO:
# * logfile output
# * lockfile handling
# * use gettext for i18n
def main():
## Parsing Arguments
arguments = argparse.ArgumentParser(
prog = 'lb bootstrap-includes',
usage = '%(prog)s [arguments]',
description = '''live-build contains the components to build a live system from a configuration directory.
The bootstrap-includes command copies include files into the bootstrap stage.''',
epilog = 'See \'man lb-bootstrap-includes\' for more information.',
formatter_class = argparse.ArgumentDefaultsHelpFormatter
)
arguments.add_argument('--version', help='show program\'s version number and exit', action='version', version='live-build 4')
arguments.add_argument('--verbose', help='set verbose option', action='store_true')
args = arguments.parse_args()
# --verbose
verbose = args.verbose
## Copying bootstrap includes
# stagefile
if os.path.isfile('.build/bootstrap-includes'):
if verbose:
print('I: bootstrap-includes already done - nothing to do')
sys.exit(0)
# dependencies
if not os.path.isfile('.build/bootstrap'):
print('E: bootstrap stage missing - aborting', file=sys.stderr)
if verbose:
print('I: use \'lb bootstrap\' to bootstrap system')
sys.exit(1)
if not os.path.isfile('/bin/cpio'):
print('E: /bin/cpio - no such file', file=sys.stderr)
if verbose:
print('I: cpio can be obtained from:\n'
'I: http://www.gnu.org/software/cpio/\n'
'I: http://ftp.gnu.org/gnu/cpio/\n'
'I: On Debian based systems, cpio can be installed with:\n'
'I: # sudo apt-get install cpio')
sys.exit(1)
# includes
if not glob.glob('config/includes/*') and not glob.glob('config/includes/.*') and not glob.glob('config/includes.bootstrap/*') and not glob.glob('config/includes.bootstrap/.*'):
if verbose:
print ('I: no bootstrap includes found at config/includes{,.bootstrap} - nothing to do')
sys.exit(0)
# process includes
if glob.glob('config/includes/*') or glob.glob('config/includes/.*'):
hooks = glob.glob('config/includes/*') + glob.glob('config/includes/.*')
if verbose:
print('I: Copying config/includes to chroot')
cpio = subprocess.call('cd config/includes && find . | cpio -dmpu --no-preserve-owner ../../chroot', shell=True)
if glob.glob('config/includes.bootstrap/*') and not glob.glob('config/includes.bootstrap/.*'):
hooks = glob.glob('config/includes.bootstrap/*') + glob.glob('config/includes.bootstrap/.*')
if verbose:
print('I: Copying config/includes.bootstrap to chroot')
cpio = subprocess.call('cd config/includes.bootstrap && find . | cpio -dmpu --no-preserve-owner ../../chroot', shell=True)
# stagefile
os.makedirs('.build', exist_ok=True)
open('.build/bootstrap-includes', 'w').close()
if __name__ == '__main__':
main()
......@@ -25,11 +25,11 @@ import sys
def main():
## Parsing Arguments
arguments = argparse.ArgumentParser(
prog = 'lb chroot_hooks',
prog = 'lb chroot-hooks',
usage = '%(prog)s [arguments]',
description = '''live-build contains the components to build a live system from a configuration directory.
The chroot_hooks command executes hooks after the chroot stage.''',
epilog = 'See \'man lb_chroot_hooks\' for more information.',
The chroot-hooks command executes hook files after the chroot stage.''',
epilog = 'See \'man lb-chroot-hooks\' for more information.',
formatter_class = argparse.ArgumentDefaultsHelpFormatter
)
......@@ -41,12 +41,12 @@ def main():
# --verbose
verbose = args.verbose
## Executing hooks
## Calling chroot hooks
# stagefile
if os.path.isfile('.build/chroot_hooks'):
if os.path.isfile('.build/chroot-hooks'):
if verbose:
print('I: chroot_hooks already done - nothing to do')
print('I: chroot-hooks already done - nothing to do')
sys.exit(0)
......@@ -99,9 +99,9 @@ def main():
os.rmdir('chroot/live-build/config')
os.rmdir('chroot/live-build')
## stagefile
# stagefile
os.makedirs('.build', exist_ok=True)
open('.build/chroot_hooks', 'w').close()
open('.build/chroot-hooks', 'w').close()
if __name__ == '__main__':
......
#!/usr/bin/python3
## live-build(7) - Live System Build Components
## Copyright (C) 2006-2013 Daniel Baumann <mail@daniel-baumann.ch>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
import argparse
import configparser
import glob
import os
import shutil
import subprocess
import sys
# TODO:
# * logfile output
# * lockfile handling
# * use gettext for i18n
def main():
## Parsing Arguments
arguments = argparse.ArgumentParser(
prog = 'lb chroot-includes',
usage = '%(prog)s [arguments]',
description = '''live-build contains the components to build a live system from a configuration directory.
The chroot-includes command copies include files into the chroot stage.''',
epilog = 'See \'man lb-chroot-includes\' for more information.',
formatter_class = argparse.ArgumentDefaultsHelpFormatter
)
arguments.add_argument('--version', help='show program\'s version number and exit', action='version', version='live-build 4')
arguments.add_argument('--verbose', help='set verbose option', action='store_true')
args = arguments.parse_args()
# --verbose
verbose = args.verbose
## Copying chroot includes
# stagefile
if os.path.isfile('.build/chroot-includes'):
if verbose:
print('I: chroot-includes already done - nothing to do')
sys.exit(0)
# dependencies
if not os.path.isfile('.build/bootstrap'):
print('E: bootstrap stage missing - aborting', file=sys.stderr)
if verbose:
print('I: use \'lb bootstrap\' to bootstrap system')
sys.exit(1)
if not os.path.isfile('/bin/cpio'):
print('E: /bin/cpio - no such file', file=sys.stderr)
if verbose:
print('I: cpio can be obtained from:\n'
'I: http://www.gnu.org/software/cpio/\n'
'I: http://ftp.gnu.org/gnu/cpio/\n'
'I: On Debian based systems, cpio can be installed with:\n'
'I: # sudo apt-get install cpio')
sys.exit(1)
# includes
if not glob.glob('config/includes/*') and not glob.glob('config/includes/.*') and not glob.glob('config/includes.chroot/*') and not glob.glob('config/includes.chroot/.*'):
if verbose:
print ('I: no chroot includes found at config/includes{,.chroot} - nothing to do')
sys.exit(0)
# process includes
if glob.glob('config/includes/*') or glob.glob('config/includes/.*'):
hooks = glob.glob('config/includes/*') + glob.glob('config/includes/.*')
if verbose:
print('I: Copying config/includes to chroot')
cpio = subprocess.call('cd config/includes && find . | cpio -dmpu --no-preserve-owner ../../chroot', shell=True)
if glob.glob('config/includes.chroot/*') and not glob.glob('config/includes.chroot/.*'):
hooks = glob.glob('config/includes.chroot/*') + glob.glob('config/includes.chroot/.*')
if verbose:
print('I: Copying config/includes.chroot to chroot')
cpio = subprocess.call('cd config/includes.chroot && find . | cpio -dmpu --no-preserve-owner ../../chroot', shell=True)
# stagefile
os.makedirs('.build', exist_ok=True)
open('.build/chroot-includes', 'w').close()
if __name__ == '__main__':
main()
......@@ -25,11 +25,11 @@ import sys
def main():
## Parsing Arguments
arguments = argparse.ArgumentParser(
prog = 'lb source_hooks',
prog = 'lb source-hooks',
usage = '%(prog)s [arguments]',
description = '''live-build contains the components to build a live system from a configuration directory.
The source_hooks command executes hooks after the source stage.''',
epilog = 'See \'man lb_source_hooks\' for more information.',
The source-hooks command executes hook files after the source stage.''',
epilog = 'See \'man lb-source-hooks\' for more information.',
formatter_class = argparse.ArgumentDefaultsHelpFormatter
)
......@@ -41,12 +41,12 @@ def main():
# --verbose
verbose = args.verbose
## Executing hooks
## Calling source hooks
# stagefile
if os.path.isfile('.build/source_hooks'):
if os.path.isfile('.build/source-hooks'):
if verbose:
print('I: source_hooks already done - nothing to do')
print('I: source-hooks already done - nothing to do')