SVN Commit by dpage: r4185 - in trunk/pgadmin3: . xtra/pgagent xtra/pgagent/include

From: svn(at)pgadmin(dot)org
To: pgadmin-hackers(at)postgresql(dot)org
Subject: SVN Commit by dpage: r4185 - in trunk/pgadmin3: . xtra/pgagent xtra/pgagent/include
Date: 2005-05-16 15:45:05
Message-ID: 200505161545.j4GFj5El006593@developer.pgadmin.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Author: dpage
Date: 2005-05-16 16:45:05 +0100 (Mon, 16 May 2005)
New Revision: 4185

Modified:
trunk/pgadmin3/configure.ac
trunk/pgadmin3/xtra/pgagent/Makefile.am
trunk/pgadmin3/xtra/pgagent/include/connection.h
trunk/pgadmin3/xtra/pgagent/include/job.h
trunk/pgadmin3/xtra/pgagent/include/misc.h
trunk/pgadmin3/xtra/pgagent/include/pgAgent.h
trunk/pgadmin3/xtra/pgagent/job.cpp
trunk/pgadmin3/xtra/pgagent/misc.cpp
trunk/pgadmin3/xtra/pgagent/pgAgent.cpp
Log:
Include pgAgent in the unix build. Add beginnings of unix code to compliment Win32 service code. Compiles relatively cleanly, but almost certainly won't work yet.

Modified: trunk/pgadmin3/configure.ac
===================================================================
--- trunk/pgadmin3/configure.ac 2005-05-16 14:00:43 UTC (rev 4184)
+++ trunk/pgadmin3/configure.ac 2005-05-16 15:45:05 UTC (rev 4185)
@@ -41,7 +41,7 @@

AC_CONFIG_FILES([Makefile
i18n/Makefile
- src/Makefile
+ src/Makefile
pkg/Makefile
pkg/debian/Makefile
pkg/fc1/Makefile

Modified: trunk/pgadmin3/xtra/pgagent/Makefile.am
===================================================================
--- trunk/pgadmin3/xtra/pgagent/Makefile.am 2005-05-16 14:00:43 UTC (rev 4184)
+++ trunk/pgadmin3/xtra/pgagent/Makefile.am 2005-05-16 15:45:05 UTC (rev 4185)
@@ -4,23 +4,49 @@
#
# Makefile - Makefile for *nix systems

-# Note: At the moment this doesn't build anything - it just includes
-# the files until Dave ports pgAgent to *nix.
+bin_PROGRAMS = pgagent

-EXTRA_DIST = \
+pgagent_SOURCES = \
$(srcdir)/connection.cpp \
$(srcdir)/job.cpp \
- $(srcdir)/misc.cpp
+ $(srcdir)/misc.cpp \
$(srcdir)/pgAgent.cpp \
- $(srcdir)/precomp.cpp \
- $(srcdir)/win32.cpp \
- $(srcdir)/pgAgent.dsp \
- $(srcdir)/pgAgent.dsw \
- $(srcdir)/pgAgent.rc \
- $(srcdir)/pgagent.sql
+ $(srcdir)/unix.cpp

+EXTRA_DIST = \
+ $(srcdir)/win32.cpp \
+ $(srcdir)/pgAgent.dsp \
+ $(srcdir)/pgAgent.dsw \
+ $(srcdir)/pgAgent.rc \
+ $(srcdir)/pgagent.sql
+
noinst_HEADERS = \
$(srcdir)/include/connection.h \
$(srcdir)/include/job.h \
$(srcdir)/include/misc.h \
$(srcdir)/include/pgAgent.h
+
+if !APPBUNDLE
+
+AM_CXXFLAGS = -DDATA_DIR=\"$(pkgdatadir)/\" -Wall -g -I$(srcdir)/include
+AM_CPPFLAGS = -DDATA_DIR=\"$(pkgdatadir)/\" -Wall -g -I$(srcdir)/include
+AM_CFLAGS = -DDATA_DIR=\"$(pkgdatadir)/\" -Wall -g -I$(srcdir)/include
+
+# Automake trys to execute install-exec-hook if it appears anywhere in the file, so we need a dummy
+# for non-APPBUNDLE cases.
+install-exec-hook:
+
+else
+
+AM_CXXFLAGS = -Wall -g -I$(srcdir)/include
+AM_CPPFLAGS = -Wall -g -I$(srcdir)/include
+AM_CFLAGS = -Wall -g -I$(srcdir)/include
+install-exec-hook:
+ cd $(bindir) ;\
+ mv pgagent tmp ;\
+ mv tmp pgagent ;\
+ if test "$(pg_debug_build)" = "no"; then \
+ strip pgagent ;\
+ fi
+
+endif

Modified: trunk/pgadmin3/xtra/pgagent/include/connection.h
===================================================================
--- trunk/pgadmin3/xtra/pgagent/include/connection.h 2005-05-16 14:00:43 UTC (rev 4184)
+++ trunk/pgadmin3/xtra/pgagent/include/connection.h 2005-05-16 15:45:05 UTC (rev 4185)
@@ -80,4 +80,5 @@
friend class DBconn;
};

-#endif // CONNECTION_H
\ No newline at end of file
+#endif // CONNECTION_H
+

Modified: trunk/pgadmin3/xtra/pgagent/include/job.h
===================================================================
--- trunk/pgadmin3/xtra/pgagent/include/job.h 2005-05-16 14:00:43 UTC (rev 4184)
+++ trunk/pgadmin3/xtra/pgagent/include/job.h 2005-05-16 15:45:05 UTC (rev 4185)
@@ -28,4 +28,5 @@
string status;
};

