| Line |
Branch |
Exec |
Source |
| 1 |
|
|
/** |
| 2 |
|
|
* This file is part of the CernVM File System |
| 3 |
|
|
*/ |
| 4 |
|
|
|
| 5 |
|
|
#ifndef CVMFS_SYNC_ITEM_TAR_H_ |
| 6 |
|
|
#define CVMFS_SYNC_ITEM_TAR_H_ |
| 7 |
|
|
|
| 8 |
|
|
#include <string> |
| 9 |
|
|
|
| 10 |
|
|
#include "directory_entry.h" |
| 11 |
|
|
#include "duplex_libarchive.h" |
| 12 |
|
|
#include "ingestion/ingestion_source.h" |
| 13 |
|
|
#include "sync_item.h" |
| 14 |
|
|
#include "sync_union_tarball.h" |
| 15 |
|
|
#include "util/concurrency.h" |
| 16 |
|
|
#include "util/platform.h" |
| 17 |
|
|
|
| 18 |
|
|
namespace publish { |
| 19 |
|
|
|
| 20 |
|
|
class SyncItemTar : public SyncItem { |
| 21 |
|
|
friend class SyncUnionTarball; |
| 22 |
|
|
|
| 23 |
|
|
public: |
| 24 |
|
|
virtual catalog::DirectoryEntryBase CreateBasicCatalogDirent( |
| 25 |
|
|
bool enable_mtime_ns) const; |
| 26 |
|
|
virtual IngestionSource *CreateIngestionSource() const; |
| 27 |
|
36 |
virtual void MakePlaceholderDirectory() const { rdonly_type_ = kItemDir; } |
| 28 |
|
|
virtual SyncItemType GetScratchFiletype() const; |
| 29 |
|
|
virtual bool IsType(const SyncItemType expected_type) const; |
| 30 |
|
|
virtual void StatScratch(const bool refresh) const; |
| 31 |
|
|
|
| 32 |
|
|
protected: |
| 33 |
|
|
SyncItemTar(const std::string &relative_parent_path, |
| 34 |
|
|
const std::string &filename, struct archive *archive, |
| 35 |
|
|
struct archive_entry *entry, Signal *read_archive_signal, |
| 36 |
|
|
const SyncUnion *union_engine, const uid_t uid, const gid_t gid); |
| 37 |
|
|
SyncItemTar(const std::string &relative_parent_path, |
| 38 |
|
|
const std::string &filename, struct archive *archive, |
| 39 |
|
|
struct archive_entry *entry, Signal *read_archive_signal, |
| 40 |
|
|
const SyncUnion *union_engine); |
| 41 |
|
|
|
| 42 |
|
|
private: |
| 43 |
|
|
struct archive *archive_; |
| 44 |
|
|
struct archive_entry *archive_entry_; |
| 45 |
|
|
platform_stat64 GetStatFromTar() const; |
| 46 |
|
|
mutable platform_stat64 tar_stat_; |
| 47 |
|
|
mutable bool obtained_tar_stat_; |
| 48 |
|
|
Signal *read_archive_signal_; |
| 49 |
|
|
const uid_t uid_; |
| 50 |
|
|
const gid_t gid_; |
| 51 |
|
|
}; |
| 52 |
|
|
|
| 53 |
|
|
} // namespace publish |
| 54 |
|
|
|
| 55 |
|
|
#endif // CVMFS_SYNC_ITEM_TAR_H_ |
| 56 |
|
|
|