diff options
author | Johannes Winkelmann <jw@smts.ch> | 2006-04-07 07:49:13 +0000 |
---|---|---|
committer | Johannes Winkelmann <jw@smts.ch> | 2006-04-07 07:49:13 +0000 |
commit | 5634324b6525fd1f95d40e6ed4e3126ca55ce50a (patch) | |
tree | eb8cf0ef4dce5875bb8b85aac36e160695929aa5 | |
parent | ec36dcd199752b66013fe8530006e08aee9a76ed (diff) | |
download | prt-get-5634324b6525fd1f95d40e6ed4e3126ca55ce50a.tar.gz prt-get-5634324b6525fd1f95d40e6ed4e3126ca55ce50a.tar.xz |
prt-get: add timestamps to log files
git-svn-id: https://crux.nu/svn/tools/prt-get/trunk@1170 0b5ae1c7-2405-0410-a7fc-ba219f786e1e
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | TODO | 3 | ||||
-rwxr-xr-x | configure | 2 | ||||
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | src/installtransaction.cpp | 25 |
5 files changed, 27 insertions, 7 deletions
@@ -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' @@ -4,6 +4,8 @@ $PKGMK_PACKAGE_DIR` to determine PACKAGE_DIR - 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 @@ config: go through additional configuration options; add and/or replace - 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" @@ -1614,7 +1614,7 @@ fi # Define the identity of the package. PACKAGE=prt-get - VERSION=0.5.12pre + VERSION=0.5.12pre2 cat >>confdefs.h <<_ACEOF diff --git a/configure.in b/configure.in index 49bf314..cafe635 100644 --- a/configure.in +++ b/configure.in @@ -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 diff --git a/src/installtransaction.cpp b/src/installtransaction.cpp index e75d1b8..c1f7718 100644 --- a/src/installtransaction.cpp +++ b/src/installtransaction.cpp @@ -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 @@ InstallTransaction::installPackage( const Package* package, 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 @@ InstallTransaction::installPackage( const Package* package, 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 @@ InstallTransaction::installPackage( const Package* package, 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 @@ InstallTransaction::installPackage( const Package* package, 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 ); |