From 3c00e328b546283294871232e65e39b9d2b80041 Mon Sep 17 00:00:00 2001 From: Armaan Bhojwani Date: Mon, 8 Mar 2021 09:11:20 -0500 Subject: [PATCH] Use /usr/local/share --- Makefile | 17 ++++++++++------- highlight.py | 15 ++++++++------- requirements.txt | 1 - stagit.c | 10 +++++----- 4 files changed, 23 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index 905d3bd..c0acb10 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ VERSION = 0.9.3 PREFIX = /usr/local MANPREFIX = ${PREFIX}/man DOCPREFIX = ${PREFIX}/share/doc/${NAME} +SHAREPREFIX = ${PREFIX}/share/${NAME} LIBGIT_INC = -I/usr/local/include LIBGIT_LIB = -L/usr/local/lib -lgit2 @@ -80,15 +81,17 @@ install: all for f in ${BIN}; do chmod 755 ${DESTDIR}${PREFIX}/bin/$$f; done # installing example files. mkdir -p ${DESTDIR}${DOCPREFIX} - cp -f style.min.css\ - syntax.css\ - favicon.png\ + cp -f favicon.png\ logo.png\ example_create.sh\ example_post-receive.sh\ README\ - highlight.py\ ${DESTDIR}${DOCPREFIX} + mkdir -p ${DESTDIR}${SHAREPREFIX} + cp -f style.min.css\ + syntax.css\ + highlight.py\ + ${DESTDIR}${SHAREPREFIX} # installing manual pages. mkdir -p ${DESTDIR}${MANPREFIX}/man1 cp -f ${MAN1} ${DESTDIR}${MANPREFIX}/man1 @@ -99,9 +102,9 @@ uninstall: for f in ${BIN}; do rm -f ${DESTDIR}${PREFIX}/bin/$$f; done # removing example files. rm -f \ - ${DESTDIR}${DOCPREFIX}/style.min.css\ - ${DESTDIR}${DOCPREFIX}/syntax.css\ - ${DESTDIR}${DOCPREFIX}/highlight.py\ + ${DESTDIR}${SHAREPREFIX}/style.min.css\ + ${DESTDIR}${SHAREPREFIX}/syntax.css\ + ${DESTDIR}${SHAREPREFIX}/highlight.py\ ${DESTDIR}${DOCPREFIX}/favicon.png\ ${DESTDIR}${DOCPREFIX}/logo.png\ ${DESTDIR}${DOCPREFIX}/example_create.sh\ diff --git a/highlight.py b/highlight.py index eb146e7..2b81d8c 100755 --- a/highlight.py +++ b/highlight.py @@ -46,14 +46,15 @@ formatter = HtmlFormatter( anchorlinenos=True, ) +outp = "" if rendered: - print('
') - print(rendered) - print("
") -print('
') -print(highlight(contents, lexer, formatter)) -print("
") -print('{highlight(contents, lexer, formatter)}"' +outp += ' 0) { - lc = syntax_highlight(filename, fp, s, len); + lc = call_py(filename, fp, s, len); } return lc; @@ -1171,9 +1171,9 @@ main(int argc, char *argv[]) /* copy css */ char cwd[PATH_MAX]; strcpy(cwd, getcwd(cwd, sizeof(cwd))); - cp("/usr/local/share/doc/stagit/syntax.css", strcat(cwd, "/syntax.css")); + cp("/usr/local/share/stagit/syntax.css", strcat(cwd, "/syntax.css")); strcpy(cwd, getcwd(cwd, sizeof(cwd))); - cp("/usr/local/share/doc/stagit/style.min.css", strcat(cwd, "/style.min.css")); + cp("/usr/local/share/stagit/style.min.css", strcat(cwd, "/style.min.css")); /* strip .git suffix */ if (!(strippedname = strdup(name))) -- 2.39.2