Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
nvidia-patch
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
nvidia-patch
Commits
8eb2b50a
Commit
8eb2b50a
authored
Oct 22, 2019
by
Vladislav Yarmak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ap: ensure only one occurence
parent
0ea72270
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
win/tools/autopatch/autopatch.py
win/tools/autopatch/autopatch.py
+6
-1
No files found.
win/tools/autopatch/autopatch.py
View file @
8eb2b50a
...
...
@@ -59,6 +59,9 @@ class ExtractException(Exception):
class
PatternNotFoundException
(
Exception
):
pass
class
MultipleOccurencesException
(
Exception
):
pass
class
UnknownPlatformException
(
Exception
):
pass
...
...
@@ -130,9 +133,11 @@ def make_patch(archive, *,
sevenzip
=
sevenzip
)
as
tgt
:
f
=
expand
(
tgt
,
sevenzip
=
sevenzip
)
offset
=
f
.
find
(
search
)
del
f
if
offset
==
-
1
:
raise
PatternNotFoundException
(
"Pattern not found."
)
if
f
[
offset
+
len
(
search
):]
.
find
(
search
)
!=
-
1
:
raise
MultipleOccurencesException
(
"Multiple occurences of pattern found!"
)
del
f
print
(
"Pattern found @
%016
X"
%
(
offset
,),
file
=
sys
.
stderr
)
res
=
[]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment