Commit 733d593a authored by Andreas Tille's avatar Andreas Tille
Browse files
parent f00a4195
Loading
Loading
Loading
Loading

create_README.source

deleted100755 → 0
+0 −49
Original line number Diff line number Diff line
#!/bin/sh

# you can use/adapt this script to create README.source for R packages
# featuring large amounts of binary data files

cat <<EOT
Explanation for binary files inside source package according to
  http://lists.debian.org/debian-devel/2013/09/msg00332.html

EOT

GuessDocName () {
  if [ -e $1.Rd ] ; then
    echo $1.Rd
  else
    rdoc=`echo $1 | sed 's/\.[RDArdat]\+$/.Rd/'`
    if [ -e $rdoc ] ; then
      echo $rdoc
    else
      echo ${rdoc}.rd
    fi
  fi
}

for rda in `ls ../data/*.rda ../data/*.RData 2>/dev/null` ; do
  rdoc=`GuessDocName "../man/$(basename $rda .rda)"`
  if [ ! -e "$rdoc"  ] ; then
    # try lower case doc name if nothing else was found
    rdoc=`GuessDocName "../man/"$(basename $rda .rda | tr 'A-Z' 'a-z')`
  fi
  if [ ! -e "$rdoc"  ] ; then
    >&2 echo "Verify documentation for $rda manually"
  else
        echo "Files: data/$(basename $rda)"
        echo $rdoc | sed 's#^\.\./#Documented: #'
        grep '\\title' $rdoc | sed -e 's/^\\title{/  /' -e 's/ *} *$//'
        echo ""
  fi
done

cat <<EOT
 -- Andreas Tille <tille@debian.org>  `date -R`
EOT


#        sed -e '0,/^\\title{/d' -e '/^}/,$d' -e 's/^\\description{//' -e 's/^\([^ ]\)/  \1/' $rdoc | \
#           sed -e 's/\\code{\([^}]\+\)}/\1/g' | \
#           perl -p -e 's/\cM//g' | grep -v '^ *$' | sed -e '/^ \+\\/d' -e 's/} *$/\n#####/' | \
#           sed -e '/^#####/ { N; N; N; N; d; }' | sed -e '/^#####/ { N; N; N; d; }' | sed -e '/^#####/ { N; N; d; }'  | sed -e '/^#####/ { N; d; }'