Warning: this is an htmlized version!
The original is across this link,
and the conversion rules are here.
# debrepository.icn
#
# This is not a full program.
# This file is meant to be $included by others.
# Edrx 2000jun26

global lslri_fname
global lslri_basename
global lslri_stem

global tsv_head
global tsv_tail

global deb_stem

global ideb_basenameS

global udeb_basename2fname
global udeb_basename2li
global udeb_basenameS

procedure fname2basename(s)
  s ? { every p := find("/"); tab(\p+1); return tab(0) }
end

procedure basename2stem(s)
  s ? return tab(find("_"))
end

procedure lslri_lines(fname)
  F := if fname == "-" then &input else open(fname)
  while li := read(F) do {
    li ? {
      tab(many(' '))
      &pos <- .&pos &
	tab(many('0123456789')) &
	tab(many(' '))
      lslri_fname := tab(upto(' ') | 0)
      lslri_basename := fname2basename(lslri_fname)
      lslri_stem := basename2stem(lslri_basename)
    }
    suspend li
  }
  if fname ~== "-" then close(F)
end

procedure tsv_lines(fname)
  F := if fname == "-" then &input else open(fname)
  while li := read(F) do {
    li ? {
      tsv_head := tab(find("\t"))
      move(1)
      tsv_tail := tab(0)
    }
    suspend li
  }
  if fname ~== "-" then close(F)
end

procedure deb_lines(fname)
  F := if fname == "-" then &input else open(fname)
  while li := read(F) do {
    deb_stem := basename2stem(li)
    suspend li
  }
  if fname ~== "-" then close(F)
end

procedure keys(T)
  S := set()
  every insert(S, key(T))
  return S
end

procedure addtotable(T, k, v)
  if /(T[k]) then {
    T[k] := v
    return "first"
  } else {
    return "redundant"
  }
end

procedure read_installed_debs(fname)
  ideb_basenameS := set()
  #
  every li := deb_lines(fname) do
    insert(ideb_basenameS, li)
end

procedure read_upstream_debs(fname)
  udeb_basename2fname := table()
  udeb_basename2li := table()
  udeb_basenameS := set()
  #
  every li := lslri_lines(fname) do {
    udeb_basename2fname [lslri_basename] := lslri_fname
    udeb_basename2li    [lslri_basename] := li
    insert(udeb_basenameS, lslri_basename)
  }
end