From e81f07831ea2abaf5b9d04bc062a72d6511b45e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20H=C3=B6glund?= Date: Wed, 29 Mar 2017 11:51:45 +0200 Subject: [PATCH] Remove dirname from exported patches --- iop/scripts/extract_core.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/iop/scripts/extract_core.sh b/iop/scripts/extract_core.sh index 847d71888..76f26e5b0 100755 --- a/iop/scripts/extract_core.sh +++ b/iop/scripts/extract_core.sh @@ -46,7 +46,16 @@ function extract_core { # Generate patches from start of openwrt repo. mkdir -p patches repo=$(basename $path) - git format-patch $initial_commit $path -o patches + dir=$(dirname $path) + git format-patch $initial_commit $path -o patches #> /dev/null + + # Remove dirname from patches to commit the packages to the + # top directory in the destination repo. + ls patches | while read line; do + sdir=$(echo "$dir/" | sed 's/\//\\\//g') + sed -i "s/$sdir//g" patches/$line + done + cd $import_repo if [ -n "$(git rev-parse -q --verify remotes/origin/$repo)" ]; then