diff options
author | 2008-02-02 16:58:23 +0000 | |
---|---|---|
committer | 2008-02-02 16:58:23 +0000 | |
commit | 7e9f6701a0db7b6875aced1532621d2a9b49b559 (patch) | |
tree | b0a7f887a838638056badb0690e1c4c25a72a9cd /paludis | |
parent | a5d40f88ff2e5452adb6e1b6f1d73b0bac7efde0 (diff) | |
download | paludis-7e9f6701a0db7b6875aced1532621d2a9b49b559.tar.gz paludis-7e9f6701a0db7b6875aced1532621d2a9b49b559.tar.xz |
Move NDBAM from repositories/unpackaged into the main library.
Diffstat (limited to 'paludis')
-rw-r--r-- | paludis/files.m4 | 3 | ||||
-rw-r--r-- | paludis/ndbam-fwd.hh (renamed from paludis/repositories/unpackaged/ndbam-fwd.hh) | 11 | ||||
-rw-r--r-- | paludis/ndbam.cc (renamed from paludis/repositories/unpackaged/ndbam.cc) | 5 | ||||
-rw-r--r-- | paludis/ndbam.hh | 80 | ||||
-rwxr-xr-x | paludis/ndbam.sr (renamed from paludis/repositories/unpackaged/ndbam.sr) | 0 | ||||
-rw-r--r-- | paludis/ndbam_merger.cc (renamed from paludis/repositories/unpackaged/ndbam_merger.cc) | 5 | ||||
-rw-r--r-- | paludis/ndbam_merger.hh | 60 | ||||
-rw-r--r-- | paludis/ndbam_merger.sr (renamed from paludis/repositories/unpackaged/ndbam_merger.sr) | 0 | ||||
-rw-r--r-- | paludis/ndbam_unmerger.cc (renamed from paludis/repositories/unpackaged/ndbam_unmerger.cc) | 9 | ||||
-rw-r--r-- | paludis/ndbam_unmerger.hh | 78 | ||||
-rw-r--r-- | paludis/ndbam_unmerger.sr (renamed from paludis/repositories/unpackaged/ndbam_unmerger.sr) | 0 | ||||
-rw-r--r-- | paludis/repositories/unpackaged/Makefile.am | 43 | ||||
-rw-r--r-- | paludis/repositories/unpackaged/installed_id.cc | 6 | ||||
-rw-r--r-- | paludis/repositories/unpackaged/installed_id.hh | 4 | ||||
-rw-r--r-- | paludis/repositories/unpackaged/installed_repository.cc | 4 | ||||
-rw-r--r-- | paludis/repositories/unpackaged/ndbam.hh | 84 | ||||
-rw-r--r-- | paludis/repositories/unpackaged/ndbam_merger.hh | 63 | ||||
-rw-r--r-- | paludis/repositories/unpackaged/ndbam_unmerger.hh | 84 |
18 files changed, 242 insertions, 297 deletions
diff --git a/paludis/files.m4 b/paludis/files.m4 index 2f30b5df2..a629d7bad 100644 --- a/paludis/files.m4 +++ b/paludis/files.m4 @@ -40,6 +40,9 @@ add(`merger', `hh', `cc', `se', `sr', `test', `testsc add(`merger_entry_type', `hh', `cc', `se') add(`metadata_key', `hh', `cc', `se', `fwd') add(`name', `hh', `cc', `fwd', `test', `sr', `se') +add(`ndbam', `hh', `cc', `fwd', `sr') +add(`ndbam_merger', `hh', `cc', `sr') +add(`ndbam_unmerger', `hh', `cc', `sr') add(`override_functions', `hh', `cc') add(`package_database', `hh', `cc', `fwd', `test', `se') add(`package_id', `hh', `cc', `fwd', `se') diff --git a/paludis/repositories/unpackaged/ndbam-fwd.hh b/paludis/ndbam-fwd.hh index 6f10c72c8..c4a43a8a8 100644 --- a/paludis/repositories/unpackaged/ndbam-fwd.hh +++ b/paludis/ndbam-fwd.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2007 Ciaran McCreesh + * Copyright (c) 2007, 2008 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -20,12 +20,13 @@ #ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_UNPACKAGED_NDBAM_FWD_HH #define PALUDIS_GUARD_PALUDIS_REPOSITORIES_UNPACKAGED_NDBAM_FWD_HH 1 +#include <paludis/util/sequence-fwd.hh> + namespace paludis { - namespace unpackaged_repositories - { - class NDBAM; - } + class NDBAM; + class NDBAMEntry; + typedef Sequence<tr1::shared_ptr<NDBAMEntry> > NDBAMEntrySequence; } #endif diff --git a/paludis/repositories/unpackaged/ndbam.cc b/paludis/ndbam.cc index f71fb4d05..0187b0401 100644 --- a/paludis/repositories/unpackaged/ndbam.cc +++ b/paludis/ndbam.cc @@ -17,7 +17,6 @@ * Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <paludis/repositories/unpackaged/ndbam.hh> #include <paludis/util/sequence-impl.hh> #include <paludis/util/set.hh> #include <paludis/util/stringify.hh> @@ -29,6 +28,7 @@ #include <paludis/util/make_shared_ptr.hh> #include <paludis/util/tr1_functional.hh> #include <paludis/util/config_file.hh> +#include <paludis/ndbam.hh> #include <paludis/hashed_containers.hh> #include <paludis/package_id.hh> #include <paludis/metadata_key.hh> @@ -39,9 +39,8 @@ #include <fstream> using namespace paludis; -using namespace paludis::unpackaged_repositories; -#include <paludis/repositories/unpackaged/ndbam-sr.cc> +#include <paludis/ndbam-sr.cc> template class Sequence<NDBAMEntry>; diff --git a/paludis/ndbam.hh b/paludis/ndbam.hh new file mode 100644 index 000000000..4e3358aef --- /dev/null +++ b/paludis/ndbam.hh @@ -0,0 +1,80 @@ +/* vim: set sw=4 sts=4 et foldmethod=syntax : */ + +/* + * Copyright (c) 2007, 2008 Ciaran McCreesh + * + * This file is part of the Paludis package manager. Paludis is free software; + * you can redistribute it and/or modify it under the terms of the GNU General + * Public License version 2, as published by the Free Software Foundation. + * + * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_UNPACKAGED_NDBAM_HH +#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_UNPACKAGED_NDBAM_HH 1 + +#include <paludis/ndbam-fwd.hh> +#include <paludis/util/private_implementation_pattern.hh> +#include <paludis/util/attributes.hh> +#include <paludis/util/fs_entry.hh> +#include <paludis/util/sequence-fwd.hh> +#include <paludis/util/mutex.hh> +#include <paludis/util/tr1_functional.hh> +#include <paludis/name.hh> +#include <paludis/version_spec.hh> +#include <paludis/package_id-fwd.hh> +#include <paludis/contents-fwd.hh> + +namespace paludis +{ + +#include <paludis/ndbam-sr.hh> + + class PALUDIS_VISIBLE NDBAM : + private PrivateImplementationPattern<NDBAM> + { + public: + NDBAM(const FSEntry &, + const tr1::function<bool (const std::string &)> & check_format, + const std::string & preferred_format); + ~NDBAM(); + + tr1::shared_ptr<const CategoryNamePartSet> category_names() + PALUDIS_ATTRIBUTE((warn_unused_result)); + + tr1::shared_ptr<const QualifiedPackageNameSet> package_names( + const CategoryNamePart & c) + PALUDIS_ATTRIBUTE((warn_unused_result)); + + tr1::shared_ptr<const CategoryNamePartSet> category_names_containing_package( + const PackageNamePart &) const + PALUDIS_ATTRIBUTE((warn_unused_result)); + + bool has_package_named(const QualifiedPackageName &) + PALUDIS_ATTRIBUTE((warn_unused_result)); + + bool has_category_named(const CategoryNamePart &) + PALUDIS_ATTRIBUTE((warn_unused_result)); + + tr1::shared_ptr<NDBAMEntrySequence> entries(const QualifiedPackageName &) + PALUDIS_ATTRIBUTE((warn_unused_result)); + + void parse_contents(const PackageID &, + const tr1::function<void (const FSEntry &, const std::string & md5, const time_t mtime)> & on_file, + const tr1::function<void (const FSEntry &)> & on_dir, + const tr1::function<void (const FSEntry &, const std::string & target, const time_t mtime)> & on_sym + ) const; + + void index(const QualifiedPackageName &, const std::string &) const; + void deindex(const QualifiedPackageName &) const; + }; +} + +#endif diff --git a/paludis/repositories/unpackaged/ndbam.sr b/paludis/ndbam.sr index 2e0ec03f5..2e0ec03f5 100755 --- a/paludis/repositories/unpackaged/ndbam.sr +++ b/paludis/ndbam.sr diff --git a/paludis/repositories/unpackaged/ndbam_merger.cc b/paludis/ndbam_merger.cc index e214847b2..ec3c402b1 100644 --- a/paludis/repositories/unpackaged/ndbam_merger.cc +++ b/paludis/ndbam_merger.cc @@ -17,7 +17,6 @@ * Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <paludis/repositories/unpackaged/ndbam_merger.hh> #include <paludis/util/private_implementation_pattern.hh> #include <paludis/util/log.hh> #include <paludis/util/sequence.hh> @@ -33,15 +32,15 @@ #include <paludis/util/md5.hh> #include <paludis/environment.hh> #include <paludis/package_database.hh> +#include <paludis/ndbam_merger.hh> #include <fstream> #include <iostream> #include <iomanip> #include <list> using namespace paludis; -using namespace paludis::unpackaged_repositories; -#include <paludis/repositories/unpackaged/ndbam_merger-sr.cc> +#include <paludis/ndbam_merger-sr.cc> namespace paludis { diff --git a/paludis/ndbam_merger.hh b/paludis/ndbam_merger.hh new file mode 100644 index 000000000..66a552e9c --- /dev/null +++ b/paludis/ndbam_merger.hh @@ -0,0 +1,60 @@ +/* vim: set sw=4 sts=4 et foldmethod=syntax : */ + +/* + * Copyright (c) 2007, 2008 Ciaran McCreesh + * + * This file is part of the Paludis package manager. Paludis is free software; + * you can redistribute it and/or modify it under the terms of the GNU General + * Public License version 2, as published by the Free Software Foundation. + * + * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_UNPACKAGED_NDBAM_MERGER_HH +#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_UNPACKAGED_NDBAM_MERGER_HH 1 + +#include <paludis/merger.hh> +#include <paludis/package_id-fwd.hh> + +namespace paludis +{ +#include <paludis/ndbam_merger-sr.hh> + + class PALUDIS_VISIBLE NDBAMMerger : + public Merger, + private PrivateImplementationPattern<NDBAMMerger> + { + private: + void display_override(const std::string &) const; + std::string make_arrows(const MergeStatusFlags &) const; + + public: + NDBAMMerger(const NDBAMMergerOptions &); + ~NDBAMMerger(); + + virtual Hook extend_hook(const Hook &); + + virtual void record_install_file(const FSEntry &, const FSEntry &, const std::string &, const MergeStatusFlags &); + virtual void record_install_dir(const FSEntry &, const FSEntry &, const MergeStatusFlags &); + virtual void record_install_sym(const FSEntry &, const FSEntry &, const MergeStatusFlags &); + + virtual void on_error(bool is_check, const std::string &); + virtual void on_warn(bool is_check, const std::string &); + virtual void on_enter_dir(bool is_check, const FSEntry); + + virtual bool config_protected(const FSEntry &, const FSEntry &); + virtual std::string make_config_protect_name(const FSEntry &, const FSEntry &); + + virtual void merge(); + virtual bool check(); + }; +} + +#endif diff --git a/paludis/repositories/unpackaged/ndbam_merger.sr b/paludis/ndbam_merger.sr index 529fa21e8..529fa21e8 100644 --- a/paludis/repositories/unpackaged/ndbam_merger.sr +++ b/paludis/ndbam_merger.sr diff --git a/paludis/repositories/unpackaged/ndbam_unmerger.cc b/paludis/ndbam_unmerger.cc index 5f495160f..76b8efdd2 100644 --- a/paludis/repositories/unpackaged/ndbam_unmerger.cc +++ b/paludis/ndbam_unmerger.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2007 Ciaran McCreesh + * Copyright (c) 2007, 2008 Ciaran McCreesh * Copyright (c) 2007 Piotr Jaroszyński * * This file is part of the Paludis package manager. Paludis is free software; @@ -18,8 +18,8 @@ * Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <paludis/repositories/unpackaged/ndbam_unmerger.hh> -#include <paludis/repositories/unpackaged/ndbam.hh> +#include <paludis/ndbam_unmerger.hh> +#include <paludis/ndbam.hh> #include <paludis/util/destringify.hh> #include <paludis/util/md5.hh> @@ -45,9 +45,8 @@ #include <iostream> using namespace paludis; -using namespace paludis::unpackaged_repositories; -#include <paludis/repositories/unpackaged/ndbam_unmerger-sr.cc> +#include <paludis/ndbam_unmerger-sr.cc> namespace paludis { diff --git a/paludis/ndbam_unmerger.hh b/paludis/ndbam_unmerger.hh new file mode 100644 index 000000000..a8c5f440d --- /dev/null +++ b/paludis/ndbam_unmerger.hh @@ -0,0 +1,78 @@ +/* vim: set sw=4 sts=4 et foldmethod=syntax : */ + +/* + * Copyright (c) 2007, 2008 Ciaran McCreesh + * Copyright (c) 2007 Piotr Jaroszyński + * + * This file is part of the Paludis package manager. Paludis is free software; + * you can redistribute it and/or modify it under the terms of the GNU General + * Public License version 2, as published by the Free Software Foundation. + * + * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_UNPACKAGED_NDBAM_UNMERGER_HH +#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_UNPACKAGED_NDBAM_UNMERGER_HH 1 + +#include <paludis/util/private_implementation_pattern.hh> +#include <paludis/util/sr.hh> +#include <paludis/util/fs_entry.hh> +#include <paludis/unmerger.hh> +#include <paludis/environment-fwd.hh> +#include <paludis/package_id-fwd.hh> + +namespace paludis +{ + class NDBAM; + +#include <paludis/ndbam_unmerger-sr.hh> + + class PALUDIS_VISIBLE NDBAMUnmergerError : + public UnmergerError + { + public: + NDBAMUnmergerError(const std::string &) throw (); + }; + + class PALUDIS_VISIBLE NDBAMUnmerger : + public Unmerger, + private PrivateImplementationPattern<NDBAMUnmerger> + { + private: + Implementation<NDBAMUnmerger> * _imp; + class FileExtraInfo; + class SymlinkExtraInfo; + + void _add_file(const FSEntry & f, const std::string & md5, const time_t mtime); + void _add_dir(const FSEntry & f); + void _add_sym(const FSEntry & f, const std::string & target, const time_t mtime); + + protected: + bool config_protected(const FSEntry &) const; + std::string make_tidy(const FSEntry &) const; + + void populate_unmerge_set(); + + void display(const std::string &) const; + + bool check_file(const FSEntry &, tr1::shared_ptr<ExtraInfo>) const; + bool check_dir(const FSEntry &, tr1::shared_ptr<ExtraInfo>) const; + bool check_sym(const FSEntry &, tr1::shared_ptr<ExtraInfo>) const; + bool check_misc(const FSEntry &, tr1::shared_ptr<ExtraInfo>) const; + + public: + NDBAMUnmerger(const NDBAMUnmergerOptions &); + ~NDBAMUnmerger(); + + virtual Hook extend_hook(const Hook &) const; + }; +} + +#endif diff --git a/paludis/repositories/unpackaged/ndbam_unmerger.sr b/paludis/ndbam_unmerger.sr index 31b4f4b47..31b4f4b47 100644 --- a/paludis/repositories/unpackaged/ndbam_unmerger.sr +++ b/paludis/ndbam_unmerger.sr diff --git a/paludis/repositories/unpackaged/Makefile.am b/paludis/repositories/unpackaged/Makefile.am index 4ea784441..33bd1b908 100644 --- a/paludis/repositories/unpackaged/Makefile.am +++ b/paludis/repositories/unpackaged/Makefile.am @@ -1,9 +1,6 @@ SUBDIRS = . CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda DISTCLEANFILES = \ - ndbam-sr.hh ndbam-sr.cc \ - ndbam_merger-sr.hh ndbam_merger-sr.cc \ - ndbam_unmerger-sr.hh ndbam_unmerger-sr.cc \ unpackaged_repository-sr.hh unpackaged_repository-sr.cc \ installed_repository-sr.hh installed_repository-sr.cc @@ -26,13 +23,6 @@ paludis_repositories_unpackaged_include_HEADERS = \ dep_parser.hh \ dep_printer.hh \ exceptions.hh \ - ndbam.hh \ - ndbam-fwd.hh \ - ndbam-sr.hh \ - ndbam_merger.hh \ - ndbam_merger-sr.hh \ - ndbam_unmerger.hh \ - ndbam_unmerger-sr.hh \ unpackaged_id.hh \ unpackaged_repository.hh \ unpackaged_repository-sr.hh \ @@ -45,9 +35,6 @@ libpaludisunpackagedrepository_la_SOURCES = \ dep_parser.cc \ dep_printer.cc \ exceptions.cc \ - ndbam.cc \ - ndbam_merger.cc \ - ndbam_unmerger.cc \ unpackaged_id.cc \ unpackaged_repository.cc \ unpackaged_key.cc \ @@ -95,15 +82,6 @@ dep_parser_TEST_LDADD = \ $(DYNAMIC_LD_LIBS) EXTRA_DIST = \ - ndbam.sr \ - ndbam-sr.hh \ - ndbam-sr.cc \ - ndbam_merger.sr \ - ndbam_merger-sr.hh \ - ndbam_merger-sr.cc \ - ndbam_unmerger.sr \ - ndbam_unmerger-sr.hh \ - ndbam_unmerger-sr.cc \ unpackaged_repository_TEST.cc \ unpackaged_repository_TEST_setup.sh \ unpackaged_repository_TEST_cleanup.sh \ @@ -120,9 +98,6 @@ EXTRA_DIST = \ dep_parser_TEST.cc BUILT_SOURCES = \ - ndbam-sr.hh ndbam-sr.cc \ - ndbam_merger-sr.hh ndbam_merger-sr.cc \ - ndbam_unmerger-sr.hh ndbam_unmerger-sr.cc \ unpackaged_repository-sr.hh unpackaged_repository-sr.cc \ installed_repository-sr.hh installed_repository-sr.cc @@ -156,24 +131,6 @@ check_PROGRAMS = $(TESTS) built-sources : $(BUILT_SOURCES) for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done -ndbam-sr.hh : ndbam.sr $(top_srcdir)/misc/make_sr.bash - if ! $(top_srcdir)/misc/make_sr.bash --header $(srcdir)/ndbam.sr > $@ ; then rm -f $@ ; exit 1 ; fi - -ndbam-sr.cc : ndbam.sr $(top_srcdir)/misc/make_sr.bash - if ! $(top_srcdir)/misc/make_sr.bash --source $(srcdir)/ndbam.sr > $@ ; then rm -f $@ ; exit 1 ; fi - -ndbam_merger-sr.hh : ndbam_merger.sr $(top_srcdir)/misc/make_sr.bash - if ! $(top_srcdir)/misc/make_sr.bash --header $(srcdir)/ndbam_merger.sr > $@ ; then rm -f $@ ; exit 1 ; fi - -ndbam_merger-sr.cc : ndbam_merger.sr $(top_srcdir)/misc/make_sr.bash - if ! $(top_srcdir)/misc/make_sr.bash --source $(srcdir)/ndbam_merger.sr > $@ ; then rm -f $@ ; exit 1 ; fi - -ndbam_unmerger-sr.hh : ndbam_unmerger.sr $(top_srcdir)/misc/make_sr.bash - if ! $(top_srcdir)/misc/make_sr.bash --header $(srcdir)/ndbam_unmerger.sr > $@ ; then rm -f $@ ; exit 1 ; fi - -ndbam_unmerger-sr.cc : ndbam_unmerger.sr $(top_srcdir)/misc/make_sr.bash - if ! $(top_srcdir)/misc/make_sr.bash --source $(srcdir)/ndbam_unmerger.sr > $@ ; then rm -f $@ ; exit 1 ; fi - unpackaged_repository-sr.hh : unpackaged_repository.sr $(top_srcdir)/misc/make_sr.bash if ! $(top_srcdir)/misc/make_sr.bash --header $(srcdir)/unpackaged_repository.sr > $@ ; then rm -f $@ ; exit 1 ; fi diff --git a/paludis/repositories/unpackaged/installed_id.cc b/paludis/repositories/unpackaged/installed_id.cc index 3918497cd..ae707e009 100644 --- a/paludis/repositories/unpackaged/installed_id.cc +++ b/paludis/repositories/unpackaged/installed_id.cc @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2007 Ciaran McCreesh + * Copyright (c) 2007, 2008 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -19,8 +19,8 @@ #include <paludis/repositories/unpackaged/installed_id.hh> #include <paludis/repositories/unpackaged/installed_repository.hh> -#include <paludis/repositories/unpackaged/ndbam.hh> -#include <paludis/repositories/unpackaged/ndbam_unmerger.hh> +#include <paludis/ndbam.hh> +#include <paludis/ndbam_unmerger.hh> #include <paludis/repositories/unpackaged/dep_parser.hh> #include <paludis/repositories/unpackaged/dep_printer.hh> #include <paludis/util/private_implementation_pattern-impl.hh> diff --git a/paludis/repositories/unpackaged/installed_id.hh b/paludis/repositories/unpackaged/installed_id.hh index 6e0e3cba7..c1d8dc758 100644 --- a/paludis/repositories/unpackaged/installed_id.hh +++ b/paludis/repositories/unpackaged/installed_id.hh @@ -1,7 +1,7 @@ /* vim: set sw=4 sts=4 et foldmethod=syntax : */ /* - * Copyright (c) 2007 Ciaran McCreesh + * Copyright (c) 2007, 2008 Ciaran McCreesh * * This file is part of the Paludis package manager. Paludis is free software; * you can redistribute it and/or modify it under the terms of the GNU General @@ -26,7 +26,7 @@ #include <paludis/util/fs_entry-fwd.hh> #include <paludis/util/private_implementation_pattern.hh> #include <paludis/util/tr1_memory.hh> -#include <paludis/repositories/unpackaged/ndbam-fwd.hh> +#include <paludis/ndbam-fwd.hh> namespace paludis { diff --git a/paludis/repositories/unpackaged/installed_repository.cc b/paludis/repositories/unpackaged/installed_repository.cc index 851e8087a..c5512c93c 100644 --- a/paludis/repositories/unpackaged/installed_repository.cc +++ b/paludis/repositories/unpackaged/installed_repository.cc @@ -19,8 +19,8 @@ #include <paludis/repositories/unpackaged/installed_repository.hh> #include <paludis/repositories/unpackaged/installed_id.hh> -#include <paludis/repositories/unpackaged/ndbam.hh> -#include <paludis/repositories/unpackaged/ndbam_merger.hh> +#include <paludis/ndbam.hh> +#include <paludis/ndbam_merger.hh> #include <paludis/util/private_implementation_pattern-impl.hh> #include <paludis/util/sequence.hh> #include <paludis/util/make_shared_ptr.hh> diff --git a/paludis/repositories/unpackaged/ndbam.hh b/paludis/repositories/unpackaged/ndbam.hh deleted file mode 100644 index ad007ebb1..000000000 --- a/paludis/repositories/unpackaged/ndbam.hh +++ /dev/null @@ -1,84 +0,0 @@ -/* vim: set sw=4 sts=4 et foldmethod=syntax : */ - -/* - * Copyright (c) 2007 Ciaran McCreesh - * - * This file is part of the Paludis package manager. Paludis is free software; - * you can redistribute it and/or modify it under the terms of the GNU General - * Public License version 2, as published by the Free Software Foundation. - * - * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_UNPACKAGED_NDBAM_HH -#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_UNPACKAGED_NDBAM_HH 1 - -#include <paludis/util/private_implementation_pattern.hh> -#include <paludis/util/attributes.hh> -#include <paludis/util/fs_entry.hh> -#include <paludis/util/sequence-fwd.hh> -#include <paludis/util/mutex.hh> -#include <paludis/util/tr1_functional.hh> -#include <paludis/name.hh> -#include <paludis/version_spec.hh> -#include <paludis/package_id-fwd.hh> -#include <paludis/contents-fwd.hh> - -namespace paludis -{ - namespace unpackaged_repositories - { - -#include <paludis/repositories/unpackaged/ndbam-sr.hh> - - typedef Sequence<tr1::shared_ptr<NDBAMEntry> > NDBAMEntrySequence; - - class NDBAM : - private PrivateImplementationPattern<NDBAM> - { - public: - NDBAM(const FSEntry &, - const tr1::function<bool (const std::string &)> & check_format, - const std::string & preferred_format); - ~NDBAM(); - - tr1::shared_ptr<const CategoryNamePartSet> category_names() - PALUDIS_ATTRIBUTE((warn_unused_result)); - - tr1::shared_ptr<const QualifiedPackageNameSet> package_names( - const CategoryNamePart & c) - PALUDIS_ATTRIBUTE((warn_unused_result)); - - tr1::shared_ptr<const CategoryNamePartSet> category_names_containing_package( - const PackageNamePart &) const - PALUDIS_ATTRIBUTE((warn_unused_result)); - - bool has_package_named(const QualifiedPackageName &) - PALUDIS_ATTRIBUTE((warn_unused_result)); - - bool has_category_named(const CategoryNamePart &) - PALUDIS_ATTRIBUTE((warn_unused_result)); - - tr1::shared_ptr<NDBAMEntrySequence> entries(const QualifiedPackageName &) - PALUDIS_ATTRIBUTE((warn_unused_result)); - - void parse_contents(const PackageID &, - const tr1::function<void (const FSEntry &, const std::string & md5, const time_t mtime)> & on_file, - const tr1::function<void (const FSEntry &)> & on_dir, - const tr1::function<void (const FSEntry &, const std::string & target, const time_t mtime)> & on_sym - ) const; - - void index(const QualifiedPackageName &, const std::string &) const; - void deindex(const QualifiedPackageName &) const; - }; - } -} - -#endif diff --git a/paludis/repositories/unpackaged/ndbam_merger.hh b/paludis/repositories/unpackaged/ndbam_merger.hh deleted file mode 100644 index 8ef055168..000000000 --- a/paludis/repositories/unpackaged/ndbam_merger.hh +++ /dev/null @@ -1,63 +0,0 @@ -/* vim: set sw=4 sts=4 et foldmethod=syntax : */ - -/* - * Copyright (c) 2007, 2008 Ciaran McCreesh - * - * This file is part of the Paludis package manager. Paludis is free software; - * you can redistribute it and/or modify it under the terms of the GNU General - * Public License version 2, as published by the Free Software Foundation. - * - * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_UNPACKAGED_NDBAM_MERGER_HH -#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_UNPACKAGED_NDBAM_MERGER_HH 1 - -#include <paludis/merger.hh> -#include <paludis/package_id-fwd.hh> - -namespace paludis -{ - namespace unpackaged_repositories - { -#include <paludis/repositories/unpackaged/ndbam_merger-sr.hh> - - class NDBAMMerger : - public Merger, - private PrivateImplementationPattern<NDBAMMerger> - { - private: - void display_override(const std::string &) const; - std::string make_arrows(const MergeStatusFlags &) const; - - public: - NDBAMMerger(const NDBAMMergerOptions &); - ~NDBAMMerger(); - - virtual Hook extend_hook(const Hook &); - - virtual void record_install_file(const FSEntry &, const FSEntry &, const std::string &, const MergeStatusFlags &); - virtual void record_install_dir(const FSEntry &, const FSEntry &, const MergeStatusFlags &); - virtual void record_install_sym(const FSEntry &, const FSEntry &, const MergeStatusFlags &); - - virtual void on_error(bool is_check, const std::string &); - virtual void on_warn(bool is_check, const std::string &); - virtual void on_enter_dir(bool is_check, const FSEntry); - - virtual bool config_protected(const FSEntry &, const FSEntry &); - virtual std::string make_config_protect_name(const FSEntry &, const FSEntry &); - - virtual void merge(); - virtual bool check(); - }; - } -} - -#endif diff --git a/paludis/repositories/unpackaged/ndbam_unmerger.hh b/paludis/repositories/unpackaged/ndbam_unmerger.hh deleted file mode 100644 index cacb9c7d7..000000000 --- a/paludis/repositories/unpackaged/ndbam_unmerger.hh +++ /dev/null @@ -1,84 +0,0 @@ -/* vim: set sw=4 sts=4 et foldmethod=syntax : */ - -/* - * Copyright (c) 2007 Ciaran McCreesh - * Copyright (c) 2007 Piotr Jaroszyński - * - * This file is part of the Paludis package manager. Paludis is free software; - * you can redistribute it and/or modify it under the terms of the GNU General - * Public License version 2, as published by the Free Software Foundation. - * - * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_UNPACKAGED_NDBAM_UNMERGER_HH -#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_UNPACKAGED_NDBAM_UNMERGER_HH 1 - -#include <paludis/util/private_implementation_pattern.hh> -#include <paludis/util/sr.hh> -#include <paludis/util/fs_entry.hh> -#include <paludis/unmerger.hh> -#include <paludis/environment-fwd.hh> -#include <paludis/package_id-fwd.hh> - -namespace paludis -{ - - namespace unpackaged_repositories - { - class NDBAM; - -#include <paludis/repositories/unpackaged/ndbam_unmerger-sr.hh> - - class PALUDIS_VISIBLE NDBAMUnmergerError : - public UnmergerError - { - public: - NDBAMUnmergerError(const std::string &) throw (); - }; - - class PALUDIS_VISIBLE NDBAMUnmerger : - public Unmerger, - private PrivateImplementationPattern<NDBAMUnmerger> - { - private: - Implementation<NDBAMUnmerger> * _imp; - class FileExtraInfo; - class SymlinkExtraInfo; - - void _add_file(const FSEntry & f, const std::string & md5, const time_t mtime); - void _add_dir(const FSEntry & f); - void _add_sym(const FSEntry & f, const std::string & target, const time_t mtime); - - protected: - bool config_protected(const FSEntry &) const; - std::string make_tidy(const FSEntry &) const; - - void populate_unmerge_set(); - - void display(const std::string &) const; - - bool check_file(const FSEntry &, tr1::shared_ptr<ExtraInfo>) const; - bool check_dir(const FSEntry &, tr1::shared_ptr<ExtraInfo>) const; - bool check_sym(const FSEntry &, tr1::shared_ptr<ExtraInfo>) const; - bool check_misc(const FSEntry &, tr1::shared_ptr<ExtraInfo>) const; - - public: - NDBAMUnmerger(const NDBAMUnmergerOptions &); - ~NDBAMUnmerger(); - - virtual Hook extend_hook(const Hook &) const; - }; - } - -} - - -#endif |