1#!/bin/bash 2# Copyright(c) 2023 Huawei Device Co., Ltd. 3 4set -e 5cd $1 6find . ! -path "*/\.*" ! -path "./patch*" ! \( -name glib-2.72.2.tar.xz\ 7 -o -name BUILD.gn\ 8 -o -name config.gni\ 9 -o -name install.sh\ 10 -o -name bundle.json\ 11 -o -name OAT.xml\ 12 -o -name README.OpenSource\ 13 -o -name glib2.spec\ 14 -o -name COPYING\ 15 -o -name backport-patch.log\ 16 -o -name "README*"\ 17 -o -name "NEWS*"\ 18 -o -name SECURITY.md\ 19 -o -name CONTRIBUTING.md\ 20 -o -name ".*" \)\ 21 -prune -print -exec rm -rf {} \; 22tar -xvf glib-2.72.2.tar.xz 23mv glib-2.72.2/* . 24rm -rf glib-2.72.2 25echo "reset working dir success" 26file="backport-patch.log" 27exec < $file 28while read line 29do 30 line=${line:16} 31 echo $line 32 patch -p1 < patch/$line --fuzz=0 --no-backup-if-mismatch 33done 34echo "all file patch success!" 35exit 0 36 37