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