r1170 - in tools/prt-get/trunk: . src
![](https://secure.gravatar.com/avatar/df8330968b6df8cd1c1942c5fb4b720c.jpg?s=120&d=mm&r=g)
Author: jw Date: 2006-04-07 09:49:13 +0200 (Fri, 07 Apr 2006) New Revision: 1170 Modified: tools/prt-get/trunk/ChangeLog tools/prt-get/trunk/TODO tools/prt-get/trunk/configure tools/prt-get/trunk/configure.in tools/prt-get/trunk/src/installtransaction.cpp Log: prt-get: add timestamps to log files Modified: tools/prt-get/trunk/ChangeLog =================================================================== --- tools/prt-get/trunk/ChangeLog 2006-04-07 07:33:50 UTC (rev 1169) +++ tools/prt-get/trunk/ChangeLog 2006-04-07 07:49:13 UTC (rev 1170) @@ -1,4 +1,5 @@ * 0.5.12 00.04.2006 Johannes Winkelmann +- Add 'depinst' in 'help' (thanks Simone) - Fix compilation on OpenBSD - Show alias info in depends - don't install alias file and deplist @@ -9,6 +10,7 @@ - print full add command and PACKAGE_DIR info when using install/update -v - Make 'cat' and 'readme' use $PAGER if set - update default prt-get.conf to reflect new port hierarchy (core/opt/contrib) +- add timestamps to log files * 0.5.11 29.05.2005 Johannes Winkelmann - add --path to 'ls' Modified: tools/prt-get/trunk/TODO =================================================================== --- tools/prt-get/trunk/TODO 2006-04-07 07:33:50 UTC (rev 1169) +++ tools/prt-get/trunk/TODO 2006-04-07 07:49:13 UTC (rev 1170) @@ -4,6 +4,8 @@ - allow dependency injection for sysup, with previews - prefer toolchain (patch in trac) - dependent --list-orphaned; should simplify pkgfoster +- logging: check for non-root owned symlinks +- logging: reject relative logfile names ============================================================================== @@ -45,7 +47,6 @@ - better reports (installed/failed/not even tried to install) [ ] message log for prt-get messages ? -[ ] timestamps for the log file [ ] --quiet mode; suppress output of pkgmk and pkgadd [ ] prt-get diff stats: "100 Packages with differences" Modified: tools/prt-get/trunk/configure =================================================================== --- tools/prt-get/trunk/configure 2006-04-07 07:33:50 UTC (rev 1169) +++ tools/prt-get/trunk/configure 2006-04-07 07:49:13 UTC (rev 1170) @@ -1614,7 +1614,7 @@ # Define the identity of the package. PACKAGE=prt-get - VERSION=0.5.12pre + VERSION=0.5.12pre2 cat >>confdefs.h <<_ACEOF Modified: tools/prt-get/trunk/configure.in =================================================================== --- tools/prt-get/trunk/configure.in 2006-04-07 07:33:50 UTC (rev 1169) +++ tools/prt-get/trunk/configure.in 2006-04-07 07:49:13 UTC (rev 1170) @@ -1,7 +1,7 @@ # Process this file with autoconf to produce a configure script. AC_INIT AC_CONFIG_SRCDIR([src/prtget.cpp]) -AM_INIT_AUTOMAKE(prt-get,0.5.12pre1) +AM_INIT_AUTOMAKE(prt-get,0.5.12pre2) dnl Determine default prefix Modified: tools/prt-get/trunk/src/installtransaction.cpp =================================================================== --- tools/prt-get/trunk/src/installtransaction.cpp 2006-04-07 07:33:50 UTC (rev 1169) +++ tools/prt-get/trunk/src/installtransaction.cpp 2006-04-07 07:49:13 UTC (rev 1170) @@ -18,6 +18,7 @@ #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> +#include <time.h> using namespace std; @@ -191,7 +192,13 @@ int fdlog = -1; string logFile = ""; + string timestamp; + string commandName = "prt-get"; + if ( parser->wasCalledAsPrtCached() ) { + commandName = "prt-cache"; + } + if ( m_config->writeLog() ) { logFile = m_config->logFilePattern(); if ( logFile == "" ) { @@ -228,6 +235,12 @@ if ( fdlog == -1 ) { return LOG_FILE_FAILURE; } + + time_t startTime; + time(&startTime); + timestamp = ctime(&startTime); + timestamp = commandName + ": starting build " + timestamp; + write( fdlog, timestamp.c_str(), timestamp.length()); } string pkgdir = package->path() + "/" + package->name(); @@ -304,10 +317,6 @@ package->version() + "-" + package->release() + ".pkg.tar.gz"; - string commandName = "prt-get"; - if ( parser->wasCalledAsPrtCached() ) { - commandName = "prt-cache"; - } // - inform the user about what's happening string fullCommand = commandName + ": " + cmd + " " + args; @@ -328,9 +337,17 @@ cout << fullCommand << endl; } if ( m_config->writeLog() ) { + time_t endTime; + time(&endTime); + timestamp = ctime(&endTime); + timestamp = commandName + ": build done " + timestamp; + write( fdlog, summary.c_str(), summary.length() ); + write( fdlog, "\n", 1 ); write( fdlog, fullCommand.c_str(), fullCommand.length() ); write( fdlog, "\n", 1 ); + write( fdlog, timestamp.c_str(), timestamp.length()); + write( fdlog, "\n", 1 ); } Process installProc( cmd, args, fdlog );
participants (1)
-
crux@crux.nu