fixed NULL refs, sprip by dh_make now
authorebelcrom <ebelcrom@gmail.com>
Fri, 1 Jun 2018 16:01:19 +0000 (18:01 +0200)
committerebelcrom <ebelcrom@gmail.com>
Fri, 1 Jun 2018 16:01:19 +0000 (18:01 +0200)
deb/shgen-0.1/debian/rules
src/Makefile
src/debian/changelog [deleted file]
src/debian/compat [deleted file]
src/debian/control [deleted file]
src/debian/copyright [deleted file]
src/debian/rules [deleted file]
src/debian/shgen-docs.docs [deleted file]
src/debian/source/format [deleted file]
src/shgen.c

index 4ebc141d839096417cf73a636e2739564a8703c3..efd2d902be0fbc2bb04302730e21cc5a53c075c0 100755 (executable)
@@ -22,5 +22,3 @@
 # This is example for Cmake (See https://bugs.debian.org/641051 )
 #override_dh_auto_configure:
 #      dh_auto_configure -- #  -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
-
-override_dh_strip:
index 9df0f8269b4f51fe3c2461164701c46d4b169145..c2aafe18fdc74e87adfd4dff19a1f662d1d5da8a 100644 (file)
@@ -1,5 +1,4 @@
 CC ?= gcc
-STRIP ?= strip
 CFLAGS = -O2 -Wall -I/usr/include/cdk
 LDFLAGS = -lcdk -lncurses
 
@@ -15,8 +14,6 @@ default: $(EXE)
 $(EXE): %: %.o
        @echo '  [LD] $<'
        @$(CC) -o $@ $< $(LDFLAGS)
-       @echo '  [STRIP] $<'
-       @$(STRIP) $@
 
 install: $(EXE)
        @echo '  [INSTALL] $<'
diff --git a/src/debian/changelog b/src/debian/changelog
deleted file mode 100644 (file)
index 6f7f324..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-shgen (0.1-1) lucid; urgency=low
-
-  * Initial release
-
- -- dragan <ebelcrom@gmail.com>  Thu, 17 May 2018 23:01:27 +0200
diff --git a/src/debian/compat b/src/debian/compat
deleted file mode 100644 (file)
index ec63514..0000000
+++ /dev/null
@@ -1 +0,0 @@
-9
diff --git a/src/debian/control b/src/debian/control
deleted file mode 100644 (file)
index f784bbc..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-Source: shgen
-Section: misc
-Priority: optional
-Maintainer: dragan <ebelcrom@gmail.com>
-Build-Depends: debhelper (>= 9)
-Standards-Version: 3.9.6
-Homepage: https://binomiant.duckdns.org/MpqU9XX8/shgen.git
-
-Package: shgen
-Architecture: any
-Depends: libc6 (>= 2.4), libncurses5 (>= 5.0), libcdk5 (>= 5.0)
-Description: Console shell script generator.
- Ncurses based shell script generator for execution in a console.
diff --git a/src/debian/copyright b/src/debian/copyright
deleted file mode 100644 (file)
index 4c5d211..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
-Upstream-Name: shgen
-Source: https://binomiant.duckdns.org/MpqU9XX8/shgen.git
-
-Files: *
-Copyright: 2018 dragan <ebelcrom@gmail.com>
-License: GPL-2+
-
-Files: debian/*
-Copyright: 2018 dragan <ebelcrom@gmail.com>
-License: GPL-2+
- This package is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
- .
- This package is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
- .
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <https://www.gnu.org/licenses/>
- .
- On Debian systems, the complete text of the GNU General
- Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
diff --git a/src/debian/rules b/src/debian/rules
deleted file mode 100755 (executable)
index 4ebc141..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/make -f
-# See debhelper(7) (uncomment to enable)
-# output every command that modifies files on the build system.
-#export DH_VERBOSE = 1
-
-
-# see FEATURE AREAS in dpkg-buildflags(1)
-#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
-
-# see ENVIRONMENT in dpkg-buildflags(1)
-# package maintainers to append CFLAGS
-#export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
-# package maintainers to append LDFLAGS
-#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
-
-
-%:
-       dh $@ 
-
-
-# dh_make generated override targets
-# This is example for Cmake (See https://bugs.debian.org/641051 )
-#override_dh_auto_configure:
-#      dh_auto_configure -- #  -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
-
-override_dh_strip:
diff --git a/src/debian/shgen-docs.docs b/src/debian/shgen-docs.docs
deleted file mode 100644 (file)
index 7319041..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-README.source
-README.Debian
diff --git a/src/debian/source/format b/src/debian/source/format
deleted file mode 100644 (file)
index 163aaf8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-3.0 (quilt)
index ebde091d72916dc0928c10e14bc9a8ffb34c2edb..b10c07482b428b88af74800559195e1864140ed7 100644 (file)
@@ -2,17 +2,6 @@
 #include <wait.h>
 #include <signal.h>
 
-/*
- * TODO:
- *   sha bang: /bin/sh|bash
- *   header: comment, license
- *   lib.sh: log, error, warning
- *   BASH_XTRACEFD, debug file
- * - check defined
- *   name and directory
- * - parameters...
- */
-
 static int x_size = 0;
 static int y_size = 0;
 
