#!/bin/bash
-set -o pipefail
-
cp /dev/null ../quilt-import.log
log()
{
log "$" $@
"$@" 2>&1 | tee -a ../quilt-import.log
+ [ ${PIPESTATUS[0]} -eq 0 ] || sh -i || {
+ [ -f "$sfile.orig" ] &&
+ mv -f "$sfile.orig" "$sfile"
+ exit 1
+ }
}
quilters=$(grep -v '^#' ../real_control | awk -F ' ' '$2=="quilt" { print $3; }')
}
git show-ref --quiet --verify "refs/heads/quilt/$name" ||
- execute git branch "quilt/$name" "$rbase" || sh -i || {
- [ -f "$sfile.orig" ] &&
- mv -f "$sfile.orig" "$sfile"
- exit 1
- }
+ execute git branch "quilt/$name" "$rbase"
mv -f "$sfile" "$sfile.tmp"
sed -e '/^[ ]*$/d' -e '^[ ]*#/d' <"$sfile.tmp" >"$sfile"
continue
}
- execute git checkout "quilt/$name" || sh -i || {
- [ -f "$sfile.orig" ] &&
- mv -f "$sfile.orig" "$sfile"
- exit 1
- }
- execute git reset --hard "$rbase" || sh -i || {
- [ -f "$sfile.orig" ] &&
- mv -f "$sfile.orig" "$sfile"
- exit 1
- }
+ execute git checkout "quilt/$name"
+ execute git reset --hard "$rbase"
author=$(grep -v '^#' ../real_control | awk -F ' ' '$3=="'"$name"'" { printf("%s", $1); }' | sed 's/,.*$//')
- execute git quiltimport --author "$author" --patches "../quilt/$name" || sh -i || {
- [ -f "$sfile.orig" ] &&
- mv -f "$sfile.orig" "$sfile"
- exit 1
- }
+ execute git quiltimport --author "$author" --patches "../quilt/$name"
[ -f "$sfile.orig" ] &&
mv -f "$sfile.orig" "$sfile"