From 7f76d806c1db0cf7e5df44ba86886e44a86acb3e Mon Sep 17 00:00:00 2001 From: Marius Tolzmann Date: Tue, 11 Aug 2015 10:17:19 +0200 Subject: [PATCH 1/5] web: Remove columns running and inq in finished groups view --- web/pages/mxq/mxq | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/web/pages/mxq/mxq b/web/pages/mxq/mxq index 9722dc6..ad9692a 100755 --- a/web/pages/mxq/mxq +++ b/web/pages/mxq/mxq @@ -445,6 +445,32 @@ sub group_table { $sth->execute(@bind_args); $out.=group_table_rows($sth,\@head); + @cols=qw( + group_id + group_name + user_name + group_mtime + group_status + group_jobs + group_jobs_finished + group_jobs_failed + group_jobs_cancelled + group_jobs_unknown + ); + + @head=qw( + group_id + group_name + user_name + group_mtime + group_status + jobs + finished + failed + cancelled + unknown + ); + $out .= '

Finished Groups

'; my $sth=$dbh->prepare('SELECT '.join(',',@cols).' FROM mxq_group WHERE '.$sql_clause.' AND (group_jobs_running=0 AND group_jobs_inq=0) ORDER BY group_id DESC'); From 0949516876e9ef83262b9e61c4976c56bf47e516 Mon Sep 17 00:00:00 2001 From: Marius Tolzmann Date: Tue, 11 Aug 2015 10:22:21 +0200 Subject: [PATCH 2/5] web: Show date_end instead of mtime in finished groups view --- web/pages/mxq/mxq | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/pages/mxq/mxq b/web/pages/mxq/mxq index ad9692a..c153492 100755 --- a/web/pages/mxq/mxq +++ b/web/pages/mxq/mxq @@ -449,7 +449,7 @@ sub group_table { group_id group_name user_name - group_mtime + group_date_emd group_status group_jobs group_jobs_finished @@ -462,7 +462,7 @@ sub group_table { group_id group_name user_name - group_mtime + date_end group_status jobs finished From 1f33b20e07b37928d44d0dbd63e6acd1d1f6fdc0 Mon Sep 17 00:00:00 2001 From: Marius Tolzmann Date: Tue, 11 Aug 2015 10:42:00 +0200 Subject: [PATCH 3/5] web/Makefile: Install cgi to CGIDIR (defaults to LIBEXECDIR/mxq/cgi) --- Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Makefile b/Makefile index 0638036..bd36240 100644 --- a/Makefile +++ b/Makefile @@ -39,6 +39,8 @@ ifeq ($(notdir ${LIBEXECDIR}),mxq) override LIBEXECDIR := $(patsubst %/,%,$(dir ${LIBEXECDIR})) endif +CGIDIR = ${LIBEXECDIR}/mxq/cgi + ############################################################################## MXQ_MYSQL_DEFAULT_FILE = ${SYSCONFDIR}/mxq/mysql.cnf @@ -179,6 +181,7 @@ install:: $(call quiet-installdir,0755,${DESTDIR}${SBINDIR}) $(call quiet-installdir,0755,${DESTDIR}${SYSCONFDIR}/mxq) $(call quiet-installdir,0755,${DESTDIR}${MAN1DIR}) + $(call quiet-installdir,0755,${DESTDIR}${CGIDIR}) ######################################################################## @@ -419,6 +422,13 @@ clean: CLEAN += mxqsub.1 ######################################################################## +build: web/pages/mxq/mxq + +install:: web/pages/mxq/mxq + $(call quiet-install,0755,$^,${DESTDIR}${CGIDIR}/mxq) + +######################################################################## + test_mx_util.o: $(mx_util.h) clean: CLEAN += test_mx_util.o From 03851935233fa0c123f1e8d8a4803882d944e3ba Mon Sep 17 00:00:00 2001 From: Marius Tolzmann Date: Tue, 11 Aug 2015 11:29:23 +0200 Subject: [PATCH 4/5] Makefile: Add generic sed rules to generate scripts and manpages --- Makefile | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index bd36240..26e8d64 100644 --- a/Makefile +++ b/Makefile @@ -103,6 +103,22 @@ quiet-install = $(call quiet-command,install -m ${1} ${2} ${3},"INSTALL ${3} [mo quiet-installdir = $(call quiet-command,install -m ${1} -d ${2}," MKDIR ${2} [mode=${1}]") quiet-installforuser = $(call quiet-command,install -m ${1} -o ${2} -g ${3} ${4} ${5},"INSTALL ${5} (user=${2} group=${3}) [mode=${1}]") +######################################################################## + +sed-rules = -e 's,@PREFIX@,${PREFIX},g' \ + -e 's,@EPREFIX@,${EPREFIX},g' \ + -e 's,@BINDIR@,${BINDIR},g' \ + -e 's,@SBINDIR@,${SBINDIR},g' \ + -e 's,@LIBDIR@,${LIBDIR},g' \ + -e 's,@SYSCONFDIR@,${SYSCONFDIR},g' \ + -e 's,@DEFCONFDIR@,${DEFCONFDIR},g' \ + -e 's,@LIBEXECDIR@,${LIBEXECDIR},g' \ + -e 's,@BEE_VERSION@,${BEE_VERSION},g' \ + -e 's,@DATADIR@,${DATADIR},g' \ + -e 's,@MXQ_VERSION@,${MXQ_VERSION},g' \ + -e 's,@MXQ_MYSQL_DEFAULT_FILE@,${MXQ_MYSQL_DEFAULT_FILE},g' \ + + ######################################################################## %.o: %.c Makefile @@ -113,6 +129,9 @@ quiet-installforuser = $(call quiet-command,install -m ${1} -o ${2} -g ${3} ${4} %: %.o $(call quiet-command,${CC} -o $@ $^ $(LDFLAGS) $(LDLIBS), " LINK $@") +%: %.in Makefile + $(call quiet-command,sed ${sed-rules} $< >$@, " GEN $@") + ######################################################################## .SECONDARY: @@ -123,7 +142,7 @@ manpages/%: manpages/%.xml $(call quiet-command,xmlto --stringparam man.output.quietly=1 man $^ -o manpages, " XMLTO $@") %: manpages/% Makefile - $(call quiet-command,sed -e "s/@MXQ_VERSION@/${MXQ_VERSION}/" $< >$@, " GEN $@") + $(call quiet-command,sed ${sed-rules} $< >$@, " GEN $@") ######################################################################## From 334821af92553bc588ece1559fdb498e790de6bc Mon Sep 17 00:00:00 2001 From: Marius Tolzmann Date: Tue, 11 Aug 2015 11:31:37 +0200 Subject: [PATCH 5/5] web/Makefile: Generate cgi script replacing make variables --- .gitignore | 2 ++ Makefile | 2 ++ web/pages/mxq/{mxq => mxq.in} | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) rename web/pages/mxq/{mxq => mxq.in} (98%) diff --git a/.gitignore b/.gitignore index ae66896..91daded 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,8 @@ test_mx_util test_mx_log test_mx_mysql +/web/pages/mxq/mxq + *~ gmon.out diff --git a/Makefile b/Makefile index 26e8d64..22fbb5c 100644 --- a/Makefile +++ b/Makefile @@ -443,6 +443,8 @@ clean: CLEAN += mxqsub.1 build: web/pages/mxq/mxq +clean: CLEAN += web/pages/mxq/mxq + install:: web/pages/mxq/mxq $(call quiet-install,0755,$^,${DESTDIR}${CGIDIR}/mxq) diff --git a/web/pages/mxq/mxq b/web/pages/mxq/mxq.in similarity index 98% rename from web/pages/mxq/mxq rename to web/pages/mxq/mxq.in index c153492..fa4dad8 100755 --- a/web/pages/mxq/mxq +++ b/web/pages/mxq/mxq.in @@ -76,7 +76,7 @@ EOF sub db_init { - $dbh= DBI->connect('DBI:mysql:mysql_read_default_file=/etc/mxq/mysql.cnf',undef,undef, { RaiseError => 1, AutoCommit => 1 }); + $dbh= DBI->connect('DBI:mysql:mysql_read_default_file=@MXQ_MYSQL_DEFAULT_FILE@',undef,undef, { RaiseError => 1, AutoCommit => 1 }); # mxq_group.h register_group_status( OK => 0,