Ignore:
Timestamp:
Apr 9, 2009, 10:18:54 PM (14 years ago)
Author:
Jari Häkkinen
Message:

Merged trunk changes r645:782 to replacing_gnuplot branch.

Location:
branches/replacing_gnuplot
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/replacing_gnuplot

    • Property svn:ignore
      •  

        old new  
        88autom4te.cache
        99INSTALL
        10 COPYING
        1110aclocal.m4
        1211Makefile
  • branches/replacing_gnuplot/lib/utility.cc

    r646 r784  
    22
    33/*
    4   Copyright (C) 2006, 2007 Jari Häkkinen, Peter Johansson
    5 
    6   This file is part of svndigest, http://trac.thep.lu.se/svndigest
     4  Copyright (C) 2006, 2007, 2009 Jari Häkkinen, Peter Johansson
     5  Copyright (C) 2008 Peter Johansson
     6
     7  This file is part of svndigest, http://dev.thep.lu.se/svndigest
    78
    89  svndigest is free software; you can redistribute it and/or modify it
    910  under the terms of the GNU General Public License as published by
    10   the Free Software Foundation; either version 2 of the License, or
     11  the Free Software Foundation; either version 3 of the License, or
    1112  (at your option) any later version.
    1213
     
    1718
    1819  You should have received a copy of the GNU General Public License
    19   along with this program; if not, write to the Free Software
    20   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
    21   02111-1307, USA.
     20  along with svndigest. If not, see <http://www.gnu.org/licenses/>.
    2221*/
    2322
     
    2928#include <cassert>
    3029#include <cerrno>
     30#include <cstdio>
    3131#include <cstdlib>
     32#include <cstring>
    3233#include <fstream>
    3334#include <sstream>
     
    3536#include <string>
    3637#include <sys/param.h>
     38#include <sys/stat.h>
    3739#include <unistd.h>
    3840
     
    6567
    6668
     69  std::string concatenate_path(std::string dir, std::string base)
     70  {
     71    if (dir.empty() || dir==".")
     72      return base;
     73    if (dir[dir.size()-1]!='/')
     74      dir.append("/");
     75    return dir+base;
     76  }
     77
     78
    6779  void copy_file(const std::string& source, const std::string& target)
    6880  {
     
    8799  {
    88100    size_t pos = path.find_last_of("/");
     101    if (pos==std::string::npos)
     102      return ".";
    89103    if (pos==path.size()-1)
    90104      return directory_name(path.substr(0,path.size()-2));
     
    180194    if (code){
    181195      std::stringstream ss;
    182       ss << "mkdir(" << dir << "): failed with error code: errno=" << errno;
     196      ss << "mkdir(" << dir << "): failed\n" << strerror(errno);
    183197      throw std::runtime_error(ss.str());
    184198    }
     
    324338
    325339
    326   std::string version_string(void)
    327   {
    328     std::stringstream ss;
    329     ss << " (";
    330     if (DEV_BUILD)
    331       ss << "r" << svn_revision() << " ";
    332     ss << "compiled " << compilation_time() << ", " << compilation_date()
    333        << ")";
    334     return ss.str();
    335   }
    336 
    337 
    338340  std::string match(std::string::const_iterator& first,
    339341                    const std::string::const_iterator& last,
Note: See TracChangeset for help on using the changeset viewer.