original_docstring: Publish a list of files on the server
docstring: Publish a list of files on the server
docstring_tokens: Publish a list of files on the server
code: def publish_files(files, distro, deb_distro, arch, deb_arch, version,
                    development = False):
      "Publish a list of files on the server"
      global default_publish_host
      global default_publish_dir, default_development_publish_dir
      global default_deb_publish_dir, default_deb_development_publish_dir
  
      publish_dir = None
      deb_publish_dir = None
      if development:
          publish_dir = default_development_publish_dir
          deb_publish_dir = default_deb_development_publish_dir
      else:
          publish_dir = default_publish_dir
          deb_publish_dir = default_deb_publish_dir
  
      (publish_dir, deb_publish_dir) = make_publish_dirs_from_template(publish_dir, distro, arch, version, deb_publish_dir, deb_distro, deb_arch)
  
      for file in files:
          file = os.path.abspath(file)
          if not os.path.exists(file):
              p4a_util.die("Invalid file: " + file)
          p4a_util.warn("\n\nCopying " + file + " in " + publish_dir + " on " + default_publish_host)
          p4a_util.warn("If something goes wrong, try running /srv/fixacl-par4all.sh to fix permissions")
          p4a_util.warn("If something goes wrong, try creating directories or publishing the file manually")
          # Use -p to create any intermediate dir hierarchy without failing
          # on already existence:
          p4a_util.run([ "ssh", default_publish_host, "mkdir -p " + publish_dir ])
          # Survive to rsync error #30 "Timeout in data send/receive", by
          # retrying 10 times after rsync has waited for 60 seconds:
          p4a_util.run([ "rsync --partial --sparse --timeout=60", file, default_publish_host + ":" + publish_dir ], error_code = 30, retry = 10,
              msg= " (timeout).\n" + "Retry to publish using p4a_pack.py with option --retry-publish")
          ext = p4a_util.get_file_ext(file)
          if ext == ".deb":
              publish_deb(file, default_publish_host, deb_publish_dir, publish_dir, deb_arch)
code_tokens: def publish_files ( files , distro , deb_distro , arch , deb_arch , version , development = False ) : global default_publish_host global default_publish_dir , default_development_publish_dir global default_deb_publish_dir , default_deb_development_publish_dir publish_dir = None deb_publish_dir = None if development : publish_dir = default_development_publish_dir deb_publish_dir = default_deb_development_publish_dir else : publish_dir = default_publish_dir deb_publish_dir = default_deb_publish_dir ( publish_dir , deb_publish_dir ) = make_publish_dirs_from_template ( publish_dir , distro , arch , version , deb_publish_dir , deb_distro , deb_arch ) for file in files : file = os . path . abspath ( file ) if not os . path . exists ( file ) : p4a_util . die ( "Invalid file: " + file ) p4a_util . warn ( "\n\nCopying " + file + " in " + publish_dir + " on " + default_publish_host ) p4a_util . warn ( "If something goes wrong, try running /srv/fixacl-par4all.sh to fix permissions" ) p4a_util . warn ( "If something goes wrong, try creating directories or publishing the file manually" ) p4a_util . run ( [ "ssh" , default_publish_host , "mkdir -p " + publish_dir ] ) p4a_util . run ( [ "rsync --partial --sparse --timeout=60" , file , default_publish_host + ":" + publish_dir ] , error_code = 30 , retry = 10 , msg = " (timeout).\n" + "Retry to publish using p4a_pack.py with option --retry-publish" ) ext = p4a_util . get_file_ext ( file ) if ext == ".deb" : publish_deb ( file , default_publish_host , deb_publish_dir , publish_dir , deb_arch )
short_docstring: Publish a list of files on the server
short_docstring_tokens: Publish a list of files on the server
comment: "Publish a list of files on the server"$SEP$# Use -p to create any intermediate dir hierarchy without failing$SEP$# on already existence:$SEP$# Survive to rsync error #30 "Timeout in data send/receive", by$SEP$# retrying 10 times after rsync has waited for 60 seconds: