X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Ftar.cpp;h=04beabfdd83d52828c6ccb6e34a68fa8518345bc;hb=f5d3127099bc41f986094eb98732849ee9bfb748;hp=da579250a15654b978cda94eef621af1afbe319e;hpb=4d0d003b022943d8a0e39ba19078bab8d32d8857;p=builder.git diff --git a/source/tar.cpp b/source/tar.cpp index da57925..04beabf 100644 --- a/source/tar.cpp +++ b/source/tar.cpp @@ -6,7 +6,10 @@ Distributed under the LGPL */ #include -#include +#include +#include +#include +#include #include "builder.h" #include "sourcepackage.h" #include "tar.h" @@ -37,10 +40,10 @@ Tar::Worker::Worker(Tar &t): void Tar::Worker::main() { - const Path &pkg_src=tar.tarball.get_package()->get_source(); - Path basedir=splitext(basename(tar.tarball.get_name())).base; + const FS::Path &pkg_src=tar.tarball.get_package()->get_source(); + FS::Path basedir=FS::basepart(FS::basename(tar.tarball.get_name())); - 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,7 +60,7 @@ void Tar::Worker::main() memcpy(buf, rel_path.data(), rel_path.size()); - struct stat st=stat((*i)->get_name()); + struct stat st=FS::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); @@ -73,11 +76,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