mirror of
https://github.com/netinvent/npbackup.git
synced 2025-02-23 22:15:43 +08:00
Remove --arch parameter since Nuitka compiles only on current python arch
This commit is contained in:
parent
140430e201
commit
fde53b867b
3 changed files with 16 additions and 25 deletions
|
@ -11,8 +11,8 @@ cd C:\GIT\npbackup
|
||||||
:: Make sure we add npbackup in python path so bin and npbackup subfolders become packages
|
:: Make sure we add npbackup in python path so bin and npbackup subfolders become packages
|
||||||
SET PYTHONPATH=c:\GIT\npbackup
|
SET PYTHONPATH=c:\GIT\npbackup
|
||||||
|
|
||||||
"%PYTHON64%" bin\compile.py --arch x64 --audience all
|
"%PYTHON64%" bin\compile.py --audience all
|
||||||
"%PYTHON32%" bin\compile.py --arch x86 --audience all
|
"%PYTHON32%" bin\compile.py --audience all
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,4 +6,4 @@ cd /opt/npbackup
|
||||||
|
|
||||||
export PYTHONPATH=/opt/npbackup
|
export PYTHONPATH=/opt/npbackup
|
||||||
|
|
||||||
/opt/npbackup/venv/bin/python bin/compile.py --arch x64 --audience all
|
/opt/npbackup/venv/bin/python bin/compile.py --audience all
|
|
@ -8,7 +8,7 @@ __author__ = "Orsiris de Jong"
|
||||||
__copyright__ = "Copyright (C) 2023 NetInvent"
|
__copyright__ = "Copyright (C) 2023 NetInvent"
|
||||||
__license__ = "GPL-3.0-only"
|
__license__ = "GPL-3.0-only"
|
||||||
__build__ = "2023032601"
|
__build__ = "2023032601"
|
||||||
__version__ = "1.6.1"
|
__version__ = "1.6.2"
|
||||||
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
@ -17,7 +17,6 @@ import argparse
|
||||||
import atexit
|
import atexit
|
||||||
from command_runner import command_runner
|
from command_runner import command_runner
|
||||||
|
|
||||||
ARCHES = ["x86", "x64"]
|
|
||||||
AUDIENCES = ["public", "private"]
|
AUDIENCES = ["public", "private"]
|
||||||
|
|
||||||
# Insert parent dir as path se we get to use npbackup as package
|
# Insert parent dir as path se we get to use npbackup as package
|
||||||
|
@ -288,14 +287,6 @@ def compile(arch, audience):
|
||||||
return not errors
|
return not errors
|
||||||
|
|
||||||
|
|
||||||
class ArchAction(argparse.Action):
|
|
||||||
def __call__(self, parser, namespace, values, option_string=None):
|
|
||||||
if values not in ARCHES:
|
|
||||||
print("Got value:", values)
|
|
||||||
raise argparse.ArgumentError(self, "Not a valid arch")
|
|
||||||
setattr(namespace, self.dest, values)
|
|
||||||
|
|
||||||
|
|
||||||
class AudienceAction(argparse.Action):
|
class AudienceAction(argparse.Action):
|
||||||
def __call__(self, parser, namespace, values, option_string=None):
|
def __call__(self, parser, namespace, values, option_string=None):
|
||||||
if values not in AUDIENCES + ["all"]:
|
if values not in AUDIENCES + ["all"]:
|
||||||
|
@ -309,16 +300,6 @@ if __name__ == "__main__":
|
||||||
prog="npbackup compile.py", description="Compiler script for NPBackup"
|
prog="npbackup compile.py", description="Compiler script for NPBackup"
|
||||||
)
|
)
|
||||||
|
|
||||||
parser.add_argument(
|
|
||||||
"--arch",
|
|
||||||
type=str,
|
|
||||||
dest="arch",
|
|
||||||
default=None,
|
|
||||||
required=True,
|
|
||||||
action=ArchAction,
|
|
||||||
help="Target arch, x64 or x86",
|
|
||||||
)
|
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--audience",
|
"--audience",
|
||||||
type=str,
|
type=str,
|
||||||
|
@ -336,6 +317,7 @@ if __name__ == "__main__":
|
||||||
"private",
|
"private",
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
|
errors = False
|
||||||
if args.audience.lower() == "all":
|
if args.audience.lower() == "all":
|
||||||
audiences = AUDIENCES
|
audiences = AUDIENCES
|
||||||
else:
|
else:
|
||||||
|
@ -350,9 +332,18 @@ if __name__ == "__main__":
|
||||||
if private_build and audience != "private":
|
if private_build and audience != "private":
|
||||||
print("ERROR: Requested private build but no private data available")
|
print("ERROR: Requested private build but no private data available")
|
||||||
continue
|
continue
|
||||||
result = compile(arch=args.arch, audience=audience)
|
python_arch = "x64" if sys.maxsize > 2**32 else "x86"
|
||||||
|
result = compile(arch=python_arch, audience=audience)
|
||||||
|
build_type = 'private' if private_build else 'public'
|
||||||
if result:
|
if result:
|
||||||
print("MADE {} build".format('PRIVATE' if private_build else 'PUBLIC'))
|
print("SUCCESS: MADE {} build for audience {}".format(build_type, audience))
|
||||||
|
else:
|
||||||
|
print("ERROR: Failed making {} build for audience {}".format(build_type, audience))
|
||||||
|
errors = True
|
||||||
|
if errors:
|
||||||
|
print("ERRORS IN BUILD PROCESS")
|
||||||
|
else:
|
||||||
|
print("SUCCESS BUILDING")
|
||||||
except Exception:
|
except Exception:
|
||||||
print("COMPILATION FAILED")
|
print("COMPILATION FAILED")
|
||||||
raise
|
raise
|
Loading…
Reference in a new issue