bromite-buildtools/apply-all-patch.sh

76 lines
2.0 KiB
Bash
Raw Normal View History

2020-11-26 13:23:00 +05:30
#!/bin/bash
git am --abort
2021-04-28 16:32:53 +05:30
PATCH_OLD_PATH=~/bromite/build/patches
PATCH_NEW_PATH=~/bromite/build/patches-new
2020-11-26 13:23:00 +05:30
DESTINATION=~/bromite/build/bromite_patches_list_ok.txt
DESTINATION_FAILED=~/bromite/build/bromite_patches_list_failed.txt
rm $DESTINATION
rm $DESTINATION_FAILED
mkdir $PATCH_NEW_PATH
IFS=$'\n'
2021-04-28 16:32:53 +05:30
PATCH_LIST=~/bromite/build/bromite_patches_list_new.txt
if [ ! -f $PATCH_LIST ]; then
cp ~/bromite/build/bromite_patches_list.txt $PATCH_LIST
fi
2020-11-26 13:23:00 +05:30
echo "Phase 1: check clean"
2021-04-28 16:32:53 +05:30
for current_file in $(cat $PATCH_LIST); do
if [[ $current_file =~ ^#.* ]]; then
echo "Executing $current_file"
eval "${current_file:1}"
echo $current_file >>$DESTINATION
elif [[ $current_file =~ ^-.* ]]; then
echo "Skipping $current_file"
elif [[ $current_file =~ ^=.* ]]; then
echo "Adding $current_file"
echo "Executing bash ~/create-from-patch.sh $PATCH_OLD_PATH/${current_file:1} $PATCH_NEW_PATH"
2021-07-31 17:45:32 +05:30
bash ~/bromite-buildtools/create-from-patch.sh $PATCH_OLD_PATH/${current_file:1} $PATCH_NEW_PATH
2021-04-28 16:32:53 +05:30
2021-07-31 17:45:32 +05:30
#echo "Press return"
#read -n 1
2021-04-28 16:32:53 +05:30
elif [[ $current_file =~ ^1.* ]]; then
echo "Using new path $current_file"
2021-07-31 17:45:32 +05:30
bash ~/bromite-buildtools/apply-single-patch.sh $PATCH_NEW_PATH/${current_file:1} $PATCH_NEW_PATH
2021-04-28 16:32:53 +05:30
echo ""
LAST_COMMIT=$(git rev-parse HEAD)
echo "Last Commit " $LAST_COMMIT
2021-07-31 17:45:32 +05:30
bash ~/bromite-buildtools/export-single-patch.sh $LAST_COMMIT
2021-04-28 16:32:53 +05:30
else
2020-11-26 13:23:00 +05:30
2021-07-31 17:45:32 +05:30
bash ~/bromite-buildtools/apply-single-patch.sh $PATCH_OLD_PATH/$current_file $PATCH_NEW_PATH
2020-11-26 13:23:00 +05:30
2021-04-28 16:32:53 +05:30
echo $current_file >>$DESTINATION
echo $PATCH_FILE
2020-11-26 13:23:00 +05:30
2021-04-28 16:32:53 +05:30
echo ""
LAST_COMMIT=$(git rev-parse HEAD)
echo "Last Commit " $LAST_COMMIT
2021-07-31 17:45:32 +05:30
bash ~/bromite-buildtools/export-single-patch.sh $LAST_COMMIT
2020-11-26 13:23:00 +05:30
2021-04-28 16:32:53 +05:30
#cp -r ~/bromite/build/patches-new/* ~/br2/bromite/build/patches/
#git -C ~/br2/bromite/ add .
#git -C ~/br2/bromite/ commit -m "$current_file"
2020-11-26 13:23:00 +05:30
2021-04-28 16:32:53 +05:30
fi
2020-11-26 13:23:00 +05:30
done