paludis Version 3.0.2
The one true package mangler
tar_merger.hh
1/* vim: set sw=4 sts=4 et foldmethod=syntax : */
2
3/*
4 * Copyright (c) 2010, 2011 Ciaran McCreesh
5 *
6 * This file is part of the Paludis package manager. Paludis is free software;
7 * you can redistribute it and/or modify it under the terms of the GNU General
8 * Public License version 2, as published by the Free Software Foundation.
9 *
10 * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
11 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
17 * Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#ifndef PALUDIS_GUARD_PALUDIS_TAR_MERGER_HH
21#define PALUDIS_GUARD_PALUDIS_TAR_MERGER_HH 1
22
23#include <paludis/tar_merger-fwd.hh>
24#include <paludis/util/timestamp.hh>
25#include <paludis/merger.hh>
26
27namespace paludis
28{
29 namespace n
30 {
31 typedef Name<struct name_compression> compression;
32 typedef Name<struct name_environment> environment;
33 typedef Name<struct name_fix_mtimes_before> fix_mtimes_before;
34 typedef Name<struct name_get_new_ids_or_minus_one> get_new_ids_or_minus_one;
35 typedef Name<struct name_image> image;
36 typedef Name<struct name_install_under> install_under;
37 typedef Name<struct name_maybe_output_manager> maybe_output_manager;
38 typedef Name<struct name_merged_entries> merged_entries;
39 typedef Name<struct name_no_chown> no_chown;
40 typedef Name<struct name_options> options;
41 typedef Name<struct name_permit_destination> permit_destination;
42 typedef Name<struct name_root> root;
43 typedef Name<struct name_tar_file> tar_file;
44 }
45
46 /**
47 * Parameters for a basic TarMerger.
48 *
49 * \see Merger
50 * \ingroup g_repository
51 * \nosubgrouping
52 * \since 0.51
53 */
70
71 class PALUDIS_VISIBLE TarMerger :
72 public Merger
73 {
74 private:
75 Pimp<TarMerger> _imp;
76
77 protected:
78 FSPath canonicalise_root_path(const FSPath & f) override;
79
80 virtual void add_file(const FSPath &, const FSPath &);
81
82 virtual void track_install_dir(const FSPath &, const FSPath &) = 0;
83 virtual void track_install_file(const FSPath &, const FSPath &) = 0;
84 virtual void track_install_sym(const FSPath &, const FSPath &) = 0;
85
86 public:
87 TarMerger(const TarMergerParams &);
88 ~TarMerger();
89
90 void on_dir_main(bool is_check, const FSPath &, const FSPath &) override;
91 void on_file_main(bool is_check, const FSPath &, const FSPath &) override;
92 void on_sym_main(bool is_check, const FSPath &, const FSPath &) override;
93
94 void prepare_install_under() override;
95
96 void merge() override;
97 };
98}
99
100#endif
Definition fs_path.hh:34
Definition named_value.hh:51
Definition pimp.hh:52
void merge() override
#define PALUDIS_VISIBLE
Definition attributes.hh:59
Definition about_metadata-fwd.hh:24
Definition tar_merger.hh:55