GCC Code Coverage Report


Directory: cvmfs/
File: cvmfs/swissknife_pull.h
Date: 2026-07-05 02:36:18
Exec Total Coverage
Lines: 0 26 0.0%
Branches: 0 0 -%

Line Branch Exec Source
1 /**
2 * This file is part of the CernVM File System.
3 */
4
5 #ifndef CVMFS_SWISSKNIFE_PULL_H_
6 #define CVMFS_SWISSKNIFE_PULL_H_
7
8 #include <string>
9
10 #include "swissknife.h"
11
12 namespace catalog {
13 class Catalog;
14 }
15
16 namespace shash {
17 struct Any;
18 }
19
20 namespace swissknife {
21
22 class CommandPull : public Command {
23 public:
24 ~CommandPull() { }
25 virtual std::string GetName() const { return "pull"; }
26 virtual std::string GetDescription() const {
27 return "Makes a Stratum 1 replica of a Stratum 0 repository.";
28 }
29 virtual ParameterList GetParams() const {
30 ParameterList r;
31 r.push_back(Parameter::Mandatory('u', "repository url"));
32 r.push_back(Parameter::Mandatory('m', "repository name"));
33 r.push_back(Parameter::Mandatory('r', "spooler definition"));
34 r.push_back(Parameter::Mandatory('k', "repository master key(s) / dir"));
35 r.push_back(Parameter::Mandatory('x', "directory for temporary files"));
36 r.push_back(Parameter::Optional('R', "path to reflog.chksum file"));
37 r.push_back(Parameter::Optional('w', "repository stratum1 url"));
38 r.push_back(Parameter::Optional('n', "number of download threads"));
39 r.push_back(Parameter::Optional('l', "log level (0-4, default: 2)"));
40 r.push_back(Parameter::Optional('t', "timeout (s)"));
41 r.push_back(Parameter::Optional('a', "number of retries"));
42 r.push_back(Parameter::Optional('d', "directory for path specification"));
43 r.push_back(Parameter::Optional('E',
44 "inclusion spec for partial replication"));
45 r.push_back(Parameter::Optional('Z', "pull revisions younger than <Z>"));
46 r.push_back(Parameter::Optional('@', "proxy url"));
47 r.push_back(Parameter::Switch('p', "pull catalog history, too"));
48 r.push_back(Parameter::Switch('i', "mark as an 'initial snapshot'"));
49 r.push_back(Parameter::Switch('c', "preload cache instead of stratum 1"));
50 // Required for preloading client cache with a dirtab. If the dirtab
51 // changes, the existence of a catalog does not anymore indicate if
52 // everything in the corresponding subtree is already fetched, too.
53 r.push_back(Parameter::Switch(
54 'z', "look into all catalogs even if already present"));
55 return r;
56 }
57 int Main(const ArgumentList &args);
58
59 protected:
60 bool PullRecursion(catalog::Catalog *catalog, const std::string &path);
61 bool Pull(const shash::Any &catalog_hash, const std::string &path,
62 shash::Any &previous_catalog, bool is_historic_catalog = false);
63 };
64
65 } // namespace swissknife
66
67 #endif // CVMFS_SWISSKNIFE_PULL_H_
68