#!/bin/bash
# Creates an HTML table listing core modules and associated resource pages.
#
# This script should be run either from an empty directory or from one which
# contains the checked-out git repositories for the desired Drupal versions.
#
# After completion, a file called "core_modules.html" should be created.
#
# In addition to a bourne-compatible shell, the following standard Unix
# utility programs are required:
# - curl, wget, lynx, or similar command-line url fetch tool.
# - sed
# - git
# - echo
# - find
# - tee
# - sort
# - rm
# - grep
#
# Arguments:
# - A list of Drupal versions to check out. Defaults to "6.x 7.x 8.x".
#
# Configurable options:
FETCH="curl -s"
#FETCH="wget -q -O -"
#FETCH="lynx -source"
SED=sed
GIT=git
DRUPAL=git://drupalcode.org/project/drupal.git
#DRUPAL=http://drupalcode.org/project/drupal.git
#DRUPAL=https://drupalcode.org/project/drupal.git
ECHO=echo
OUTPUT=core_modules.html
FIND=find
TEE=tee
SORT=sort
RM=rm
GREP=grep
HEAD="curl -sI -A 'Mozilla/4.0'"
#HEAD="wget -q -S -O /dev/null -U 'Mozilla/4.0'"
#HEAD="lynx -source -head -useragent=Mozilla/4.0"
#
# No user-serviceable parts beyond this point.
#
$RM $OUTPUT
function print_module_header {
$ECHO "
$1 Modules
" >> $OUTPUT
$ECHO '
Name
Doc
API
Issues
' >> $OUTPUT
$ECHO '
machine name — Module description
' >> $OUTPUT
}
function print_module_footer {
$ECHO '