<commit_before>#!/bin/bash

COMPRESSED_BIN=$(which mkisofs)
BASE_DIR=[[WORKING_DIRECTORY]]

function create_chroot_env {
  CHROOT_DIR=$1
  
  mkdir -p $CHROOT_DIR
  mkdir -p $CHROOT_DIR/{home,etc,bin,lib,usr,usr/bin,dev,tmp,proc}
  
  cd $CHROOT_DIR
  
  if [ -d /lib64 ]; then
    mkdir -p lib64/ >/dev/null 2>&1
  fi
  if [ ! -e dev/null ]; then
    mknod dev/null c 1 3 >/dev/null 2>&1
  fi
  if [ ! -e dev/zero ]; then
    mknod dev/zero c 1 5 >/dev/null 2>&1
  fi
}
function install_from_files {  
  GEM_FILE=$1/.gems
  if [ -f $GEM_FILE ]; then
    for line in $(cat $1/.gems); do
      gem install $line --no-ri --no-rdoc; 
    done
  fi
}

function clean_git_repos {
	# cleanup
	rm -rf $1/.git
}

function build_from_env {
	APP_NAME=$1
	OUTFILE=$2
	
	APP_DIR=[[WORKING_DIRECTORY]]/$APP_NAME	
  GIT_REPOS=$APP_DIR/home/app
  
  create_chroot_env $APP_DIR
  
  # Install from files
	clean_git_repos $GIT_REPOS
  install_from_files $GIT_REPOS
	
  # Make the squashfs filesystem
	mkisofs -o $OUTFILE $APP_DIR
	
	if [ $? != 0 ]; then
		exit 1
	fi<commit_msg>Changed to mksquashfs for create_bee.sh script<commit_after>#!/bin/sh

BASE_DIR=[[WORKING_DIRECTORY]]

function create_chroot_env {
  CHROOT_DIR=$1
  
  mkdir -p $CHROOT_DIR
  mkdir -p $CHROOT_DIR/{home,etc,bin,lib,usr,usr/bin,dev,tmp,proc}
  
  cd $CHROOT_DIR
  
  if [ -d /lib64 ]; then
    mkdir -p lib64/ >/dev/null 2>&1
  fi
  if [ ! -e dev/null ]; then
    mknod dev/null c 1 3 >/dev/null 2>&1
  fi
  if [ ! -e dev/zero ]; then
    mknod dev/zero c 1 5 >/dev/null 2>&1
  fi
}
function install_from_files {  
  GEM_FILE=$1/.gems
  if [ -f $GEM_FILE ]; then
    for line in $(cat $1/.gems); do
      gem install $line --no-ri --no-rdoc; 
    done
  fi
}

function clean_git_repos {
	# cleanup
	rm -rf $1/.git
}

function build_from_env {
	APP_NAME=$1
	OUTFILE=$2
	
	APP_DIR=[[WORKING_DIRECTORY]]/$APP_NAME	
  GIT_REPOS=$APP_DIR/home/app
	
  create_chroot_env $APP_DIR
  
  # Install from files
	clean_git_repos $GIT_REPOS
  install_from_files $GIT_REPOS
	
  # Make the squashfs filesystem
	mksquashfs $APP_DIR $OUTFILE >/dev/null 2>&1
	
	if [ $? != 0 ]; then
		exit 1
	fi
{'fraction_non_alphanumeric': 0.12874531835205993, 'fraction_numerical': 0.02153558052434457, 'mean_word_length': 2.9283088235294117, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6503794', 'n_tokens_mistral': 962, 'n_tokens_neox': 899, 'n_words': 211}