@@ -49,6 +38,7 @@ static CDKBUTTON* lfile_button;
 static CDKENTRY* lfile_entry;
 static CDKBUTTON* generate_button;
 
+static char null[5];
 static char* default_opts = "<C></B><ESCAPE><!B> - Abort   </B><TAB|RETURN><!B> - Next";
 static char* enable_opts = "<C></B><ESCAPE><!B> - Abort   </B><TAB|RETURN><!B> - Next"
        "   </B><SPACE><!B> - Choose";
@@ -85,16 +75,16 @@ static struct s_data
        char* lfile;
 } data =
 {
-       NULL,
+       null,
        FALSE,
-       NULL,
-       NULL,
-       NULL,
+       null,
+       null,
+       null,
        FALSE,
-       NULL,
-       { NULL, NULL, NULL, NULL },
+       null,
+       { null, null, null, null },
        FALSE,
-       NULL
+       null
 };
 
 static void create_button(CDKSCREEN* screen);
@@ -401,7 +391,7 @@ static int process_common(void)
        {
                /* register choice */
                int i;
-               for (i = 0; i < sizeof(data.common); i++)
+               for (i = 0; i < sizeof(data.common) / sizeof(data.common[0]); i++)
                {
                        if (common_selection->selections[i])
                        {
@@ -445,7 +435,7 @@ DFILE:
                                if (filename != NULL && strlen(filename) > 0)
                                {
                                        /* register choice */
-                                       if (data.dfile != NULL)
+                                       if (strcmp(data.dfile, "NULL"))
                                        {
                                                free(data.dfile);
                                        }
@@ -647,7 +637,7 @@ LFILE:
                                if (filename != NULL && strlen(filename) > 0)
                                {
                                        /* register choice */
-                                       if (data.lfile != NULL)
+                                       if (strcmp(data.lfile, "NULL"))
                                        {
                                                free(data.lfile);
                                        }
@@ -695,7 +685,7 @@ SCRIPT:
                if (filename != NULL && strlen(filename) > 0)
                {
                        /* register choice */
-                       if (data.script != NULL)
+                       if (strcmp(data.script, "NULL"))
                        {
                                free(data.script);
                        }
@@ -759,7 +749,7 @@ static void update_options(char* options)
 
 static void write_settings(int view)
 {
-       char* shabang = data.shabang;
+/*     char* shabang = data.shabang;
 //     boolean header;
        char header[2];
        char* description = data.description;
@@ -806,13 +796,13 @@ static void write_settings(int view)
        snprintf(lib, sizeof(lib), "%i", data.lib);
        if (data.lfile == NULL)
                lfile = "NULL";
-
+*/
        if (view)
        {
-               char* msg[] = { shabang, header, description, license, script,
-                       debug, dfile, common, lib, lfile };
+/*             char* msg[] = { data.shabang, header, data.description, data.license, data.script,
+                       debug, data.dfile, common, lib, data.lfile };
 
-               popupLabel(screen, msg, 10);
+               popupLabel(screen, msg, 10);*/
        }
        else
        {
@@ -899,6 +889,7 @@ void sig_int(int signo)
 
 int main(int argc, char* argv[])
 {
+       snprintf(null, sizeof(null), "%s", "NULL");
        dimension_check();
 
        window = initscr();