diff --git a/stx/lib/stx/stx_build.py b/stx/lib/stx/stx_build.py index a0f86cea2..ee5c62ad1 100644 --- a/stx/lib/stx/stx_build.py +++ b/stx/lib/stx/stx_build.py @@ -85,10 +85,21 @@ class HandleBuildTask: cmd = prefixcmd + '". /usr/local/bin/stx/stx-cleanup"\'' return cmd - def buildDebdownloaderCMD(self, prefixcmd): + def buildDownloadCMD(self, args, prefixcmd): - cmd = prefixcmd + '"debdownloader ' + \ - '$STX_BINARYLIST_DIR/common/base-bullseye.lst"\'' + cmd = prefixcmd + '"downloader ' + + if args.download_binary: + cmd = cmd + '--download_binary ' + elif args.download_source: + cmd = cmd + '--download_source ' + else: + cmd = cmd + '--download_binary --download_source ' + + if args.force: + cmd = cmd + '--clean_mirror ' + + cmd = cmd + '"\'' return cmd def buildPackageCMD(self, args, prefixcmd, world): @@ -157,9 +168,9 @@ class HandleBuildTask: cmd = self.buildCleanupCMD(prefix_cmd) self.logger.debug('Execute the cleanup command: [%s].', cmd) - elif args.build_task == 'debdownloader': - cmd = self.buildDebdownloaderCMD(prefix_cmd) - self.logger.debug('Execute the debdownloader command: [%s].', cmd) + elif args.build_task == 'download': + cmd = self.buildDownloadCMD(args, prefix_cmd) + self.logger.debug('Execute the download command: [%s].', cmd) elif args.build_task == 'world': cmd = self.buildPackageCMD(args, prefix_cmd, True) diff --git a/stx/lib/stx/stx_main.py b/stx/lib/stx/stx_main.py index d53f66ae1..3e3c0a8a2 100644 --- a/stx/lib/stx/stx_main.py +++ b/stx/lib/stx/stx_main.py @@ -93,27 +93,33 @@ settings.\t\teg: [ --show|--get|--add|--unset|--remove-section ]') build_subparser = subparsers.add_parser('build', help='Run to build packages or\ -image.\t\teg: [ prepare|layer|image|debdownloader|world|${pkgname}]') +image.\t\teg: [ prepare|layer|image|download|world|${pkgname}]') build_subparser.add_argument('build_task', help='[ prepare|cleanup|layer|image|' + - 'debdownloader|world|${pkgname} ]:\ + 'download|world|${pkgname} ]:\ Prepare for building enviroment and \ build packages, distro layer or image.\ \n\n') + build_subparser.add_argument('-b', '--download-binary', + help="download binary debs", + action='store_true', required=False) build_subparser.add_argument('-e', '--exit-on-fail', - help="Exit for any fail.", + help="Exit for any failure.", action='store_true', required=False) build_subparser.add_argument('-f', '--force', - help='Force to compile the package again.\ - ', action='store_true', required=False) + help='Force to execute the task again.', + action='store_true', required=False) build_subparser.add_argument('-l', '--layers', help='[ flock|distro ]: Compile the \ packages for the layer.', required=False) + build_subparser.add_argument('-s', '--download-source', + help="download starlingx source recipes", + action='store_true', required=False) build_subparser.add_argument('-t', '--buildtype', help='[ rt|std ]: Select the build type.\ ', required=False) build_subparser.add_argument('--enable-test', - help='Enable the automatical test for \ + help='Enable the automatic test for \ the package building.', action='store_true', required=False) build_subparser.set_defaults(handle=self.handlebuild.handleBuild)