[ostree] ostbuild: Rename osbuild to ostbuild, clean up old C files



commit fa06a4dcea5402b57ab7de83cefe471ac6b4d78b
Author: Colin Walters <walters verbum org>
Date:   Fri Nov 25 12:00:16 2011 -0500

    ostbuild: Rename osbuild to ostbuild, clean up old C files

 Makefile-osbuild.am => Makefile-ostbuild.am        |    6 +-
 Makefile.am                                        |    2 +-
 src/osbuild/main.c                                 |  108 -----------
 src/osbuild/ob-builtin-buildone.c                  |  142 ---------------
 src/osbuild/ob-builtins.h                          |   44 -----
 src/osbuild/osbuild-raw-makeinstall.c              |  188 --------------------
 src/ostbuild/ostbuild-chroot                       |   13 ++
 src/ostbuild/ostbuild-fetch                        |    8 +
 .../ostree-buildone => ostbuild/ostbuild-one}      |   29 ++--
 .../ostbuild-one-make}                             |    0
 .../ostbuild-one-makeinstall-split-artifacts}      |    1 +
 11 files changed, 37 insertions(+), 504 deletions(-)
---
diff --git a/Makefile-osbuild.am b/Makefile-ostbuild.am
similarity index 84%
rename from Makefile-osbuild.am
rename to Makefile-ostbuild.am
index 8c2b1bd..5f7c28f 100644
--- a/Makefile-osbuild.am
+++ b/Makefile-ostbuild.am
@@ -15,7 +15,7 @@
 # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 # Boston, MA 02111-1307, USA.
 
-bin_SCRIPTS += src/osbuild/ostree-buildone \
-	src/osbuild/ostree-buildone-make \
-	src/osbuild/ostree-buildone-makeinstall-split-artifacts \
+bin_SCRIPTS += src/ostbuild/ostbuild-one \
+	src/ostbuild/ostbuild-one-make \
+	src/ostbuild/ostbuild-one-makeinstall-split-artifacts \
 	$(NULL)
diff --git a/Makefile.am b/Makefile.am
index 8cfa59f..4fae1fb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -33,5 +33,5 @@ include Makefile-daemon.am
 include Makefile-otutil.am
 include Makefile-libostree.am
 include Makefile-ostree.am
-include Makefile-osbuild.am
+include Makefile-ostbuild.am
 include Makefile-triggers.am
diff --git a/src/ostbuild/ostbuild-chroot b/src/ostbuild/ostbuild-chroot
new file mode 100755
index 0000000..2353798
--- /dev/null
+++ b/src/ostbuild/ostbuild-chroot
@@ -0,0 +1,13 @@
+#!/usr/bin/python
+
+import os,sys,re,subprocess
+
+chroot_path=sys.argv[1]
+
+proc_path=os.path.join(chroot_path, 'proc')
+subprocess.check_call(['mount', '-t', 'proc', 'proc', proc_path])
+
+subprocess.call(['chroot', chroot_path])
+
+subprocess.check_call(['umount', proc_path])
+
diff --git a/src/ostbuild/ostbuild-fetch b/src/ostbuild/ostbuild-fetch
new file mode 100755
index 0000000..2c3f857
--- /dev/null
+++ b/src/ostbuild/ostbuild-fetch
@@ -0,0 +1,8 @@
+#!/usr/bin/python
+#
+# Copyright 2011 Colin Walters <walters verbum org>
+# Licensed under the new-BSD license (http://www.opensource.org/licenses/bsd-license.php)
+
+import os,sys,subprocess,tempfile,re
+
+for 
diff --git a/src/osbuild/ostree-buildone b/src/ostbuild/ostbuild-one
old mode 100644
new mode 100755
similarity index 89%
rename from src/osbuild/ostree-buildone
rename to src/ostbuild/ostbuild-one
index 2f2fc6d..252870b
--- a/src/osbuild/ostree-buildone
+++ b/src/ostbuild/ostbuild-one
@@ -1,18 +1,11 @@
 #!/usr/bin/python
 #
-# ostree-buildone:
 # Copyright 2010, 2011 Colin Walters <walters verbum org>
 # Licensed under the new-BSD license (http://www.opensource.org/licenses/bsd-license.php)
 
 # The build output is automatically logged to $TMPDIR/build-$(PWD).log.
 # For example, invoking metabuild in a directory named "foo" will log
 # to /tmp/build-foo.log
-#
-# You can pass arguments to metabuild; if they start with '--', they're
-# given to configure.  Otherwise, they're passed to make.
-#
-# $ metabuild --enable-libfoo  # passed to configure
-# $ metabuild -j 1             # passed to make
 
 import os,sys,subprocess,tempfile,re
 import select,time,stat,fcntl
@@ -38,7 +31,7 @@ except OSError, e:
     pass
 
 warning_re = re.compile(r'(: ((warning)|(error)|(fatal error)): )|(make(\[[0-9]+\])?: \*\*\*)')
-output_whitelist_re = re.compile(r'^(make(\[[0-9]+\])?: Entering directory)|(ostree-build )')
+output_whitelist_re = re.compile(r'^(make(\[[0-9]+\])?: Entering directory)|(ostbuild )')
 
 _bold_sequence = None
 _normal_sequence = None
