Skip to content
Snippets Groups Projects
Select Git revision
  • 07a2c835049d9cc5ab97f81783d275565fc91d52
  • master default protected
  • ws18
  • ss18
  • ws17
  • ss17
  • readme
  • offline_repo_integration
  • bash_sucks
  • ws15-final
  • ss15-final
  • ws14-final
  • ws14
13 results

customize_common

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    customize_common 721 B
    #!/bin/bash
    
    function patch_all()
    {
    	PATCH_DIR="$1"
    	TARGET_DIR="$2"
    
    	if [ ! -d "$PATCH_DIR" ]; then
    		echo "Nothing to patch here!"
    		return 0
    	fi
    	
    	if [ -z "$TARGET_DIR" ]; then
    		echo "No target directory given, assuming /"
    		TARGET_DIR="/"
    	fi
    
            echo "Patching $TARGET_DIR ..."
            for p in "$PATCH_DIR/"*
            do
                    cat "$p" | patch -d "$TARGET_DIR" -p1
            done
            echo "done."
    }
    
    function install_debs()
    {
            DEB_DIR="$1"
    
            if [ ! -d "$DEB_DIR" ]; then
                    echo "Nothing to install here!"
                    return 0
            fi
    
            for p in "$DEB_DIR/"*
            do
    		echo "installing $p..."
                    dpkg -i "$p"
    		echo "done."
            done
    }