Changes

Jump to navigation Jump to search
2,195 bytes added ,  18:26, 26 June 2015
Line 81: Line 81:  
             cmd = ['/bin/mount', '-n',
 
             cmd = ['/bin/mount', '-n',
 
                     '--bind', self.srcpath, self.bindpath ]
 
                     '--bind', self.srcpath, self.bindpath ]
 +
 +
* --[[User:Stephdl|Stephdl]] ([[User talk:Stephdl|talk]]) 18:26, 26 June 2015 (CEST) WIP
 +
save as mounts.py.20150626.daniel.berteaud.patch
 +
--- /usr/lib/python2.6/site-packages/mockbuild/mounts.py 2015-06-04 13:34:04.000000000 +0200
 +
+++ mounts.py 2015-06-26 18:05:53.924416540 +0200
 +
@@ -76,6 +76,9 @@
 +
 
 +
    @traceLog()
 +
    def mount(self):
 +
+        if not os.path.isdir(self.srcpath) and not os.path.isfile(self.srcpath):
 +
+            util.touch(self.bindpath)
 +
+
 +
        if not self.mounted:
 +
            cmd = ['/bin/mount', '-n',
 +
                    '--bind', self.srcpath, self.bindpath ]
 +
@@ -126,5 +129,9 @@
 +
            m.umount()
 +
 +
    @traceLog()
 +
+    def get_mounted(self):
 +
+        return [ m.mountpath for m in self.mounts if m.ismounted() ]
 +
+
 +
+    @traceLog()
 +
    def get_mountpoints(self):
 +
        return [ m.mountpath for m in self.mounts ]
 +
 +
then do
 +
sudo patch -N  /usr/lib/python2.6/site-packages/mockbuild/mounts.py < mounts.py.20150626.daniel.berteaud.patch
 +
 +
save as mount.py.20150626.daniel.berteaud.patch
 +
--- /usr/lib/python2.6/site-packages/mockbuild/plugins/mount.py 2015-06-04 13:34:04.000000000 +0200
 +
+++ mount.py 2015-06-26 18:05:53.921418037 +0200
 +
@@ -41,11 +41,11 @@
 +
        self.opts = conf
 +
        plugins.add_hook("preinit", self._mountPreInitHook)
 +
        for device, dest_dir, vfstype, mount_opts in self.opts['dirs']:
 +
-            builroot.mounts.add(FileSystemMountPoint(buildroot.make_chroot_path(dest_dir),
 +
+            buildroot.mounts.add(FileSystemMountPoint(buildroot.make_chroot_path(dest_dir),
 +
                                                    filetype=vfstype,
 +
                                                    device=device,
 +
                                                    options=mount_opts))
 +
    @traceLog()
 +
    def _mountPreInitHook(self):
 +
        for device, dest_dir, vfstype, mount_opts in self.opts['dirs']:
 +
-            mockbuild.util.mkdirIfAbsent(self.builroot.make_chroot_path(dest_dir))
 +
+            mockbuild.util.mkdirIfAbsent(self.buildroot.make_chroot_path(dest_dir))
 +
 +
then do
 +
sudo patch -N  /usr/lib/python2.6/site-packages/mockbuild/plugins/mount.py < mount.py.20150626.daniel.berteaud.patch
    
===Preparation for a new ISO release===
 
===Preparation for a new ISO release===

Navigation menu