@@ -179,7 +172,7 @@ class OutputFilter(object):
         f = open(logfile_path)
         lines = []
         for line in f:
-            if line.startswith('ostree-build '):
+            if line.startswith('ostbuild '):
                 continue
             lines.append(line)
             if len(lines) > _last_line_limit:
@@ -218,15 +211,15 @@ class OutputFilter(object):
         if not successful:
             self._write_last_log_lines()
             pass
-        self.output.write("ostree-build %s: %d warnings\n" % ('success' if successful else _bold('failed'),
+        self.output.write("ostbuild %s: %d warnings\n" % ('success' if successful else _bold('failed'),
                                                             self._warning_count, ))
-        self.output.write("ostree-build: full log path: %s\n" % (logfile_path, ))
+        self.output.write("ostbuild: full log path: %s\n" % (logfile_path, ))
         
         if successful:
             for f in os.listdir('_build'):
                 path = os.path.join('_build', f)
                 if f.startswith('artifact-'):
-                    self.output.write("ostree-build: created artifact: %s\n" % (f, ))
+                    self.output.write("ostbuild: created artifact: %s\n" % (f, ))
         sys.exit(0 if successful else 1)
 
 def _on_makeinstall_exit(pid, estatus):
@@ -235,7 +228,7 @@ def _on_makeinstall_exit(pid, estatus):
 def _on_make_exit(pid, estatus):
     if estatus == 0:
         args = list(subprocess_nice_args)
-        args.append('ostree-buildone-makeinstall-split-artifacts')
+        args.append('ostbuild-one-makeinstall-split-artifacts')
         _logfile_f.write("Running: %r\n" % (args, ))
         _logfile_f.flush()
         proc = subprocess.Popen(args, stdin=devnull, stdout=logfile_write_fd, stderr=logfile_write_fd)
@@ -245,7 +238,7 @@ def _on_make_exit(pid, estatus):
 
 def _get_version():
     if not os.path.isdir('.git'):
-        sys.stderr.write("ostree-buildone: error: Couldn't find .git directory")
+        sys.stderr.write("ostbuild-one: error: Couldn't find .git directory")
         sys.exit(1)
 
     proc = subprocess.Popen(['git', 'describe'], stdout=subprocess.PIPE)
@@ -253,7 +246,7 @@ def _get_version():
     if proc.wait() != 0:
         proc = subprocess.Popen(['git', 'rev-parse', 'HEAD'], stdout=subprocess.PIPE)
         if proc.wait() != 0:
-            sys.stderr.write("ostree-buildone: error: git rev-parse HEAD failed")
+            sys.stderr.write("ostbuild-one: error: git rev-parse HEAD failed")
             sys.exit(1)
         output = proc.communicate()[0].strip()
     return output
@@ -263,7 +256,7 @@ if __name__ == '__main__':
     if user_tmpdir is None:
         user_tmpdir = os.path.join(os.environ.get('TMPDIR', '/tmp'), 'metabuild-%s' % (os.getuid(), ))
     else:
-        user_tmpdir = os.path.join(user_tmpdir, 'ostree-build') 
+        user_tmpdir = os.path.join(user_tmpdir, 'ostbuild') 
 
     os.environ['OSBUILD_VERSION'] = _get_version()
 
@@ -283,7 +276,7 @@ if __name__ == '__main__':
     logfile_write_fd = os.open(logfile_path, os.O_WRONLY | os.O_CREAT | os.O_EXCL)
     global _logfile_f
     _logfile_f = os.fdopen(logfile_write_fd, "w")
-    sys.stdout.write('ostree-build: logging to %r\n' % (logfile_path, ))
+    sys.stdout.write('ostbuild: logging to %r\n' % (logfile_path, ))
     sys.stdout.flush()
 
     global _output_filter
@@ -291,7 +284,7 @@ if __name__ == '__main__':
     _output_filter.start()
 
     args = list(subprocess_nice_args)
-    args.append('ostree-buildone-make')
+    args.append('ostbuild-one-make')
     args.extend(sys.argv[1:])
     devnull=open('/dev/null')
     _logfile_f.write("Running: %r\n" % (args, ))
diff --git a/src/osbuild/ostree-buildone-make b/src/ostbuild/ostbuild-one-make
old mode 100644
new mode 100755
similarity index 100%
rename from src/osbuild/ostree-buildone-make
rename to src/ostbuild/ostbuild-one-make
diff --git a/src/osbuild/ostree-buildone-makeinstall-split-artifacts b/src/ostbuild/ostbuild-one-makeinstall-split-artifacts
old mode 100644
new mode 100755
similarity index 98%
rename from src/osbuild/ostree-buildone-makeinstall-split-artifacts
rename to src/ostbuild/ostbuild-one-makeinstall-split-artifacts
index 85167a5..1d7b9d3
--- a/src/osbuild/ostree-buildone-makeinstall-split-artifacts
+++ b/src/ostbuild/ostbuild-one-makeinstall-split-artifacts
@@ -91,6 +91,7 @@ def make_artifact(name, from_files):
     tempfiles.append(filelist_temp)
     f = open(filelist_temp, 'w')
     for filename in from_files:
+        assert ('\n' not in filename)
         f.write(filename)
         f.write('\n')
     f.close()



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]