original_docstring: Publish a Debian package on a serve by linking it in repos_dir to
      orig_dir where file is supposed to already be here
docstring: Publish a Debian package on a serve by linking it in repos_dir to
  orig_dir where file is supposed to already be here
docstring_tokens: Publish a Debian package on a serve by linking it in repos_dir to orig_dir where file is supposed to already be here
code: def publish_deb(file, host, repos_dir, orig_dir, arch):
      """Publish a Debian package on a serve by linking it in repos_dir to
      orig_dir where file is supposed to already be here"""
      #~ arch = p4a_util.change_file_ext(file, "").split("_")[-1]
      p4a_util.info("\n\nPublishing " + file + " in the deb repository (" + arch + ") " + repos_dir )
      local_file_name = os.path.basename(file)
      repos_arch_dir = os.path.join(repos_dir, "binary-" + arch)
      # Create directory hierarchy:
      p4a_util.run([ "ssh", host, "mkdir -p " + repos_arch_dir ])
      p4a_util.warn("Removing existing .deb file for arch " + arch + " (" + repos_arch_dir + ")")
      p4a_util.run([ "ssh", host, "rm -fv " + os.path.join(repos_arch_dir, "*.deb") ])
      p4a_util.warn("Link " + local_file_name + " on " + host + " (in " + repos_arch_dir + " to " + orig_dir + ")")
      # Point to a relative name to help moving the repository on the server
      # later. Absolute link names would be a nightmare else...
      relative_dest = os.path.relpath(os.path.join(orig_dir, local_file_name),
                                      start = repos_arch_dir)
      p4a_util.run([ "ssh", host, "ln -s " + relative_dest +
                     " " + os.path.join(repos_arch_dir, local_file_name) ])
      p4a_util.warn("Please allow max. 5 minutes for deb repository indexes to get updated by cron")
      p4a_util.warn("Alternatively, you can run /srv/update-par4all.sh on " + host + " as root")
code_tokens: def publish_deb ( file , host , repos_dir , orig_dir , arch ) : p4a_util . info ( "\n\nPublishing " + file + " in the deb repository (" + arch + ") " + repos_dir ) local_file_name = os . path . basename ( file ) repos_arch_dir = os . path . join ( repos_dir , "binary-" + arch ) p4a_util . run ( [ "ssh" , host , "mkdir -p " + repos_arch_dir ] ) p4a_util . warn ( "Removing existing .deb file for arch " + arch + " (" + repos_arch_dir + ")" ) p4a_util . run ( [ "ssh" , host , "rm -fv " + os . path . join ( repos_arch_dir , "*.deb" ) ] ) p4a_util . warn ( "Link " + local_file_name + " on " + host + " (in " + repos_arch_dir + " to " + orig_dir + ")" ) relative_dest = os . path . relpath ( os . path . join ( orig_dir , local_file_name ) , start = repos_arch_dir ) p4a_util . run ( [ "ssh" , host , "ln -s " + relative_dest + " " + os . path . join ( repos_arch_dir , local_file_name ) ] ) p4a_util . warn ( "Please allow max. 5 minutes for deb repository indexes to get updated by cron" ) p4a_util . warn ( "Alternatively, you can run /srv/update-par4all.sh on " + host + " as root" )
short_docstring: Publish a Debian package on a serve by linking it in repos_dir to
  orig_dir where file is supposed to already be here
short_docstring_tokens: Publish a Debian package on a serve by linking it in repos_dir to orig_dir where file is supposed to already be here
comment: """Publish a Debian package on a serve by linking it in repos_dir to
      orig_dir where file is supposed to already be here"""$SEP$#~ arch = p4a_util.change_file_ext(file, "").split("_")[-1]$SEP$# Create directory hierarchy:$SEP$# Point to a relative name to help moving the repository on the server$SEP$# later. Absolute link names would be a nightmare else...