Преглед изворни кода

allow changing the location in which the chroot environments are created

Also document the fact they are created in /opt/wkhtmltopdf-build by
default, which was requested in #1713
Ashish Kulkarni пре 11 година
родитељ
комит
c3d2b2ca8f
2 измењених фајлова са 9 додато и 1 уклоњено
  1. 7 0
      INSTALL.md
  2. 2 1
      scripts/build.py

+ 7 - 0
INSTALL.md

@@ -22,6 +22,13 @@ CentOS 6       | ```sudo scripts/build.py setup-schroot-centos6```
 CentOS 5       | ```sudo scripts/build.py setup-schroot-centos5```
 CentOS 5       | ```sudo scripts/build.py setup-schroot-centos5```
 MinGW-w64      | ```sudo scripts/build.py setup-mingw-w64```
 MinGW-w64      | ```sudo scripts/build.py setup-mingw-w64```
 
 
+The above commands will create the chroot directory under the directory
+`/opt/wkhtmltopdf-build` -- you can change it to some other directory
+by running `export WKHTMLTOX_CHROOT=/some/other/dir` before running the
+above command to create the chroot environment in the specified location.
+At least 1GB of disk space for each target should be available at the 
+above location, or else the process may fail due to insufficient disk space.
+
 Please note that you should run the above commands while logged in as a
 Please note that you should run the above commands while logged in as a
 regular user who has ```sudo``` access and that the cloned respository
 regular user who has ```sudo``` access and that the cloned respository
 should be in the user's home directory e.g. ```~/wkhtmltopdf```. **Do
 should be in the user's home directory e.g. ```~/wkhtmltopdf```. **Do

+ 2 - 1
scripts/build.py

@@ -427,7 +427,8 @@ def build_setup_schroot(config, basedir):
     chroot = config[1+config.rindex('-'):]
     chroot = config[1+config.rindex('-'):]
     for arch in ARCH:
     for arch in ARCH:
         print '******************* %s-%s' % (chroot, arch)
         print '******************* %s-%s' % (chroot, arch)
-        root_dir = '/opt/wkhtmltopdf-build/%s-%s' % (chroot, arch)
+        base_dir = os.environ.get('WKHTMLTOX_CHROOT') or '/opt/wkhtmltopdf-build'
+        root_dir = os.path.join(base_dir, '%s-%s' % (chroot, arch))
         rmdir(root_dir)
         rmdir(root_dir)
         mkdir_p(root_dir)
         mkdir_p(root_dir)
         for command in CHROOT_SETUP[chroot]:
         for command in CHROOT_SETUP[chroot]: