Adding sources-includes.
authorDaniel Baumann <mail@daniel-baumann.ch>
Mon, 4 Nov 2013 17:46:56 +0000 (18:46 +0100)
committerDaniel Baumann <mail@daniel-baumann.ch>
Mon, 4 Nov 2013 17:46:56 +0000 (18:46 +0100)
components/source-includes [copied from components/binary-includes with 67% similarity]
scripts/build/source

similarity index 67%
copy from components/binary-includes
copy to components/source-includes
index dfac8c7..39d0e82 100755 (executable)
@@ -21,16 +21,16 @@ import sys
 #   * logfile output
 #   * lockfile handling
 #   * use gettext for i18n
-#   * derefence or remove symlinks if binary filesystem does not support them
+#   * derefence or remove symlinks if source filesystem does not support them
 
 def main():
        ## Parsing Arguments
        arguments = argparse.ArgumentParser(
-               prog            = 'lb binary-includes',
+               prog            = 'lb source-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.',
+                                    The source-includes command copies include files into the source stage.''',
+               epilog          = 'See \'man lb-source-includes\' for more information.',
                formatter_class = argparse.ArgumentDefaultsHelpFormatter
        )
 
@@ -42,12 +42,12 @@ def main():
        # --verbose
        verbose = args.verbose
 
-       ## Copying binary includes
+       ## Copying source includes
 
        # stagefile
-       if os.path.isfile('.build/binary-includes'):
+       if os.path.isfile('.build/source-includes'):
                if verbose:
-                       print('I: binary-includes already done - nothing to do')
+                       print('I: source-includes already done - nothing to do')
 
                sys.exit(0)
 
@@ -73,9 +73,9 @@ def main():
                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 not glob.glob('config/includes/*') and not glob.glob('config/includes/.*') and not glob.glob('config/includes.source/*') and not glob.glob('config/includes.source/.*'):
                if verbose:
-                       print ('I: no binary includes found at config/includes.binary - nothing to do')
+                       print ('I: no source includes found at config/includes.source - nothing to do')
 
                sys.exit(0)
 
@@ -84,21 +84,21 @@ def main():
                hooks = glob.glob('config/includes/*') + glob.glob('config/includes/.*')
 
                if verbose:
-                       print('I: Copying config/includes to binary')
+                       print('I: Copying config/includes to source')
 
-               cpio = subprocess.call('cd config/includes && find . | cpio -dmpu --no-preserve-owner ../../binary', shell=True)
+               cpio = subprocess.call('cd config/includes && find . | cpio -dmpu --no-preserve-owner ../../source', 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 glob.glob('config/includes.source/*') and not glob.glob('config/includes.source/.*'):
+               hooks = glob.glob('config/includes.source/*') + glob.glob('config/includes.source/.*')
 
                if verbose:
-                       print('I: Copying config/includes.binary to binary')
+                       print('I: Copying config/includes.source to source')
 
-               cpio = subprocess.call('cd config/includes.binary && find . | cpio -dmpu --no-preserve-owner ../../binary', shell=True)
+               cpio = subprocess.call('cd config/includes.source && find . | cpio -dmpu --no-preserve-owner ../../source', shell=True)
 
        # stagefile
        os.makedirs('.build', exist_ok=True)
-       open('.build/binary-includes', 'w').close()
+       open('.build/source-includes', 'w').close()
 
 
 if __name__ == '__main__':
index d32cd44..3cdb0e0 100755 (executable)
@@ -51,6 +51,7 @@ lb chroot_archives source install ${@}
 lb source_live ${@}
 lb source_debian ${@}
 lb source_disk ${@}
+lb source-includes ${@}
 lb source-hooks ${@}
 lb source_checksums ${@}