Warning: this is an htmlized version!
The original is across this link,
and the conversion rules are here.
################################################################
#
#	File:	  debreputil
#
#	Subject:  utilities to manage a repository of .debs
#
#	Author:	  Edrx
#
#	Date:	  2000jul03
#
################################################################
#
#
#
# Libbables:
#
################################################################

$include "zinc.icn"
$include "~/ICON/debrepository.icn"

# (find-fline "~/ICON/debrepository.icn")
# (find-fline "/hda2/98jul22home/root/ICON/")
# (find-es "apt" "missing_upstream_debs2")


procedure idebs_notin_upstream(args[])
  read_installed_debs(args[1])
  read_upstream_debs(args[2])
  every write(!(sort(ideb_basenameS -- udeb_basenameS)))
end

procedure idebs_as_upstream(args[])
  read_installed_debs(args[1])
  read_upstream_debs(args[2])
  every debname := !(sort(ideb_basenameS ** udeb_basenameS)) do
    write(udeb_basename2li[debname])
end

procedure upstream_fdebs_as_cpsrms(args[])
  read_upstream_debs(args[1])
  udeb_basename2localcopy := table()
  every li := tsv_lines(args[2]) do
    if member(udeb_basenameS, tsv_head) then
      if addtotable(udeb_basename2localcopy, tsv_head, tsv_tail) == "first"
      then {
	dest := udeb_basename2fname[tsv_head]
	write("# Upstream: ", dest)
	write("[[ ! -e ", dest, " ]] && ", "\\\n",
	      "cp ", tsv_tail, " \\\n   ", dest)
      } else
	write(cpsrmsF, "rm -v ", tsv_tail)
    else
      write("# Not in upstream: ", tsv_tail)
end

procedure upstream_fdebs_as_mvsrms(args[])
  read_upstream_debs(args[1])
  udeb_basename2localcopy := table()
  # write("unalias mv_or_rm")
  write("function mv_or_rm () {\n" ||
	"  if [[ -e $2 ]]; then\n" ||
	"    if [[ $1 -ef $2 ]]; then\n" ||
	"      echo '# same as dest:' $1\n" ||
	"      else echo rm $1; rm $1\n" ||
	"    fi\n" ||
	"  else echo mv $1 $2; mv $1 $2\n" ||
	"  fi\n" ||
	"}")
  # w(udeb_basename2fname)
  every li := tsv_lines(args[2]) do
    if member(udeb_basenameS, tsv_head) then {
      dest := udeb_basename2fname[tsv_head]
      write("mv_or_rm ", tsv_tail, " ", dest)
    } else {
      write("# Not in upstream: ", tsv_tail)
    }
end

procedure main(args)
  case args[1] of {

    "-idebs_notin_upstream" :
      idebs_notin_upstream(args[2], args[3])

    "-idebs_as_upstream" :
      idebs_as_upstream(args[2], args[3])

    "-notin_upstream_fdebs" :
      notin_upstream_fdebs(args[2], args[3])

    "-upstream_fdebs_as_cpsrms" :
      upstream_fdebs_as_cpsrms(args[2], args[3])

    "-upstream_fdebs_as_mvsrms" :
      upstream_fdebs_as_mvsrms(args[2], args[3])

    default :
      write("Bad command.  See ~/ICON/debreputil.icn")

  }
end


# -idebs_as_upstream
# -idebs_notin_upstream
# -notin_upstream_fdebs
# -upstream_notin_fdebs
# -debs_notin_fdebs
# -upstream_fdebs_cpsrms

# (find-es "emacs" "compile-command")
# (compile "cd ~/ICON/; icont debreputil.icn")
#
# Local variables:
# compile-command: "cd ~/ICON/; icont debreputil.icn"
# End: