36 lines
800 B
Bash
36 lines
800 B
Bash
#!/bin/bash
|
|
#
|
|
# Burn a recipe by applying all the patches over the current
|
|
# directory, commiting as we go.
|
|
#
|
|
# Example:
|
|
# (current directory is git://arago-project.org/git/projects/linux-am33x.git)
|
|
# bash ~/.../burn.sh \
|
|
# ~/.../sources/meta-ti/recipes-kernel/linux/linux-ti33x-psp_3.2.bb
|
|
#
|
|
# Michael Hope <michaelh@juju.net.nz>
|
|
#
|
|
|
|
set -e
|
|
|
|
for arg in $@; do
|
|
dir=`dirname $arg`
|
|
# Convert a foo_ver.bb to foo-ver
|
|
file=`basename $arg .bb | tr _ -`
|
|
|
|
# Grab anything that looks like file://foo.patch
|
|
for word in `cat $arg`; do
|
|
[[ $word =~ file.+patch ]] || continue
|
|
|
|
word=`echo $word | sed "s#file://##"`
|
|
patch=$dir/$file/$word
|
|
# Die if we can't find the patch
|
|
[ -f $patch ]
|
|
|
|
# Apply and commit
|
|
patch -p1 -t < $patch
|
|
git add .
|
|
git commit -m"Imported $word"
|
|
done
|
|
done
|