updated busybox
[kvm-coreboot.git] / bin / doquilt.sh
blobdfeee5b8ad7fada50464b9fa614ac242ed0db2dc
1 #!/bin/bash
2 # This script sets up the quilt directory and patches the package
4 DIR=$1; shift
6 # if the .pc directory already exists, then we will boldy assume
7 # that quilt has been previously applied. Aggressively restore the tree
8 # to pristine
10 if [ -d $DIR/.pc ]; then
11 pushd $DIR > /dev/null
12 quilt pop -qaf > /dev/null 2>&1
13 popd > /dev/null
16 mkdir -p $DIR/patches
17 echo "# $DIR quilt series" > $DIR/patches/series
19 # If there are no patches to apply, fail cleanly
21 if [ $# -eq 0 ]; then
22 exit 0
25 # Sometimes the patch order matches. In that case, we can pass the entire patch subdirectory
26 # to this script as the second argument, and we'll copy it into $DIR/patches/
27 if [ -d $1 ]; then
28 cp -pr $1/* $DIR/patches/
29 shift
32 while [ $# -gt 0 ]; do
33 echo `basename $1` >> $DIR/patches/series
34 cp $1 $DIR/patches
35 shift
36 done
38 cd $DIR
39 quilt push -qa