FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
VulkanTutorial/code/incremental_patch.sh at main · Overv/VulkanTutorial · GitHub
Overv
/
VulkanTutorial
Public
Notifications
You must be signed in to change notification settings
Fork
568
Star
3.7k
Code
Issues
69
Pull requests
7
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
VulkanTutorial
/
code
/
incremental_patch.sh
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
31 lines (25 loc) · 818 Bytes
Breadcrumbs
VulkanTutorial
/
code
/
incremental_patch.sh
Copy path
File metadata and controls
executable file
·
31 lines (25 loc) · 818 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!
/bin/sh
#
Check if both a starting file and patch are provided
if
[
$#
!=
2 ]
;
then
echo
"
usage: <first_file.cpp> <patch.txt>
"
echo
"
specified patch will be applied to first_file.cpp and every code file larger than it (from later chapters)
"
exit
1
fi
#
Iterate over code files in order of increasing size
#
i.e. in order of chapters (every chapter adds code)
apply_patch=false
for
f
in
`
ls -Sr
*
.cpp
`
do
#
Apply patch on every code file including and after initial one
if
[
$f
=
$1
]
||
[
$apply_patch
=
true
]
;
then
apply_patch=true
patch -f
$f
<
$2
|
grep -q
"
FAILED
"
>
/dev/null
if
[
$?
=
0 ]
;
then
echo
"
failed to apply patch to
$f
"
exit
1
fi
rm -f
*
.orig
fi
done
echo
"
patch successfully applied to all files
"
exit
0
Back
|
FazBrowse Home
|
New Git URL