@@ -164,7 +164,7 @@ def _load_config(filename):
164164 else :
165165 _run_log .info ("N" )
166166 _run_log .info ("Please modify config.json correctly before running buildpkg." )
167- exit (1 )
167+ sys . exit ("sorry, goodbye!" )
168168
169169 _run_log .info ("Fix the config.json file contents." )
170170
@@ -242,7 +242,7 @@ def _check_self():
242242 # 4. check if License file exists
243243 if os .path .exists ("LICENSE" ) == False :
244244 _run_log .info ("Please do not delete the license, otherwise you will not be able to use buildpkg!" )
245- exit (1 )
245+ sys . exit ("sorry, goodbye!" )
246246
247247 # 5. check if the library generated by the license is installed
248248 try :
@@ -262,7 +262,7 @@ def _check_self():
262262 file_path = os .path .join (_buildpkg_template_path , str (file_name ))
263263 if os .path .exists (file_path ) == False :
264264 _run_log .info ("The template file [%s] does not exist and exit." % (file_name ))
265- exit (1 )
265+ sys . exit ("sorry, goodbye!" )
266266
267267 _run_log .info ("To complete self-check, and load config form [config.json] file." )
268268
@@ -359,7 +359,7 @@ def _make_package(pkgname, version = None, license = None):
359359 global _buildpkg_packages_path
360360 global _buildpkg_packages_xxx_path
361361 global _buildpkg_packages_xxx_example_path
362- global _buildpkg_packages_xxx_scripts_path
362+ global _buildpkg_packages_xxx_scripts_path
363363
364364 if _BUILDPKG_RELEASE == False :
365365 if os .path .exists (_buildpkg_packages_xxx_path ) == True :
@@ -473,7 +473,7 @@ def _update_package(pkgname, version = None, license = None):
473473
474474 if _package_config == None :
475475 _run_log .error ("The [%s] package was not found, exit buildpkg update." % (pkgname ))
476- exit (1 )
476+ sys . exit ("sorry, goodbye!" )
477477
478478 _replace_list = {
479479 "username" : _config ["username" ],
@@ -551,6 +551,10 @@ def main():
551551 if _args .action == "make" :
552552 # 4.1. make package
553553 if _args .pkgrepo == None :
554+ if str (_args .pkgname ).find (".git" ) != - 1 or str (_args .pkgname ).find ("http://" ) != - 1 or str (_args .pkgname ).find ("https://" ) != - 1 :
555+ _run_log .error ("The %s is a url! Please input package name" % (_args .pkgname ))
556+ sys .exit ("sorry, goodbye!" )
557+
554558 _make_package (_args .pkgname , _args .version , _args .license )
555559 _commit_git (_args .pkgname , _config ["commit_content" ])
556560 # 4.2. transplant package
@@ -566,4 +570,9 @@ def main():
566570 _pkg_log .info ("To complete to update package [%s]!" % (_args .pkgname ))
567571
568572if __name__ == "__main__" :
569- main ()
573+ try :
574+ main ()
575+ except :
576+ _pkg_log .exception (sys .exc_info ())
577+ sys .exit ("sorry, goodbye!" )
578+
0 commit comments