Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
Hdlmake
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
15
Issues
15
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Hdlmake
Commits
d4aa732a
Commit
d4aa732a
authored
Nov 02, 2023
by
Petr Pacner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
another adjustments
parent
34d6cd9e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
21 deletions
+12
-21
shell.py
hdlmake/util/shell.py
+12
-21
No files found.
hdlmake/util/shell.py
View file @
d4aa732a
...
@@ -33,7 +33,7 @@ from os.path import join
...
@@ -33,7 +33,7 @@ from os.path import join
from
subprocess
import
PIPE
,
Popen
,
CalledProcessError
,
getstatusoutput
from
subprocess
import
PIPE
,
Popen
,
CalledProcessError
,
getstatusoutput
commands_os
=
'
auto
'
commands_os
=
''
set_of_commands
=
{}
set_of_commands
=
{}
test
=
""
test
=
""
...
@@ -57,10 +57,16 @@ def set_commands_os(name):
...
@@ -57,10 +57,16 @@ def set_commands_os(name):
if
test
==
'Windows'
and
status
:
if
test
==
'Windows'
and
status
:
logging
.
info
(
"windows version of commands"
)
logging
.
info
(
"windows version of commands"
)
set_of_commands
=
{
"del"
:
"del /s /q /f"
,
set_of_commands
=
{
"del"
:
"del /s /q /f"
,
"rmdir"
:
"rmdir /s /q"
,
"mkdir"
:
"mkdir"
,
"copy"
:
"copy"
,
"touch"
:
"type NUL >"
}
"touch"
:
"type NUL >"
}
else
:
else
:
logging
.
info
(
"linux version of commands"
)
logging
.
info
(
"linux version of commands"
)
set_of_commands
=
{
"del"
:
"rm -rf"
,
set_of_commands
=
{
"del"
:
"rm -rf"
,
"rmdir"
:
"rmdir -rf"
,
"copy"
:
"cp"
,
"mkdir"
:
"mkdir -p"
,
"touch"
:
"touch"
}
"touch"
:
"touch"
}
def
run
(
command
):
def
run
(
command
):
...
@@ -91,6 +97,7 @@ def tclpath(path):
...
@@ -91,6 +97,7 @@ def tclpath(path):
def
command_path
(
path
):
def
command_path
(
path
):
path_list
=
split
(
r'/|\\'
,
path
)
path_list
=
split
(
r'/|\\'
,
path
)
logging
.
debug
(
f
"joining path:{join(*path_list)}"
)
return
join
(
*
path_list
)
return
join
(
*
path_list
)
def
makefile_path
(
path
):
def
makefile_path
(
path
):
...
@@ -105,7 +112,6 @@ def check_windows_tools():
...
@@ -105,7 +112,6 @@ def check_windows_tools():
"""Check if we are using windows version of synthesis/simulation tools"""
"""Check if we are using windows version of synthesis/simulation tools"""
return
is_windows_python
()
return
is_windows_python
()
def
check_windows_commands
():
def
check_windows_commands
():
"""Check if we are using windows commands (del/type) and not a unix shell.
"""Check if we are using windows commands (del/type) and not a unix shell.
False on cygwin"""
False on cygwin"""
...
@@ -114,33 +120,21 @@ def check_windows_commands():
...
@@ -114,33 +120,21 @@ def check_windows_commands():
else
:
else
:
return
commands_os
==
'windows'
return
commands_os
==
'windows'
def
del_command
():
def
del_command
():
"""Get a string with the O.S. specific delete command"""
"""Get a string with the O.S. specific delete command"""
return
set_of_commands
[
"del"
]
return
set_of_commands
[
"del"
]
def
rmdir_command
():
def
rmdir_command
():
"""Get a string with the O.S. specific remove directory command"""
"""Get a string with the O.S. specific remove directory command"""
if
check_windows_commands
():
return
set_of_commands
[
"rmdir"
]
return
"rmdir /s /q"
else
:
return
"rm -rf"
def
copy_command
():
def
copy_command
():
"""Get a string with the O.S. specific copy command"""
"""Get a string with the O.S. specific copy command"""
if
check_windows_commands
():
return
set_of_commands
[
"copy"
]
return
"copy"
else
:
return
"cp"
def
mkdir_command
():
def
mkdir_command
():
"""Get a string with the O.S. specific mkdir command"""
"""Get a string with the O.S. specific mkdir command"""
if
check_windows_commands
():
return
set_of_commands
[
"mkdir"
]
return
"mkdir"
else
:
return
"mkdir -p"
def
touch_command
():
def
touch_command
():
"""Get a string with the O.S. specific mkdir command"""
"""Get a string with the O.S. specific mkdir command"""
...
@@ -159,10 +153,7 @@ def which(filename):
...
@@ -159,10 +153,7 @@ def which(filename):
def
makefile_slash_char
():
def
makefile_slash_char
():
"""Return the OS specific path separator for use in makefile"""
"""Return the OS specific path separator for use in makefile"""
if
check_windows_commands
():
return
os
.
sep
return
"
\\
"
else
:
return
"/"
def
architecture
():
def
architecture
():
...
...
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