pastebin - collaborative debugging tool
rovema.kpaste.net RSS


debian_list_all_licenses.ksh - collection scriptPrototype for a License
Posted by Anonymous on Wed 11th Dec 2024 10:47
raw | new post

  1. #
  2. # debian_list_all_licenses.ksh - Prototype for a License
  3. # collection script
  4. # In: All licenses of all installed Debian pacakges
  5. # Out: ksh93 compound variable which contains all license info
  6. #
  7.  
  8. compound data=(
  9.         compound -A licenses
  10. )
  11.  
  12. typeset pkgname
  13. typeset s
  14. typeset hash
  15.  
  16. for i in /usr/share/doc/*/ ; do
  17.         pkgname="$(basename "$i")"
  18.         printf '#### Processing package name: %q\n' "$pkgname"
  19.        
  20.         [[ -f "$i/copyright" ]] || continue
  21.  
  22.         hash="$(strings "$i/copyright" | sed -E 's/[[:space:]]//g' | md5sum | read var dummy ; print -- "$var")"
  23.  
  24.         if [[ ! -v data.licenses[$hash] ]] ; then
  25.                 typeset -a data.licenses[$hash].packagelist
  26.                 data.licenses[$hash].text="$( <"$i/copyright" )"
  27.         fi
  28.  
  29.         data.licenses[$hash].packagelist+=( "$pkgname" )
  30. done
  31.  
  32. print -v data

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at