From e2fd890669636f47c6c7e030a1fdceeba5c0885d Mon Sep 17 00:00:00 2001 From: Paul Jewell Date: Thu, 24 Jul 2025 08:18:51 +0100 Subject: [PATCH 1/4] #267 - remove dependency check for DBD::mysql --- utils/check-dependencies.sh | 76 +++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 41 deletions(-) diff --git a/utils/check-dependencies.sh b/utils/check-dependencies.sh index 970db90..6e77fbe 100755 --- a/utils/check-dependencies.sh +++ b/utils/check-dependencies.sh @@ -1,73 +1,67 @@ -#!/bin/bash - +#!/bin/bash - #=============================================================================== # # FILE: check-dependencies.sh -# -# USAGE: ./check-dependencies.sh -# -# DESCRIPTION: Check that Perl module dependencies for the hpr_generator +# +# USAGE: ./check-dependencies.sh +# +# DESCRIPTION: Check that Perl module dependencies for the hpr_generator # are installed. -# +# # OPTIONS: --- # REQUIREMENTS: --- # BUGS: --- # NOTES: --- # AUTHOR: Roan "Rho`n" Horning (roan.horning@gmail.com) -# ORGANIZATION: +# ORGANIZATION: # CREATED: 09/05/2024 09:55:00 PM # REVISION: --- #=============================================================================== -set -o nounset # Treat unset variables as an error +set -o nounset # Treat unset variables as an error #--- FUNCTION ---------------------------------------------------------------- -# NAME: is_module_installed -# DESCRIPTION: Tests if the supplied module is found on the system +# NAME: is_module_installed +# DESCRIPTION: Tests if the supplied module is found on the system # PARAMETERS: Name of the denpendent Perl module # RETURNS: 0 if not found, 1 if found #------------------------------------------------------------------------------- function is_module_installed { - HR="----------------------" - perl -e "use ${1} " - if [ $? -ne 0 ] - then - echo ${HR} - else - echo "Found module ${1}" - echo ${HR} - fi + HR="----------------------" + perl -e "use ${1} " + if [ $? -ne 0 ]; then + echo ${HR} + else + echo "Found module ${1}" + echo ${HR} + fi } -MODULES=( \ - "Getopt::Long" \ - "Pod::Usage" \ - "Config::Std" \ - "Template" \ - "Template::Plugin::File" \ - "Template::Plugin::DBI" \ - "Template::Plugin::HTML::Strip" \ - "DBI" \ - "Tie::DBI" \ - "DBD::SQLite" \ - "DBD::mysql" \ - "Date::Calc" \ - "Text::CSV_XS" \ +MODULES=( + "Getopt::Long" + "Pod::Usage" + "Config::Std" + "Template" + "Template::Plugin::File" + "Template::Plugin::DBI" + "Template::Plugin::HTML::Strip" + "DBI" + "Tie::DBI" + "DBD::SQLite" + "Date::Calc" + "Text::CSV_XS" ) echo "The following modules must be installed for the site-generator to function: " -for module in "${MODULES[@]}" -do - echo "* ${module}" +for module in "${MODULES[@]}"; do + echo "* ${module}" done -echo "When MySQL is used, the DBD:mysql module is required (otherwise it is optional)" -echo "When SQLite is used, then the DBD:SQLite module is required (otherwise it is optional)" echo "Scanning for modules ..." echo "----------------------" -for module in "${MODULES[@]}" -do - is_module_installed "${module}" +for module in "${MODULES[@]}"; do + is_module_installed "${module}" done echo "Finished scanning." From 3abeb25b03a3db9866d22539eaa7e83cd0f75761 Mon Sep 17 00:00:00 2001 From: Paul Jewell Date: Thu, 24 Jul 2025 08:21:50 +0100 Subject: [PATCH 2/4] #267 - Remove references to mysql from README.md --- README.md | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index f64640b..0250196 100644 --- a/README.md +++ b/README.md @@ -15,15 +15,6 @@ Static web page generator for the Hacker Public Radio website. 2. Run `./utils/update-hpr.sh` * SQLite v3.8.3 or greater is recommended. CTE WITH clauses are used in some template queries. Must convert WITH clauses to sub-queries when using earlier versions of SQLite. -* With MySQL - * Create database hpr_hpr in the MySQL server from HPR dump file. - - ``sudo mysql --host=localhost < hpr.sql`` - * Create a user that will be used by the site-generator. - - Suggested username: hpr-generator - - ``CREATE USER 'hpr-generator'@'localhost' IDENTIFIED BY '';`` - * Limit the user's privileges to EXECUTE and SELECT - - ``GRANT SELECT ON hpr_hpr.* TO 'hpr-generator'@'localhost';`` - - ``GRANT EXECUTE ON `hpr_hpr`.* TO 'hpr-generator'@'localhost';`` * Install the needed Perl modules using preferred method (distribution packages, CPAN, etc.) * Getopt::Long * Pod::Usage @@ -35,7 +26,7 @@ Static web page generator for the Hacker Public Radio website. * Template::Plugin::HTML::Strip * DBI * Tie::DBI - * DBD::SQLite or DBD::mysql + * DBD::SQLite * Date::Calc * Text::CSV_XS * HTML::Entities @@ -76,4 +67,6 @@ and add the label "**Feature Request**". * gordons * Ken Fallon * norrist +* Paul Jewell + From 4af0c021eb0ef50e475ff20fdab11c5406bdd976 Mon Sep 17 00:00:00 2001 From: Paul Jewell Date: Thu, 24 Jul 2025 08:25:58 +0100 Subject: [PATCH 3/4] #267 - Remove mysql instructions from GETTING_STARTED.md --- GETTING_STARTED.md | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index 2a8e570..2a4fa4a 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -111,7 +111,7 @@ file are found in the comments within the file. Any database supported by the Perl:DBI and Perl::DBD modules can be used with the site-generator program. Currently the hpr_generator project works with -a MySQL or SQLite database. +an SQLite database. Find the [DBI] section of the file. It should look like the following @@ -146,26 +146,6 @@ The hpr.db section of the driver option `dbi:SQLite:hpr.db` is the path to the sqlite file. The default assumes the hpr.db file is located in the same directory as the site-generator. -### MySQL - -Remove the comment character from the start of the database, driver, -user, and password option lines: - - ``` -# Configuration settings for MySQL -database: mysql -driver: dbi:mysql:database=hpr_hpr:hostname=localhost -user: hpr-generator -password: ********* -``` - -This assumes that the MySQL database service is available at the localhost -hostname, that the database name (hpr_hpr) is the database created from -the hpr.sql dump file or manually created by you, that the user (hpr-generator) -was added by you and has read rights to the hpr_hpr database, and that the -password (replace ********* with the actual password) matches the password set -for the hpr-generator database user. - ## Configuring the website for viewing locally For HTML links to work when viewing the files on your local machine using the From 00ab3b30650e450c2ec61f86ae4b40cc6dc1f057 Mon Sep 17 00:00:00 2001 From: Paul Jewell Date: Thu, 24 Jul 2025 08:27:39 +0100 Subject: [PATCH 4/4] #267 - Remove mysql instructions from site-generator --- site-generator | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/site-generator b/site-generator index f5d67ab..d1dcf12 100755 --- a/site-generator +++ b/site-generator @@ -56,19 +56,9 @@ Perl Template Toolkit. * SQLite v3.8.3 or greater is recommended. CTE WITH clauses are used in some template queries. Must convert WITH clauses to sub-queries when using earlier versions of SQLite. - With MySQL - * Create database hpr_hpr in the MySQL server from HPR dump file. - - sudo mysql --host=localhost < hpr.sql - * Create a user that will be used by the site-generator. - - Suggested username: hpr-generator - - CREATE USER 'hpr-generator'@'localhost' IDENTIFIED BY ''; - * Limit the user's privileges to EXECUTE and SELECT - - GRANT SELECT ON hpr_hpr.* TO 'hpr-generator'@'localhost'; - - GRANT EXECUTE ON `hpr_hpr`.* TO 'hpr-generator'@'localhost'; - Install the needed Perl modules using preferred method (distribution packages, CPAN, etc.) * Config::Std - * DBD::SQLite or DBD:mysql + * DBD::SQLite * DBI * Data::Dumper * Date::Calc