X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftar.cpp;h=0b61b39b85cd4567b8eaf139ee29fb89958d2a53;hb=b3b2a8666defb9e1a5937bcfefc1bc8e02793aab;hp=bd29aafc56543547a0f91c5b360398aae2546e48;hpb=ab25857fd626152bc9a2832de82b400c062857e6;p=builder.git diff --git a/source/tar.cpp b/source/tar.cpp index bd29aaf..0b61b39 100644 --- a/source/tar.cpp +++ b/source/tar.cpp @@ -6,9 +6,10 @@ Distributed under the LGPL */ #include +#include #include #include "builder.h" -#include "package.h" +#include "sourcepackage.h" #include "tar.h" #include "tarball.h" @@ -37,10 +38,10 @@ Tar::Worker::Worker(Tar &t): void Tar::Worker::main() { - const Path::Path &pkg_src=tar.tarball.get_package()->get_source(); - Path::Path basedir=Path::splitext(Path::basename(tar.tarball.get_name())).base; + const Path &pkg_src=tar.tarball.get_package()->get_source(); + Path basedir=splitext(basename(tar.tarball.get_name())).base; - ofstream out(tar.tarball.get_name().c_str()); + IO::File out(tar.tarball.get_name(), IO::M_WRITE); const TargetList &deps=tar.tarball.get_depends(); for(TargetList::const_iterator i=deps.begin(); i!=deps.end(); ++i) { @@ -57,8 +58,7 @@ void Tar::Worker::main() memcpy(buf, rel_path.data(), rel_path.size()); - struct stat st; - Path::stat((*i)->get_name(), st); + struct stat st=stat((*i)->get_name()); store_number(buf+100, st.st_mode, 7); store_number(buf+108, st.st_uid, 7); store_number(buf+116, st.st_gid, 7); @@ -74,11 +74,10 @@ void Tar::Worker::main() buf[155]=0; out.write(buf, 512); - ifstream in((*i)->get_name().c_str()); + IO::File in((*i)->get_name()); for(int j=0; j