diff --git a/bootstrapvz/plugins/minimize_size/assets/bootstrap-script.sh b/bootstrapvz/plugins/minimize_size/assets/bootstrap-script.sh index 4f5a2be..132dee2 100644 --- a/bootstrapvz/plugins/minimize_size/assets/bootstrap-script.sh +++ b/bootstrapvz/plugins/minimize_size/assets/bootstrap-script.sh @@ -6,7 +6,7 @@ extract_dpkg_deb_data () { local pkg="$1" - local excludes_file="/tmp/bootstrap-vz-excludes-$$" + local excludes_file="DEBOOTSTRAP_EXCLUDES_PATH" # List all files in $pkg and run them through the filter (avoid exit status >0 if no matches are found) dpkg-deb --fsys-tarfile "$pkg" | tar -t | BOOTSTRAP_FILES_FILTER_PATH > "$excludes_file" || true dpkg-deb --fsys-tarfile "$pkg" | tar --exclude-from "$excludes_file" -xf - diff --git a/bootstrapvz/plugins/minimize_size/tasks/dpkg.py b/bootstrapvz/plugins/minimize_size/tasks/dpkg.py index b927c3e..244ca97 100644 --- a/bootstrapvz/plugins/minimize_size/tasks/dpkg.py +++ b/bootstrapvz/plugins/minimize_size/tasks/dpkg.py @@ -43,10 +43,12 @@ class CreateBootstrapFilterScripts(Task): bootstrap_script = os.path.join(info.workspace, 'bootstrap_script.sh') filter_script = os.path.join(info.workspace, 'bootstrap_files_filter.sh') + excludes_file = os.path.join(info.workspace, 'debootstrap-excludes') shutil.copy(os.path.join(assets, 'bootstrap-script.sh'), bootstrap_script) shutil.copy(os.path.join(assets, 'bootstrap-files-filter.sh'), filter_script) + sed_i(bootstrap_script, r'DEBOOTSTRAP_EXCLUDES_PATH', excludes_file) sed_i(bootstrap_script, r'BOOTSTRAP_FILES_FILTER_PATH', filter_script) # We exclude with patterns but include with fixed strings