minor cleanup
Thank you for your time,
-Chase
From 743714ad7a190d7aaa505c80edaad3fb36fd420d Mon Sep 17 00:00:00 2001
From: Chase <nicetry...@protonmail.ch>
Date: Sat, 1 Feb 2020 12:51:11 -0600
Subject: [PATCH] dtopen: replace GENCPP with sed
---
cde/programs/dtopen/Makefile.am | 8 +++---
cde/programs/dtopen/dtopen.src | 46 ++++++++++++++++-----------------
2 files changed, 28 insertions(+), 26 deletions(-)
diff --git a/cde/programs/dtopen/Makefile.am b/cde/programs/dtopen/Makefile.am
index b069fb9c..92100d2f 100644
--- a/cde/programs/dtopen/Makefile.am
+++ b/cde/programs/dtopen/Makefile.am
@@ -6,10 +6,12 @@ LOCAL_CPP_DEFINES = -DCDE_INSTALLATION_TOP=$(CDE_INSTALLATION_TOP) \
-DCDE_CONFIGURATION_TOP=$(CDE_CONFIGURATION_TOP) \
-DKORNSHELL=$(KSH)
+do_subst = $(SED) -e 's+CDE_INSTALLATION_TOP+$(CDE_INSTALLATION_TOP)+g' \
+ -e 's+KORNSHELL+$(KSH)+g'
+
BUILT_SOURCES = dtopen
CLEANFILES = $(BUILT_SOURCES)
dtopen: dtopen.src
- $(RM) $@
- $(GENCPP) -P -DXCOMM=# $(LOCAL_CPP_DEFINES) $< > $@
-
+ $(do_subst) $< > $@
+ chmod +x $@
diff --git a/cde/programs/dtopen/dtopen.src b/cde/programs/dtopen/dtopen.src
index 72c3b3e4..55224b28 100755
--- a/cde/programs/dtopen/dtopen.src
+++ b/cde/programs/dtopen/dtopen.src
@@ -1,18 +1,18 @@
-XCOMM!KORNSHELL
-XCOMM
-XCOMM dtopen - provide an interface for some useful applications.
-XCOMM
-XCOMM #############################################################
-XCOMM #set -x # uncomment for debugging
-XCOMM ###############################################################
-XCOMM Init
+#!KORNSHELL
+#
+# dtopen - provide an interface for some useful applications.
+#
+# #############################################################
+# #set -x # uncomment for debugging
+# ###############################################################
+# Init
DTOPEN="dtopen" # Identity crisis
APPNAME="$(basename "$0")" # the app to locate/run
-XCOMM apps to look for, given an action (based on APPNAME - see MAIN)
+# apps to look for, given an action (based on APPNAME - see MAIN)
-XCOMM image viewing
+# image viewing
if [ -z "$DTOPEN_VIMAGE" ]
then
VIMAGE="xv display gimp"
@@ -20,7 +20,7 @@ else
VIMAGE="$DTOPEN_VIMAGE"
fi
-XCOMM video viewing
+# video viewing
if [ -z "$DTOPEN_VVIDEO" ]
then
VVIDEO="vlc ffplay"
@@ -28,7 +28,7 @@ else
VVIDEO="$DTOPEN_VVIDEO"
fi
-XCOMM postscript viewing
+# postscript viewing
if [ -z "$DTOPEN_VPS" ]
then
VPS="mgv gv"
@@ -36,7 +36,7 @@ else
VPS="$DTOPEN_VPS"
fi
-XCOMM PDF viewing
+# PDF viewing
if [ -z "$DTOPEN_VPDF" ]
then
VPDF="okular xpdf"
@@ -44,10 +44,10 @@ else
VPDF="$DTOPEN_VPDF"
fi
-XCOMM ##############################################################
-XCOMM ## Utility Functions
+# ##############################################################
+# ## Utility Functions
-XCOMM ## Find the path of a program
+# ## Find the path of a program
FindProg()
{
# FindProg "program"
@@ -58,7 +58,7 @@ FindProg()
return 0
}
-XCOMM ## Show an error message
+# ## Show an error message
ErrorMsg()
{
# ErrorMsg "Title "Message" ["OK"]
@@ -76,7 +76,7 @@ ErrorMsg()
return 0
}
-XCOMM ## do a simple command
+# ## do a simple command
DoSimpleCmd()
{
# DoSimpleCmd "commands" args
@@ -108,12 +108,12 @@ DoSimpleCmd()
}
-XCOMM ##################################################################
-XCOMM ## MAIN
+# ##################################################################
+# ## MAIN
-XCOMM # We'll just look at our args and decide what to do...
+# # We'll just look at our args and decide what to do...
-XCOMM # Commands we'll recognize
+# # Commands we'll recognize
COMMANDS="dtopen_image dtopen_pdf dtopen_ps dtopen_video"
@@ -137,5 +137,5 @@ case $APPNAME in
;;
esac
-XCOMM # Fini
+# # Fini
exit 0
--
2.17.1
_______________________________________________
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel