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
9b5c28b2
Commit
9b5c28b2
authored
Oct 26, 2023
by
Jai Luthra
Committed by
Jai Luthra
Oct 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
autopatch: fix indent for local installer case
Signed-off-by:
Jai Luthra
<
me@jailuthra.in
>
parent
bb1d5351
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
40 deletions
+40
-40
win/tools/autopatch/autopatch.py
win/tools/autopatch/autopatch.py
+40
-40
No files found.
win/tools/autopatch/autopatch.py
View file @
9b5c28b2
...
@@ -238,47 +238,47 @@ def patch_flow(installer_file, search, replacement, target, target_name, patch_n
...
@@ -238,47 +238,47 @@ def patch_flow(installer_file, search, replacement, target, target_name, patch_n
print
(
f
"Invalid installer file or version: {installer_file}"
)
print
(
f
"Invalid installer file or version: {installer_file}"
)
return
return
# Rest of the code remains the same...
# Rest of the code remains the same...
patch
=
make_patch
(
installer_file
,
patch
=
make_patch
(
installer_file
,
arch_tgt
=
target
,
arch_tgt
=
target
,
search
=
search
,
search
=
search
,
replacement
=
replacement
,
replacement
=
replacement
,
tmpdir
=
tempdir
,
tmpdir
=
tempdir
,
sevenzip
=
sevenzip
,
sevenzip
=
sevenzip
,
direct
=
direct
)
direct
=
direct
)
patch_content
=
format_patch
(
patch
,
target_name
)
patch_content
=
format_patch
(
patch
,
target_name
)
if
stdout
:
if
stdout
:
sys
.
stdout
.
buffer
.
write
(
patch_content
)
sys
.
stdout
.
buffer
.
write
(
patch_content
)
elif
direct
:
elif
direct
:
with
open
(
patch_name
,
mode
=
'wb'
)
as
out
:
with
open
(
patch_name
,
mode
=
'wb'
)
as
out
:
out
.
write
(
patch_content
)
out
.
write
(
patch_content
)
else
:
version
,
product_type
=
identify_driver
(
installer_file
,
sevenzip
=
sevenzip
)
drv_prefix
=
{
"100"
:
"quadro_"
,
"103"
:
"quadro_"
,
"300"
:
""
,
"301"
:
"nsd_"
,
"303"
:
""
,
# DCH
"304"
:
"nsd_"
,
}
installer_name
=
os
.
path
.
basename
(
installer_file
)
.
lower
()
if
'winserv2008'
in
installer_name
or
'winserv-2012'
in
installer_name
:
os_prefix
=
'ws2012_x64'
elif
'winserv-2016'
in
installer_name
or
'win10'
in
installer_name
:
os_prefix
=
'win10_x64'
elif
'win7'
in
installer_name
:
os_prefix
=
'win7_x64'
else
:
else
:
version
,
product_type
=
identify_driver
(
installer_file
,
sevenzip
=
sevenzip
)
raise
UnknownPlatformException
(
f
"Can't infer platform from filename {installer_name}"
)
drv_prefix
=
{
"100"
:
"quadro_"
,
driver_name
=
drv_prefix
.
get
(
product_type
,
""
)
+
version
"103"
:
"quadro_"
,
out_dir
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)),
'..'
,
'..'
,
os_prefix
,
driver_name
)
"300"
:
""
,
os
.
makedirs
(
out_dir
,
0o755
,
exist_ok
=
True
)
"301"
:
"nsd_"
,
out_filename
=
os
.
path
.
join
(
out_dir
,
patch_name
)
"303"
:
""
,
# DCH
with
open
(
out_filename
,
'wb'
)
as
out
:
"304"
:
"nsd_"
,
out
.
write
(
patch_content
)
}
installer_name
=
os
.
path
.
basename
(
installer_file
)
.
lower
()
if
'winserv2008'
in
installer_name
or
'winserv-2012'
in
installer_name
:
os_prefix
=
'ws2012_x64'
elif
'winserv-2016'
in
installer_name
or
'win10'
in
installer_name
:
os_prefix
=
'win10_x64'
elif
'win7'
in
installer_name
:
os_prefix
=
'win7_x64'
else
:
raise
UnknownPlatformException
(
f
"Can't infer platform from filename {installer_name}"
)
driver_name
=
drv_prefix
.
get
(
product_type
,
""
)
+
version
out_dir
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)),
'..'
,
'..'
,
os_prefix
,
driver_name
)
os
.
makedirs
(
out_dir
,
0o755
,
exist_ok
=
True
)
out_filename
=
os
.
path
.
join
(
out_dir
,
patch_name
)
with
open
(
out_filename
,
'wb'
)
as
out
:
out
.
write
(
patch_content
)
def
main
():
def
main
():
...
...
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