-#endif // JOB_H
\ No newline at end of file
+#endif // JOB_H
+

Modified: trunk/pgadmin3/xtra/pgagent/include/misc.h
===================================================================
--- trunk/pgadmin3/xtra/pgagent/include/misc.h 2005-05-16 14:00:43 UTC (rev 4184)
+++ trunk/pgadmin3/xtra/pgagent/include/misc.h 2005-05-16 15:45:05 UTC (rev 4185)
@@ -20,4 +20,5 @@
string getArg(int &argc, char** &argv);
string NumToStr(const long l);

-#endif // MISC_H
\ No newline at end of file
+#endif // MISC_H
+

Modified: trunk/pgadmin3/xtra/pgagent/include/pgAgent.h
===================================================================
--- trunk/pgadmin3/xtra/pgagent/include/pgAgent.h 2005-05-16 14:00:43 UTC (rev 4184)
+++ trunk/pgadmin3/xtra/pgagent/include/pgAgent.h 2005-05-16 15:45:05 UTC (rev 4185)
@@ -16,7 +16,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string>
-#include <strstream>
+#include <sstream>

using namespace std;

@@ -35,4 +35,5 @@

void MainLoop();

-#endif PGAGENT_H
\ No newline at end of file
+#endif // PGAGENT_H
+

Modified: trunk/pgadmin3/xtra/pgagent/job.cpp
===================================================================
--- trunk/pgadmin3/xtra/pgagent/job.cpp 2005-05-16 14:00:43 UTC (rev 4184)
+++ trunk/pgadmin3/xtra/pgagent/job.cpp 2005-05-16 15:45:05 UTC (rev 4185)
@@ -155,4 +155,4 @@

status = 's';
return 0;
-}
\ No newline at end of file
+}

Modified: trunk/pgadmin3/xtra/pgagent/misc.cpp
===================================================================
--- trunk/pgadmin3/xtra/pgagent/misc.cpp 2005-05-16 14:00:43 UTC (rev 4184)
+++ trunk/pgadmin3/xtra/pgagent/misc.cpp 2005-05-16 15:45:05 UTC (rev 4185)
@@ -10,8 +10,13 @@
//////////////////////////////////////////////////////////////////////////

#include "pgAgent.h"
-#include "windows.h"

+#ifdef WIN32
+#include <windows.h>
+#else
+#include <unistd.h>
+#endif
+
void fatal(const string &text)
{
printf(text.c_str());
@@ -97,8 +102,12 @@

while (count--)
{
+#ifdef WIN32
CheckForInterrupt();
Sleep(1000);
+#else
+ sleep(1);
+#endif
}
}

@@ -109,4 +118,4 @@
char buf[40];
sprintf(buf, "%ld", l);
return buf;
-}
\ No newline at end of file
+}

Modified: trunk/pgadmin3/xtra/pgagent/pgAgent.cpp
===================================================================
--- trunk/pgadmin3/xtra/pgagent/pgAgent.cpp 2005-05-16 14:00:43 UTC (rev 4184)
+++ trunk/pgadmin3/xtra/pgagent/pgAgent.cpp 2005-05-16 15:45:05 UTC (rev 4185)
@@ -132,4 +132,4 @@
WaitAWhile(true);
}
while (1);
-}
\ No newline at end of file
+}

Browse pgadmin-hackers by date

  From Date Subject
Next Message svn 2005-05-17 06:57:26 SVN Commit by dpage: r4186 - trunk/pgadmin3/xtra/pgagent
Previous Message svn 2005-05-16 14:00:44 SVN Commit by dpage: r4184 - in trunk/pgadmin3/src: agent ctl include/ctl