diff options
Diffstat (limited to 'dev-libs/dvutil/files/dvutil-0.15.4-namespace_fix.patch')
-rw-r--r-- | dev-libs/dvutil/files/dvutil-0.15.4-namespace_fix.patch | 466 |
1 files changed, 466 insertions, 0 deletions
diff --git a/dev-libs/dvutil/files/dvutil-0.15.4-namespace_fix.patch b/dev-libs/dvutil/files/dvutil-0.15.4-namespace_fix.patch new file mode 100644 index 000000000000..c861d828b15e --- /dev/null +++ b/dev-libs/dvutil/files/dvutil-0.15.4-namespace_fix.patch @@ -0,0 +1,466 @@ +diff -Naur dvutil-0.15.4.orig/dvutil/file.C dvutil-0.15.4/dvutil/file.C +--- dvutil-0.15.4.orig/dvutil/file.C 2007-12-31 11:43:39.000000000 +0100 ++++ dvutil-0.15.4/dvutil/file.C 2007-12-31 11:49:04.000000000 +0100 +@@ -8,12 +8,12 @@ + #include <sys/param.h> // MAXPATHLEN + #include <sys/mman.h> // mmap() + #include <fcntl.h> // O_RDONLY +-#include <stdio.h> // open() ++#include <cstdio> // open() + #include <unistd.h> // close(), rmdir(), getcwd() + #include <dirent.h> // opendir() +-#include <stdlib.h> // free() mktemp() [ getcwd(0) ] +-#include <errno.h> // errno +-#include <string.h> // strerror() ++#include <cstdlib> // free() mktemp() [ getcwd(0) ] ++#include <cerrno> // errno ++#include <cstring> // strerror() + #include <utime.h> // strerror() + + +@@ -35,20 +35,23 @@ + + /////////////////// FileError + +-const std::string Dv::Util::FileError::NAME("Dv::Util::FileError"); ++namespace Dv { ++namespace Util { ++ ++const std::string FileError::NAME("Dv::Util::FileError"); + + /////////////////// File + +-Dv::Util::File::File(const std::string& path) throw (Dv::Util::FileError): path_(path), addr_(0) { ++File::File(const std::string& path) throw (Dv::Util::FileError): path_(path), addr_(0) { + refresh(); + } + +-Dv::Util::File::File(const Dv::Util::File& f) throw (Dv::Util::FileError): path_(f.str()), addr_(0) { ++File::File(const Dv::Util::File& f) throw (Dv::Util::FileError): path_(f.str()), addr_(0) { + refresh(); + } + + Dv::Util::File& +-Dv::Util::File::operator=(const Dv::Util::File& f) throw (Dv::Util::FileError) { ++File::operator=(const Dv::Util::File& f) throw (Dv::Util::FileError) { + if (this==&f) + return *this; + unmap(); +@@ -57,12 +60,12 @@ + return *this; + } + +-Dv::Util::File::~File() { ++File::~File() { + unmap(); + } + + Dv::Util::File& +-Dv::Util::File::expand() throw (Dv::Util::FileError) { ++File::expand() throw (Dv::Util::FileError) { + refresh(); + path_ = realpath(); + refresh(); +@@ -70,7 +73,7 @@ + } + + void +-Dv::Util::File::refresh() const throw (Dv::Util::FileError) { ++File::refresh() const throw (Dv::Util::FileError) { + // set all data members: + // stats_ + // exist_ +@@ -114,14 +117,14 @@ + } + + std::string +-Dv::Util::File::absolute_path(const std::string& path) throw (Dv::Util::FileError) { ++File::absolute_path(const std::string& path) throw (Dv::Util::FileError) { + std::string resolved_path; + Dv::Util::File::fullpath(path, resolved_path); + return resolved_path; + } + + std::string +-Dv::Util::File::realpath() const throw (Dv::Util::FileError) { ++File::realpath() const throw (Dv::Util::FileError) { + char resolved_name[MAXPATHLEN]; + std::string cwd(Dv::Util::Directory::pwd()); + if (::realpath(path(), resolved_name)==NULL) { +@@ -135,49 +138,49 @@ + + + time_t +-Dv::Util::File::last_modified() const throw (Dv::Util::FileError) { ++File::last_modified() const throw (Dv::Util::FileError) { + if (exists()) + return stats_.st_mtime; + return 0; + } + + time_t +-Dv::Util::File::last_accessed() const throw (Dv::Util::FileError) { ++File::last_accessed() const throw (Dv::Util::FileError) { + if (exists()) + return stats_.st_atime; + return 0; + } + + size_t +-Dv::Util::File::size() const throw (Dv::Util::FileError) { ++File::size() const throw (Dv::Util::FileError) { + if (exists()) + return stats_.st_size; + return 0; + } + + mode_t +-Dv::Util::File::mode() const throw (Dv::Util::FileError) { ++File::mode() const throw (Dv::Util::FileError) { + if (exists()) + return stats_.st_mode & 07777; + return 0; + } + + uid_t +-Dv::Util::File::owner() const throw (Dv::Util::FileError) { ++File::owner() const throw (Dv::Util::FileError) { + if (exists()) + return stats_.st_uid; + return 0; + } + + gid_t +-Dv::Util::File::group() const throw (Dv::Util::FileError) { ++File::group() const throw (Dv::Util::FileError) { + if (exists()) + return stats_.st_gid; + return 0; + } + + Dv::Util::File::Type +-Dv::Util::File::type() const throw (Dv::Util::FileError) { ++File::type() const throw (Dv::Util::FileError) { + if (!exists()) + return NONEXISTENT; + else +@@ -185,7 +188,7 @@ + } + + bool +-Dv::Util::operator==(const Dv::Util::File& f1, const Dv::Util::File& f2) { ++operator==(const Dv::Util::File& f1, const Dv::Util::File& f2) { + // 2 Files are identical if they have the same i-node # on the same device. + f1.refresh(); + if (!f1) +@@ -197,7 +200,7 @@ + } + + bool +-Dv::Util::operator<(const Dv::Util::File& f1,const Dv::Util::File& f2) { ++operator<(const Dv::Util::File& f1,const Dv::Util::File& f2) { + // 2 Files are identical if they have the same i-node # on the same device. + f1.refresh(); + if (!f1) +@@ -212,7 +215,7 @@ + } + + const void* +-Dv::Util::File::map() throw (Dv::Util::FileError) { ++File::map() throw (Dv::Util::FileError) { + if (addr_) + return addr_; + if (!exists()) +@@ -231,7 +234,7 @@ + } + + void +-Dv::Util::File::unmap() throw (Dv::Util::FileError) { ++File::unmap() throw (Dv::Util::FileError) { + if (addr_) + if (munmap(static_cast<caddr_t>(addr_), size())<0) + throw Dv::Util::FileError(str()+".unmap(): munmap failed."); +@@ -239,7 +242,7 @@ + } + + std::string& +-Dv::Util::File::content(std::string& s) const throw (Dv::Util::FileError) { ++File::content(std::string& s) const throw (Dv::Util::FileError) { + if (! exists()) + throw Dv::Util::FileError(str() + ": does not exist"); + const void* pv(const_cast<Dv::Util::File*>(this)->map()); +@@ -250,7 +253,7 @@ + } + + std::string +-Dv::Util::File::content() const throw (Dv::Util::FileError) { ++File::content() const throw (Dv::Util::FileError) { + std::string s; + return content(s); + } +@@ -258,7 +261,7 @@ + static unsigned char hexchars[] = "0123456789abcdef"; + + std::string +-Dv::Util::File::md5(unsigned char* md5sum) throw (Dv::Util::FileError) { ++File::md5(unsigned char* md5sum) throw (Dv::Util::FileError) { + #if HAVE_OPENSSL > 0 + unsigned char* md5; + if(md5sum) +@@ -282,7 +285,7 @@ + } + + std::string +-Dv::Util::File::sha1(unsigned char* sha1sum) throw (Dv::Util::FileError) { ++File::sha1(unsigned char* sha1sum) throw (Dv::Util::FileError) { + #if HAVE_OPENSSL > 0 + unsigned char* sha1; + if (sha1sum) +@@ -306,7 +309,7 @@ + } + + bool +-Dv::Util::File::chown(uid_t uid) const throw (Dv::Util::FileError) { ++File::chown(uid_t uid) const throw (Dv::Util::FileError) { + if (!exists()) + return false; + if (::chown(path(),uid,static_cast<gid_t>(-1))<0) +@@ -315,7 +318,7 @@ + } + + bool +-Dv::Util::File::chgrp(const char* groupname) const throw (Dv::Util::FileError) { ++File::chgrp(const char* groupname) const throw (Dv::Util::FileError) { + if (!exists()) + return false; + struct group* gr(0); +@@ -328,7 +331,7 @@ + } + + bool +-Dv::Util::File::rm() throw (Dv::Util::FileError) { ++File::rm() throw (Dv::Util::FileError) { + if (type_==File::DIRECTORY) + rmdir(path()); + else +@@ -337,7 +340,7 @@ + } + + void +-Dv::Util::File::rmfr() throw (Dv::Util::FileError) { ++File::rmfr() throw (Dv::Util::FileError) { + if (type_!=Dv::Util::File::DIRECTORY) + rm(); + else { +@@ -354,7 +357,7 @@ + } + + bool +-Dv::Util::File::mv(const std::string& newpath) throw (Dv::Util::FileError) { ++File::mv(const std::string& newpath) throw (Dv::Util::FileError) { + if (exists()) { + unmap(); + if (rename(path(),newpath.c_str())<0) +@@ -369,7 +372,7 @@ + } + + bool +-Dv::Util::File::touch(int mode) throw (Dv::Util::FileError) { ++File::touch(int mode) throw (Dv::Util::FileError) { + int fd; + if (exists()) { + Dv::Util::Date now; +@@ -388,7 +391,7 @@ + } + + bool +-Dv::Util::File::mkdir(int mode) throw (Dv::Util::FileError) { ++File::mkdir(int mode) throw (Dv::Util::FileError) { + if (exists()) + return false; + if (::mkdir(path(),mode)<0) +@@ -397,7 +400,7 @@ + } + + bool +-Dv::Util::File::mklink(const std::string& oldpath) throw (Dv::Util::FileError) { ++File::mklink(const std::string& oldpath) throw (Dv::Util::FileError) { + if (exists()) + return false; + if (::link(oldpath.c_str(),path())<0) +@@ -406,7 +409,7 @@ + } + + bool +-Dv::Util::File::mksymlink(const std::string& oldpath) throw (Dv::Util::FileError) { ++File::mksymlink(const std::string& oldpath) throw (Dv::Util::FileError) { + if (exists()) + return false; + if (::symlink(oldpath.c_str(),path())<0) +@@ -415,7 +418,7 @@ + } + + bool +-Dv::Util::File::chmod(int mode) throw (Dv::Util::FileError) { ++File::chmod(int mode) throw (Dv::Util::FileError) { + if (!exists()) + return false; + if (::chmod(path(),mode)<0) +@@ -424,7 +427,7 @@ + } + + const std::string& +-Dv::Util::File::typestr(Type t) throw (Dv::Util::FileError) { ++File::typestr(Type t) throw (Dv::Util::FileError) { + static const std::string S_SYMLINK("SYMLINK"); + static const std::string S_REGULAR("REGULAR"); + static const std::string S_DIRECTORY("DIRECTORY"); +@@ -459,7 +462,7 @@ + } + + std::string +-Dv::Util::File::relpath(const std::string& from) const throw (Dv::Util::FileError) { ++File::relpath(const std::string& from) const throw (Dv::Util::FileError) { + typedef std::vector<std::string>::const_iterator iter; + std::vector<std::string> pfrom; + std::vector<std::string> pto; +@@ -478,50 +481,50 @@ + } + + std::string +-Dv::Util::File::relpath() const throw (Dv::Util::FileError) { ++File::relpath() const throw (Dv::Util::FileError) { + return relpath(Directory::pwd()); + } + + /////////////////// Directory + +-Dv::Util::FileOperation::~FileOperation() { ++FileOperation::~FileOperation() { + } + + void +-Dv::Util::FileOperation::operator()(const Dv::Util::Directory& parent, ++FileOperation::operator()(const Dv::Util::Directory& parent, + Dv::Util::File& file, const std::string& filename) { + std::cout << "File " << filename << " in directory " << parent.str() << std::endl; + } + +-Dv::Util::DirectoryOperation::~DirectoryOperation() { ++DirectoryOperation::~DirectoryOperation() { + } + + void +-Dv::Util::DirectoryOperation::operator()(const Dv::Util::Directory& parent, ++DirectoryOperation::operator()(const Dv::Util::Directory& parent, + Dv::Util::Directory& directory, const std::string& directoryname) { + std::cout << "Directory " << directoryname << " in directory " << parent.str() << std::endl; + } + +-Dv::Util::Directory::Directory(const std::string& path) throw (Dv::Util::FileError): ++Directory::Directory(const std::string& path) throw (Dv::Util::FileError): + Dv::Util::File(path), files_() { + refresh(); + } + +-Dv::Util::Directory::Directory(const Dv::Util::File& file) throw (Dv::Util::FileError): ++Directory::Directory(const Dv::Util::File& file) throw (Dv::Util::FileError): + Dv::Util::File(file.path()), files_() { + refresh(); + } + +-Dv::Util::Directory::~Directory() { ++Directory::~Directory() { + } + + std::string +-Dv::Util::Directory::file(const std::string& filename) const { ++Directory::file(const std::string& filename) const { + return str()+"/"+filename; + } + + std::string +-Dv::Util::Directory::tempfile(const std::string& prefix) const throw (Dv::Util::FileError) { ++Directory::tempfile(const std::string& prefix) const throw (Dv::Util::FileError) { + std::string tmpname = str() + "/" + prefix + "XXXXXX"; + char tmp[tmpname.size()+1]; + std::copy(tmpname.begin(), tmpname.end(), tmp); +@@ -534,7 +537,7 @@ + } + + std::string +-Dv::Util::Directory::tempdir(const std::string& prefix) const throw (Dv::Util::FileError) { ++Directory::tempdir(const std::string& prefix) const throw (Dv::Util::FileError) { + std::string tmpname = str() + "/" + prefix + "XXXXXX"; + char tmp[tmpname.size()+1]; + std::copy(tmpname.begin(), tmpname.end(), tmp); +@@ -546,7 +549,7 @@ + + + void +-Dv::Util::Directory::refresh() const throw (Dv::Util::FileError) { ++Directory::refresh() const throw (Dv::Util::FileError) { + Dv::Util::File::refresh(); + Dv::Util::Directory* it(const_cast<Directory*>(this)); + it->files_.clear(); +@@ -567,7 +570,7 @@ + } + + std::string +-Dv::Util::Directory::pwd() throw (Dv::Util::FileError) { ++Directory::pwd() throw (Dv::Util::FileError) { + static const std::string error_message(": getcwd failed in Directory::pwd()"); + char pathname[MAXPATHLEN]; + char* cwd(getcwd(pathname,MAXPATHLEN)); +@@ -580,14 +583,14 @@ + } + + bool +-Dv::Util::Directory::cd() const throw (Dv::Util::FileError) { ++Directory::cd() const throw (Dv::Util::FileError) { + if (!exists()) + return false; + return (chdir(path())!=-1); + } + + std::string& +-Dv::Util::File::fullpath(std::string path, std::string& resolved_path) throw (Dv::Util::FileError) { ++File::fullpath(std::string path, std::string& resolved_path) throw (Dv::Util::FileError) { + if (path.size() == 0) + throw Dv::Util::FileError(path + " not a legal path"); + if (path[0] != '/') +@@ -631,14 +634,14 @@ + } + + std::string +-Dv::Util::File::fullpath() const throw (Dv::Util::FileError) { ++File::fullpath() const throw (Dv::Util::FileError) { + std::string resolved_path; + fullpath(path(), resolved_path); + return resolved_path; + } + + void +-Dv::Util::Directory::walk(FileOperation* fileop, DirectoryOperation* dirop) { ++Directory::walk(FileOperation* fileop, DirectoryOperation* dirop) { + // stacks used for keeping track of the walk and to avoid recursion + std::stack<Dv::Util::Directory> directories; + std::stack<std::vector<std::string> > contents; +@@ -711,3 +714,6 @@ + } + } + ++} // namespace Util ++} // namespace Dv ++ +diff -Naur dvutil-0.15.4.orig/dvutil/getdate.h dvutil-0.15.4/dvutil/getdate.h +--- dvutil-0.15.4.orig/dvutil/getdate.h 2007-12-31 11:43:39.000000000 +0100 ++++ dvutil-0.15.4/dvutil/getdate.h 2007-12-31 11:57:12.000000000 +0100 +@@ -43,4 +43,7 @@ + # endif + #endif /* defined (vms) */ + ++// For abort() ++#include <stdlib.h> ++ + time_t get_date PARAMS ((const char *p, const time_t *now)); |