aboutsummaryrefslogtreecommitdiff
path: root/0.4.0
diff options
context:
space:
mode:
Diffstat (limited to '0.4.0')
-rw-r--r--0.4.0/AUTHORS29
-rw-r--r--0.4.0/ChangeLog1657
-rw-r--r--0.4.0/Makefile.am24
-rw-r--r--0.4.0/NEWS147
-rw-r--r--0.4.0/README18
-rwxr-xr-x0.4.0/autogen.bash44
-rw-r--r--0.4.0/configure.ac463
-rw-r--r--0.4.0/doc/Makefile.am49
-rw-r--r--0.4.0/doc/doc_authors.doxygen9
-rw-r--r--0.4.0/doc/doc_bootstrap_howto.doxygen317
-rw-r--r--0.4.0/doc/doc_changelog.doxygen10
-rw-r--r--0.4.0/doc/doc_coding_standards.doxygen184
-rw-r--r--0.4.0/doc/doc_configuration_files.doxygen214
-rw-r--r--0.4.0/doc/doc_directories.doxygen18
-rw-r--r--0.4.0/doc/doc_licence.doxygen12
-rw-r--r--0.4.0/doc/doc_main.doxygen326
-rw-r--r--0.4.0/doc/doc_mainpage.doxygen58
-rw-r--r--0.4.0/doc/doc_namespaces.doxygen29
-rw-r--r--0.4.0/doc/doc_news.doxygen11
-rw-r--r--0.4.0/doc/doc_portage_differences.doxygen88
-rw-r--r--0.4.0/doc/doc_references.doxygen43
-rw-r--r--0.4.0/doc/doc_security_advisories.doxygen154
-rw-r--r--0.4.0/doc/doxygen.conf.in1223
-rw-r--r--0.4.0/doc/footer.html12
-rw-r--r--0.4.0/doc/header.html37
-rw-r--r--0.4.0/doc/paludis.css326
-rw-r--r--0.4.0/ebuild/Makefile.am49
-rw-r--r--0.4.0/ebuild/build_functions.bash99
-rw-r--r--0.4.0/ebuild/builtin_fetch.bash132
-rw-r--r--0.4.0/ebuild/builtin_init.bash73
-rw-r--r--0.4.0/ebuild/builtin_merge.bash118
-rw-r--r--0.4.0/ebuild/builtin_metadata.bash39
-rw-r--r--0.4.0/ebuild/builtin_strip.bash57
-rw-r--r--0.4.0/ebuild/builtin_tidyup.bash40
-rw-r--r--0.4.0/ebuild/builtin_unmerge.bash96
-rw-r--r--0.4.0/ebuild/builtin_variable.bash24
-rw-r--r--0.4.0/ebuild/digests/Makefile.am26
-rw-r--r--0.4.0/ebuild/digests/domd5.cc54
-rw-r--r--0.4.0/ebuild/digests/dormd160.cc53
-rw-r--r--0.4.0/ebuild/digests/dosha256.cc52
-rwxr-xr-x0.4.0/ebuild/ebuild.bash272
-rw-r--r--0.4.0/ebuild/echo_functions.bash.in187
-rw-r--r--0.4.0/ebuild/echo_functions_TEST.bash45
-rw-r--r--0.4.0/ebuild/eclass_functions.bash84
-rw-r--r--0.4.0/ebuild/fetchers/Makefile.am27
-rwxr-xr-x0.4.0/ebuild/fetchers/dofile6
-rwxr-xr-x0.4.0/ebuild/fetchers/dowget.in10
-rw-r--r--0.4.0/ebuild/install_functions.bash110
-rw-r--r--0.4.0/ebuild/kernel_functions.bash60
-rw-r--r--0.4.0/ebuild/kernel_functions_TEST.bash42
-rw-r--r--0.4.0/ebuild/list_functions.bash71
-rw-r--r--0.4.0/ebuild/list_functions_TEST.bash74
-rw-r--r--0.4.0/ebuild/multilib_functions.bash67
-rw-r--r--0.4.0/ebuild/pkg_config.bash28
-rw-r--r--0.4.0/ebuild/pkg_nofetch.bash62
-rw-r--r--0.4.0/ebuild/pkg_postinst.bash46
-rw-r--r--0.4.0/ebuild/pkg_postrm.bash47
-rw-r--r--0.4.0/ebuild/pkg_preinst.bash46
-rw-r--r--0.4.0/ebuild/pkg_prerm.bash46
-rw-r--r--0.4.0/ebuild/pkg_setup.bash46
-rw-r--r--0.4.0/ebuild/portage_stubs.bash78
-rw-r--r--0.4.0/ebuild/run_test.bash47
-rw-r--r--0.4.0/ebuild/sandbox.bash43
-rw-r--r--0.4.0/ebuild/src_compile.bash47
-rw-r--r--0.4.0/ebuild/src_install.bash43
-rw-r--r--0.4.0/ebuild/src_test.bash59
-rw-r--r--0.4.0/ebuild/src_unpack.bash43
-rw-r--r--0.4.0/ebuild/usage_error.bash32
-rw-r--r--0.4.0/ebuild/utils/Makefile.am124
-rwxr-xr-x0.4.0/ebuild/utils/canonicalise6
-rwxr-xr-x0.4.0/ebuild/utils/dobin48
-rw-r--r--0.4.0/ebuild/utils/dobin_TEST.bash70
-rw-r--r--0.4.0/ebuild/utils/doconfd32
-rw-r--r--0.4.0/ebuild/utils/dodir34
-rw-r--r--0.4.0/ebuild/utils/dodoc55
-rw-r--r--0.4.0/ebuild/utils/doenvd32
-rw-r--r--0.4.0/ebuild/utils/doexe58
-rw-r--r--0.4.0/ebuild/utils/dohard34
-rw-r--r--0.4.0/ebuild/utils/dohtml115
-rw-r--r--0.4.0/ebuild/utils/doinfo55
-rw-r--r--0.4.0/ebuild/utils/doinitd32
-rw-r--r--0.4.0/ebuild/utils/doins89
-rw-r--r--0.4.0/ebuild/utils/dolib62
-rw-r--r--0.4.0/ebuild/utils/dolib.a.in27
-rw-r--r--0.4.0/ebuild/utils/dolib.so.in26
-rw-r--r--0.4.0/ebuild/utils/doman84
-rw-r--r--0.4.0/ebuild/utils/domo54
-rw-r--r--0.4.0/ebuild/utils/donewins40
-rw-r--r--0.4.0/ebuild/utils/dosbin45
-rw-r--r--0.4.0/ebuild/utils/dosed52
-rw-r--r--0.4.0/ebuild/utils/dosym42
-rwxr-xr-x0.4.0/ebuild/utils/dounpack97
-rwxr-xr-x0.4.0/ebuild/utils/emake22
-rw-r--r--0.4.0/ebuild/utils/fowners24
-rw-r--r--0.4.0/ebuild/utils/fperms24
-rwxr-xr-x0.4.0/ebuild/utils/getmtime5
-rw-r--r--0.4.0/ebuild/utils/merge.cc481
-rw-r--r--0.4.0/ebuild/utils/merge_TEST.bash130
-rwxr-xr-x0.4.0/ebuild/utils/merge_TEST_cleanup.sh10
-rwxr-xr-x0.4.0/ebuild/utils/merge_TEST_setup.sh44
-rw-r--r--0.4.0/ebuild/utils/merge_common.cc83
-rw-r--r--0.4.0/ebuild/utils/merge_common.hh50
-rw-r--r--0.4.0/ebuild/utils/newbin38
-rw-r--r--0.4.0/ebuild/utils/newconfd38
-rw-r--r--0.4.0/ebuild/utils/newdoc38
-rw-r--r--0.4.0/ebuild/utils/newenvd38
-rw-r--r--0.4.0/ebuild/utils/newexe38
-rw-r--r--0.4.0/ebuild/utils/newinitd38
-rw-r--r--0.4.0/ebuild/utils/newins38
-rw-r--r--0.4.0/ebuild/utils/newlib.a.in38
-rw-r--r--0.4.0/ebuild/utils/newlib.so.in38
-rw-r--r--0.4.0/ebuild/utils/newman38
-rw-r--r--0.4.0/ebuild/utils/newsbin38
-rw-r--r--0.4.0/ebuild/utils/prep.in21
-rw-r--r--0.4.0/ebuild/utils/run_test.bash62
-rwxr-xr-x0.4.0/ebuild/utils/sed.in2
-rw-r--r--0.4.0/ebuild/utils/unmerge.cc235
-rw-r--r--0.4.0/ebuild/utils/unmerge_TEST.bash66
-rwxr-xr-x0.4.0/ebuild/utils/unmerge_TEST_cleanup.sh11
-rwxr-xr-x0.4.0/ebuild/utils/unmerge_TEST_setup.sh8
-rw-r--r--0.4.0/eselect/Makefile.am22
-rw-r--r--0.4.0/eselect/news.eselect225
-rw-r--r--0.4.0/hooks/Makefile.am.m4176
-rwxr-xr-x0.4.0/hooks/eselect_env_update.bash27
-rwxr-xr-x0.4.0/hooks/find_config_updates.bash43
-rwxr-xr-x0.4.0/hooks/gnu_info_index.bash83
-rwxr-xr-x0.4.0/hooks/log.bash86
-rwxr-xr-x0.4.0/hooks/news.bash51
-rw-r--r--0.4.0/misc/Makefile.am4
-rwxr-xr-x0.4.0/misc/do_m4.bash23
-rw-r--r--0.4.0/misc/generated-file.txt9
-rw-r--r--0.4.0/misc/svn-version-filter-data.bash.in1
-rwxr-xr-x0.4.0/misc/svn-version-filter.bash30
-rw-r--r--0.4.0/paludis/Makefile.am.m469
-rw-r--r--0.4.0/paludis/about.hh.in117
-rw-r--r--0.4.0/paludis/about_TEST.cc86
-rw-r--r--0.4.0/paludis/args/Makefile.am46
-rw-r--r--0.4.0/paludis/args/args.cc27
-rw-r--r--0.4.0/paludis/args/args.hh35
-rw-r--r--0.4.0/paludis/args/args_TEST.cc161
-rw-r--r--0.4.0/paludis/args/args_dumper.cc81
-rw-r--r--0.4.0/paludis/args/args_dumper.hh79
-rw-r--r--0.4.0/paludis/args/args_error.cc35
-rw-r--r--0.4.0/paludis/args/args_error.hh53
-rw-r--r--0.4.0/paludis/args/args_group.cc47
-rw-r--r--0.4.0/paludis/args/args_group.hh98
-rw-r--r--0.4.0/paludis/args/args_handler.cc129
-rw-r--r--0.4.0/paludis/args/args_handler.hh129
-rw-r--r--0.4.0/paludis/args/args_option.cc134
-rw-r--r--0.4.0/paludis/args/args_option.hh359
-rw-r--r--0.4.0/paludis/args/args_visitor.cc97
-rw-r--r--0.4.0/paludis/args/args_visitor.hh96
-rw-r--r--0.4.0/paludis/args/bad_argument.cc35
-rw-r--r--0.4.0/paludis/args/bad_argument.hh53
-rw-r--r--0.4.0/paludis/args/bad_value.cc32
-rw-r--r--0.4.0/paludis/args/bad_value.hh53
-rw-r--r--0.4.0/paludis/args/missing_value.cc36
-rw-r--r--0.4.0/paludis/args/missing_value.hh55
-rw-r--r--0.4.0/paludis/config_file.cc473
-rw-r--r--0.4.0/paludis/config_file.hh504
-rw-r--r--0.4.0/paludis/config_file_TEST.cc305
-rwxr-xr-x0.4.0/paludis/config_file_TEST_cleanup.sh10
-rwxr-xr-x0.4.0/paludis/config_file_TEST_setup.sh9
-rw-r--r--0.4.0/paludis/contents.cc58
-rw-r--r--0.4.0/paludis/contents.hh173
-rw-r--r--0.4.0/paludis/default_config.cc654
-rw-r--r--0.4.0/paludis/default_config.hh365
-rw-r--r--0.4.0/paludis/default_environment.cc514
-rw-r--r--0.4.0/paludis/default_environment.hh82
-rw-r--r--0.4.0/paludis/dep_atom.cc289
-rw-r--r--0.4.0/paludis/dep_atom.hh487
-rw-r--r--0.4.0/paludis/dep_atom_TEST.cc169
-rw-r--r--0.4.0/paludis/dep_atom_dumper.cc86
-rw-r--r--0.4.0/paludis/dep_atom_dumper.hh69
-rw-r--r--0.4.0/paludis/dep_atom_dumper_TEST.cc65
-rw-r--r--0.4.0/paludis/dep_atom_flattener.cc90
-rw-r--r--0.4.0/paludis/dep_atom_flattener.hh106
-rw-r--r--0.4.0/paludis/dep_atom_pretty_printer.cc91
-rw-r--r--0.4.0/paludis/dep_atom_pretty_printer.hh82
-rw-r--r--0.4.0/paludis/dep_list.cc852
-rw-r--r--0.4.0/paludis/dep_list.hh419
-rw-r--r--0.4.0/paludis/dep_list_TEST.cc1377
-rw-r--r--0.4.0/paludis/dep_tag.cc146
-rw-r--r--0.4.0/paludis/dep_tag.hh245
-rw-r--r--0.4.0/paludis/digests/Makefile.am41
-rw-r--r--0.4.0/paludis/digests/md5.cc239
-rw-r--r--0.4.0/paludis/digests/md5.hh50
-rw-r--r--0.4.0/paludis/digests/md5_TEST.cc94
-rw-r--r--0.4.0/paludis/digests/rmd160.cc231
-rw-r--r--0.4.0/paludis/digests/rmd160.hh54
-rw-r--r--0.4.0/paludis/digests/rmd160_TEST.cc96
-rw-r--r--0.4.0/paludis/digests/sha256.cc228
-rw-r--r--0.4.0/paludis/digests/sha256.hh50
-rw-r--r--0.4.0/paludis/digests/sha256_TEST.cc420
-rw-r--r--0.4.0/paludis/ebuild.cc374
-rw-r--r--0.4.0/paludis/ebuild.hh462
-rw-r--r--0.4.0/paludis/environment.cc432
-rw-r--r--0.4.0/paludis/environment.hh229
-rw-r--r--0.4.0/paludis/fake_repository.cc273
-rw-r--r--0.4.0/paludis/fake_repository.hh147
-rw-r--r--0.4.0/paludis/files.m443
-rw-r--r--0.4.0/paludis/hashed_containers.cc108
-rw-r--r--0.4.0/paludis/hashed_containers.hh.in293
-rw-r--r--0.4.0/paludis/hashed_containers_TEST.cc50
-rw-r--r--0.4.0/paludis/mask_reasons.cc72
-rw-r--r--0.4.0/paludis/mask_reasons.hh70
-rw-r--r--0.4.0/paludis/match_package.cc135
-rw-r--r--0.4.0/paludis/match_package.hh149
-rw-r--r--0.4.0/paludis/name.cc273
-rw-r--r--0.4.0/paludis/name.hh438
-rw-r--r--0.4.0/paludis/name_TEST.cc209
-rw-r--r--0.4.0/paludis/nothing_repository.cc257
-rw-r--r--0.4.0/paludis/nothing_repository.hh167
-rw-r--r--0.4.0/paludis/package_database.cc245
-rw-r--r--0.4.0/paludis/package_database.hh341
-rw-r--r--0.4.0/paludis/package_database_TEST.cc197
-rw-r--r--0.4.0/paludis/package_database_entry.hh69
-rw-r--r--0.4.0/paludis/paludis.cc21
-rw-r--r--0.4.0/paludis/paludis.hh.m441
-rw-r--r--0.4.0/paludis/portage_dep_lexer.cc79
-rw-r--r--0.4.0/paludis/portage_dep_lexer.hh130
-rw-r--r--0.4.0/paludis/portage_dep_lexer_TEST.cc250
-rw-r--r--0.4.0/paludis/portage_dep_parser.cc286
-rw-r--r--0.4.0/paludis/portage_dep_parser.hh197
-rw-r--r--0.4.0/paludis/portage_dep_parser_TEST.cc257
-rw-r--r--0.4.0/paludis/portage_repository.cc2301
-rw-r--r--0.4.0/paludis/portage_repository.hh305
-rw-r--r--0.4.0/paludis/portage_repository_TEST.cc615
-rwxr-xr-x0.4.0/paludis/portage_repository_TEST_cleanup.sh10
-rwxr-xr-x0.4.0/paludis/portage_repository_TEST_setup.sh203
-rw-r--r--0.4.0/paludis/qa/Makefile.am.m464
-rw-r--r--0.4.0/paludis/qa/changelog_check.cc75
-rw-r--r--0.4.0/paludis/qa/changelog_check.hh51
-rw-r--r--0.4.0/paludis/qa/check.cc32
-rw-r--r--0.4.0/paludis/qa/check.hh60
-rw-r--r--0.4.0/paludis/qa/check_result.cc44
-rw-r--r--0.4.0/paludis/qa/check_result.hh93
-rw-r--r--0.4.0/paludis/qa/check_result_TEST.cc52
-rw-r--r--0.4.0/paludis/qa/create_metadata_check.cc64
-rw-r--r--0.4.0/paludis/qa/create_metadata_check.hh56
-rw-r--r--0.4.0/paludis/qa/defaults_check.cc165
-rw-r--r--0.4.0/paludis/qa/defaults_check.hh55
-rw-r--r--0.4.0/paludis/qa/dep_any_check.cc141
-rw-r--r--0.4.0/paludis/qa/dep_any_check.hh51
-rw-r--r--0.4.0/paludis/qa/dep_flags_check.cc161
-rw-r--r--0.4.0/paludis/qa/dep_flags_check.hh51
-rw-r--r--0.4.0/paludis/qa/dep_packages_check.cc146
-rw-r--r--0.4.0/paludis/qa/dep_packages_check.hh51
-rw-r--r--0.4.0/paludis/qa/deps_exist_check.cc137
-rw-r--r--0.4.0/paludis/qa/deps_exist_check.hh51
-rw-r--r--0.4.0/paludis/qa/deps_visible_check.cc140
-rw-r--r--0.4.0/paludis/qa/deps_visible_check.hh51
-rw-r--r--0.4.0/paludis/qa/description_check.cc79
-rw-r--r--0.4.0/paludis/qa/description_check.hh51
-rw-r--r--0.4.0/paludis/qa/digest_collisions_check.cc105
-rw-r--r--0.4.0/paludis/qa/digest_collisions_check.hh51
-rw-r--r--0.4.0/paludis/qa/ebuild_check.cc33
-rw-r--r--0.4.0/paludis/qa/ebuild_check.hh91
-rw-r--r--0.4.0/paludis/qa/ebuild_count.cc58
-rw-r--r--0.4.0/paludis/qa/ebuild_count.hh51
-rw-r--r--0.4.0/paludis/qa/environment.cc75
-rw-r--r--0.4.0/paludis/qa/environment.hh104
-rw-r--r--0.4.0/paludis/qa/extract_check.cc126
-rw-r--r--0.4.0/paludis/qa/extract_check.hh51
-rw-r--r--0.4.0/paludis/qa/file_check.cc33
-rw-r--r--0.4.0/paludis/qa/file_check.hh86
-rw-r--r--0.4.0/paludis/qa/file_name_check.cc53
-rw-r--r--0.4.0/paludis/qa/file_name_check.hh56
-rw-r--r--0.4.0/paludis/qa/file_permissions_check.cc60
-rw-r--r--0.4.0/paludis/qa/file_permissions_check.hh51
-rw-r--r--0.4.0/paludis/qa/file_permissions_check_TEST.cc90
-rwxr-xr-x0.4.0/paludis/qa/file_permissions_check_TEST_cleanup.sh11
-rwxr-xr-x0.4.0/paludis/qa/file_permissions_check_TEST_setup.sh14
-rw-r--r--0.4.0/paludis/qa/files.m450
-rw-r--r--0.4.0/paludis/qa/files_dir_size_check.cc87
-rw-r--r--0.4.0/paludis/qa/files_dir_size_check.hh51
-rw-r--r--0.4.0/paludis/qa/glep_31_check.cc126
-rw-r--r--0.4.0/paludis/qa/glep_31_check.hh55
-rw-r--r--0.4.0/paludis/qa/glep_31_check_TEST.cc77
-rw-r--r--0.4.0/paludis/qa/has_ebuilds_check.cc50
-rw-r--r--0.4.0/paludis/qa/has_ebuilds_check.hh51
-rw-r--r--0.4.0/paludis/qa/has_ebuilds_check_TEST.cc66
-rwxr-xr-x0.4.0/paludis/qa/has_ebuilds_check_TEST_cleanup.sh11
-rwxr-xr-x0.4.0/paludis/qa/has_ebuilds_check_TEST_setup.sh12
-rw-r--r--0.4.0/paludis/qa/has_misc_files_check.cc54
-rw-r--r--0.4.0/paludis/qa/has_misc_files_check.hh51
-rw-r--r--0.4.0/paludis/qa/has_misc_files_check_TEST.cc102
-rwxr-xr-x0.4.0/paludis/qa/has_misc_files_check_TEST_cleanup.sh12
-rwxr-xr-x0.4.0/paludis/qa/has_misc_files_check_TEST_setup.sh23
-rw-r--r--0.4.0/paludis/qa/homepage_check.cc71
-rw-r--r--0.4.0/paludis/qa/homepage_check.hh51
-rw-r--r--0.4.0/paludis/qa/inherits_check.cc89
-rw-r--r--0.4.0/paludis/qa/inherits_check.hh51
-rw-r--r--0.4.0/paludis/qa/iuse_check.cc92
-rw-r--r--0.4.0/paludis/qa/iuse_check.hh56
-rw-r--r--0.4.0/paludis/qa/keywords_check.cc81
-rw-r--r--0.4.0/paludis/qa/keywords_check.hh51
-rw-r--r--0.4.0/paludis/qa/license_check.cc138
-rw-r--r--0.4.0/paludis/qa/license_check.hh51
-rw-r--r--0.4.0/paludis/qa/message.cc24
-rw-r--r--0.4.0/paludis/qa/message.hh65
-rw-r--r--0.4.0/paludis/qa/message_TEST.cc42
-rw-r--r--0.4.0/paludis/qa/metadata_check.cc91
-rw-r--r--0.4.0/paludis/qa/metadata_check.hh51
-rw-r--r--0.4.0/paludis/qa/package_dir_check.cc33
-rw-r--r--0.4.0/paludis/qa/package_dir_check.hh80
-rw-r--r--0.4.0/paludis/qa/package_name_check.cc62
-rw-r--r--0.4.0/paludis/qa/package_name_check.hh56
-rw-r--r--0.4.0/paludis/qa/package_name_check_TEST.cc104
-rwxr-xr-x0.4.0/paludis/qa/package_name_check_TEST_cleanup.sh11
-rwxr-xr-x0.4.0/paludis/qa/package_name_check_TEST_setup.sh14
-rw-r--r--0.4.0/paludis/qa/parse_deps_check.cc95
-rw-r--r--0.4.0/paludis/qa/parse_deps_check.hh56
-rw-r--r--0.4.0/paludis/qa/pdepend_overlap_check.cc141
-rw-r--r--0.4.0/paludis/qa/pdepend_overlap_check.hh51
-rw-r--r--0.4.0/paludis/qa/qa.cc21
-rw-r--r--0.4.0/paludis/qa/qa.hh.m438
-rw-r--r--0.4.0/paludis/qa/restrict_check.cc95
-rw-r--r--0.4.0/paludis/qa/restrict_check.hh51
-rw-r--r--0.4.0/paludis/qa/slot_check.cc71
-rw-r--r--0.4.0/paludis/qa/slot_check.hh51
-rw-r--r--0.4.0/paludis/qa/src_uri_check.cc185
-rw-r--r--0.4.0/paludis/qa/src_uri_check.hh51
-rw-r--r--0.4.0/paludis/qa/whitespace_check.cc123
-rw-r--r--0.4.0/paludis/qa/whitespace_check.hh51
-rw-r--r--0.4.0/paludis/repository.cc113
-rw-r--r--0.4.0/paludis/repository.hh928
-rw-r--r--0.4.0/paludis/selinux/Makefile.am23
-rw-r--r--0.4.0/paludis/selinux/security_context.cc241
-rw-r--r--0.4.0/paludis/selinux/security_context.hh153
-rw-r--r--0.4.0/paludis/syncer.cc244
-rw-r--r--0.4.0/paludis/syncer.hh162
-rw-r--r--0.4.0/paludis/test_environment.cc64
-rw-r--r--0.4.0/paludis/test_environment.hh99
-rw-r--r--0.4.0/paludis/test_extras.cc81
-rw-r--r--0.4.0/paludis/util/Makefile.am.m467
-rw-r--r--0.4.0/paludis/util/attributes.hh54
-rw-r--r--0.4.0/paludis/util/collection.hh294
-rw-r--r--0.4.0/paludis/util/compare.hh160
-rw-r--r--0.4.0/paludis/util/comparison_policy.hh.m4444
-rw-r--r--0.4.0/paludis/util/comparison_policy_TEST.cc44
-rw-r--r--0.4.0/paludis/util/composite_pattern.hh66
-rw-r--r--0.4.0/paludis/util/container_entry.hh77
-rw-r--r--0.4.0/paludis/util/container_entry_TEST.cc65
-rw-r--r--0.4.0/paludis/util/counted_ptr.cc28
-rw-r--r--0.4.0/paludis/util/counted_ptr.hh606
-rw-r--r--0.4.0/paludis/util/counted_ptr_TEST.cc390
-rw-r--r--0.4.0/paludis/util/deleter.cc32
-rw-r--r--0.4.0/paludis/util/deleter.hh57
-rw-r--r--0.4.0/paludis/util/deleter_TEST.cc85
-rw-r--r--0.4.0/paludis/util/destringify.cc34
-rw-r--r--0.4.0/paludis/util/destringify.hh149
-rw-r--r--0.4.0/paludis/util/destringify_TEST.cc113
-rw-r--r--0.4.0/paludis/util/dir_iterator.cc143
-rw-r--r--0.4.0/paludis/util/dir_iterator.hh127
-rw-r--r--0.4.0/paludis/util/dir_iterator_TEST.cc97
-rwxr-xr-x0.4.0/paludis/util/dir_iterator_TEST_cleanup.sh9
-rwxr-xr-x0.4.0/paludis/util/dir_iterator_TEST_setup.sh6
-rw-r--r--0.4.0/paludis/util/exception.cc64
-rw-r--r--0.4.0/paludis/util/exception.hh158
-rw-r--r--0.4.0/paludis/util/files.m441
-rw-r--r--0.4.0/paludis/util/fs_entry.cc439
-rw-r--r--0.4.0/paludis/util/fs_entry.hh319
-rw-r--r--0.4.0/paludis/util/fs_entry_TEST.cc242
-rwxr-xr-x0.4.0/paludis/util/fs_entry_TEST_cleanup.sh9
-rwxr-xr-x0.4.0/paludis/util/fs_entry_TEST_setup.sh17
-rw-r--r--0.4.0/paludis/util/instantiation_policy.hh207
-rw-r--r--0.4.0/paludis/util/instantiation_policy_TEST.cc136
-rw-r--r--0.4.0/paludis/util/is_file_with_extension.cc44
-rw-r--r--0.4.0/paludis/util/is_file_with_extension.hh75
-rw-r--r--0.4.0/paludis/util/is_file_with_extension_TEST.cc94
-rwxr-xr-x0.4.0/paludis/util/is_file_with_extension_TEST_cleanup.sh9
-rwxr-xr-x0.4.0/paludis/util/is_file_with_extension_TEST_setup.sh6
-rw-r--r--0.4.0/paludis/util/iterator.hh536
-rw-r--r--0.4.0/paludis/util/iterator_TEST.cc339
-rw-r--r--0.4.0/paludis/util/join.hh67
-rw-r--r--0.4.0/paludis/util/join_TEST.cc102
-rw-r--r--0.4.0/paludis/util/log.cc151
-rw-r--r--0.4.0/paludis/util/log.hh121
-rw-r--r--0.4.0/paludis/util/log_TEST.cc74
-rw-r--r--0.4.0/paludis/util/private_implementation_pattern.hh70
-rw-r--r--0.4.0/paludis/util/pstream.cc99
-rw-r--r--0.4.0/paludis/util/pstream.hh193
-rw-r--r--0.4.0/paludis/util/pstream_TEST.cc111
-rw-r--r--0.4.0/paludis/util/random.cc43
-rw-r--r--0.4.0/paludis/util/random.hh61
-rw-r--r--0.4.0/paludis/util/random_TEST.cc121
-rw-r--r--0.4.0/paludis/util/save.hh78
-rw-r--r--0.4.0/paludis/util/save_TEST.cc68
-rw-r--r--0.4.0/paludis/util/smart_record.hh.m4924
-rw-r--r--0.4.0/paludis/util/smart_record_TEST.cc200
-rw-r--r--0.4.0/paludis/util/stringify.hh168
-rw-r--r--0.4.0/paludis/util/stringify_TEST.cc129
-rw-r--r--0.4.0/paludis/util/strip.cc99
-rw-r--r--0.4.0/paludis/util/strip.hh127
-rw-r--r--0.4.0/paludis/util/strip_TEST.cc123
-rw-r--r--0.4.0/paludis/util/system.cc186
-rw-r--r--0.4.0/paludis/util/system.hh148
-rw-r--r--0.4.0/paludis/util/system_TEST.cc183
-rwxr-xr-x0.4.0/paludis/util/system_TEST_cleanup.sh9
-rwxr-xr-x0.4.0/paludis/util/system_TEST_setup.sh5
-rw-r--r--0.4.0/paludis/util/test_extras.cc65
-rw-r--r--0.4.0/paludis/util/tokeniser.cc28
-rw-r--r--0.4.0/paludis/util/tokeniser.hh243
-rw-r--r--0.4.0/paludis/util/tokeniser_TEST.cc139
-rw-r--r--0.4.0/paludis/util/util.hh.m442
-rw-r--r--0.4.0/paludis/util/validated.hh111
-rw-r--r--0.4.0/paludis/util/validated_TEST.cc126
-rw-r--r--0.4.0/paludis/util/virtual_constructor.hh243
-rw-r--r--0.4.0/paludis/util/virtual_constructor_TEST.cc190
-rw-r--r--0.4.0/paludis/util/visitor.hh297
-rw-r--r--0.4.0/paludis/util/visitor_TEST.cc168
-rw-r--r--0.4.0/paludis/vdb_repository.cc1056
-rw-r--r--0.4.0/paludis/vdb_repository.hh224
-rw-r--r--0.4.0/paludis/vdb_repository_TEST.cc112
-rwxr-xr-x0.4.0/paludis/vdb_repository_TEST_cleanup.sh11
-rwxr-xr-x0.4.0/paludis/vdb_repository_TEST_setup.sh17
-rw-r--r--0.4.0/paludis/version_metadata.cc125
-rw-r--r--0.4.0/paludis/version_metadata.hh286
-rw-r--r--0.4.0/paludis/version_operator.cc142
-rw-r--r--0.4.0/paludis/version_operator.hh148
-rw-r--r--0.4.0/paludis/version_operator_TEST.cc114
-rw-r--r--0.4.0/paludis/version_spec.cc422
-rw-r--r--0.4.0/paludis/version_spec.hh135
-rw-r--r--0.4.0/paludis/version_spec_TEST.cc313
-rw-r--r--0.4.0/src/Makefile.am47
-rw-r--r--0.4.0/src/applets.cc196
-rw-r--r--0.4.0/src/applets.hh51
-rw-r--r--0.4.0/src/colour.cc31
-rw-r--r--0.4.0/src/colour.hh93
-rw-r--r--0.4.0/src/command_line.cc102
-rw-r--r--0.4.0/src/command_line.hh252
-rw-r--r--0.4.0/src/contents.cc153
-rw-r--r--0.4.0/src/contents.hh30
-rwxr-xr-x0.4.0/src/exception_TEST6
-rwxr-xr-x0.4.0/src/help_TEST3
-rw-r--r--0.4.0/src/install.cc710
-rw-r--r--0.4.0/src/install.hh32
-rwxr-xr-x0.4.0/src/install_TEST5
-rwxr-xr-x0.4.0/src/install_TEST_cleanup.sh11
-rwxr-xr-x0.4.0/src/install_TEST_setup.sh121
-rw-r--r--0.4.0/src/licence.cc66
-rw-r--r--0.4.0/src/licence.hh67
-rw-r--r--0.4.0/src/list.cc324
-rw-r--r--0.4.0/src/list.hh39
-rwxr-xr-x0.4.0/src/list_dep_tag_categories_TEST3
-rwxr-xr-x0.4.0/src/list_repository_formats_TEST3
-rwxr-xr-x0.4.0/src/list_sync_formats_TEST3
-rw-r--r--0.4.0/src/news.cc51
-rw-r--r--0.4.0/src/news.hh34
-rw-r--r--0.4.0/src/owner.cc131
-rw-r--r--0.4.0/src/owner.hh30
-rw-r--r--0.4.0/src/paludis.cc435
-rw-r--r--0.4.0/src/qualudis/Makefile.am31
-rw-r--r--0.4.0/src/qualudis/qualudis.cc583
-rw-r--r--0.4.0/src/qualudis/qualudis_command_line.cc54
-rw-r--r--0.4.0/src/qualudis/qualudis_command_line.hh65
-rw-r--r--0.4.0/src/query.cc371
-rw-r--r--0.4.0/src/query.hh32
-rw-r--r--0.4.0/src/sync.cc123
-rw-r--r--0.4.0/src/sync.hh33
-rw-r--r--0.4.0/src/uninstall.cc155
-rw-r--r--0.4.0/src/uninstall.hh33
-rwxr-xr-x0.4.0/src/upgrade_TEST17
-rwxr-xr-x0.4.0/src/upgrade_TEST_cleanup.sh11
-rwxr-xr-x0.4.0/src/upgrade_TEST_setup.sh153
-rwxr-xr-x0.4.0/src/version_TEST3
-rw-r--r--0.4.0/test/Makefile.am25
-rwxr-xr-x0.4.0/test/run_test.sh33
-rw-r--r--0.4.0/test/test_fail_TEST.cc47
-rw-r--r--0.4.0/test/test_framework.cc263
-rw-r--r--0.4.0/test/test_framework.hh255
-rw-r--r--0.4.0/test/test_pass_TEST.cc51
-rw-r--r--0.4.0/test/test_runner.cc99
-rw-r--r--0.4.0/test/test_runner.hh38
475 files changed, 61417 insertions, 0 deletions
diff --git a/0.4.0/AUTHORS b/0.4.0/AUTHORS
new file mode 100644
index 000000000..94938b414
--- /dev/null
+++ b/0.4.0/AUTHORS
@@ -0,0 +1,29 @@
+Authors of Paludis
+==================
+
+Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ Main code
+
+Stephen P. Bennett <spb@gentoo.org>
+ Contributor
+
+Mark Loeser <halcy0n@gentoo.org>
+ Contributor
+
+John N. Laliberte <allanonjl@gentoo.org>
+ Contributor to Qualudis
+
+Stephen Klimaszewski <steev@gentoo.org>
+ Contributor
+
+Danny van Dyk <kugelfang@gentoo.org>
+ Contributor
+
+Fernando J. Pereda <ferdy@gentoo.org>
+ Contributor
+
+Robert S. Gerus <arachnist@gmail.com>
+ Contributor, FreeBSD portability
+
+David Morgan <david.morgan@wadham.oxford.ac.uk>
+ Contributor
diff --git a/0.4.0/ChangeLog b/0.4.0/ChangeLog
new file mode 100644
index 000000000..209ae29ca
--- /dev/null
+++ b/0.4.0/ChangeLog
@@ -0,0 +1,1657 @@
+ChangeLog for Paludis
+=====================
+
+This file lists every change made except typo and formatting fixes, which are
+only listed in SVN log. For a summary of what has changed between releases,
+see the NEWS file.
+
+2006-07-07 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * NEWS, configure.ac: Preparation for 0.4.0.
+
+2006-07-07 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * doc/doc_bootstrap_howto.doxygen,
+ doc/doc_configuration_files.doxygen, doc/doc_mainpage.doxygen,
+ doc/doxygen.conf.in: Doxygen updates in preparation for 0.4.
+
+2006-07-07 Stephen Bennett <spb@gentoo.org>
+
+ * ebuild/utils/prep.in, ebuild/utils/Makefile: Add dummy prep*
+ utilities that simply emit a QA notice warning against their use.
+
+2006-07-07 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/selinux/security_context.cc: Unbreak SELinux.
+
+2006-07-07 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * src/applets.cc, src/applets.hh, src/command_line.cc,
+ src/command_line.hh, src/paludis.cc: Add --configuration-variable
+ <repo> <var> commandline option.
+
+2006-07-07 Stephen Bennett <spb@gentoo.org>
+
+ * ebuild/utils/dosym: Add a QA notice when dosym is called without its
+ target directory existing. Also use dirname instead of bash
+ substitutions.
+
+2006-07-07 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/portage_stubs.bash: Add debug-print-section.
+
+2006-07-07 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/echo_functions.bash.in: Add elog. For now, it's just a forward
+ to einfo.
+
+2006-07-06 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/fake_repository.cc, paludis/fake_repository.hh,
+ paludis/portage_repository.cc, paludis/portage_repository.hh,
+ paludis/repository.cc, paludis/repository.hh, paludis/vdb_repository.cc,
+ paludis/vdb_repository.hh, src/install.cc: Make --pretend --install
+ output for USE_EXPAND things much cleaner.
+
+2006-07-06 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/dep_atom.cc, paludis/dep_atom.hh, paludis/dep_list.cc,
+ paludis/dep_list.hh, src/install.cc: Improve error message displayed
+ when [use] dependencies are not met.
+
+2006-07-06 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * hooks/eselect_env_update.bash, hooks/news.bash, src/uninstall.cc: Be
+ consistent with blank lines in output.
+
+2006-07-06 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/environment.cc, paludis/environment.hh, src/install.cc,
+ src/uninstall.cc: Packages are now added to world unless either a
+ restriction (slot, version) or --preserve-world is specified.
+
+2006-07-06 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/portage_repository.cc: g++ 4.1 is retarded.
+
+2006-07-06 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * src/command_line.cc, src/command_line.hh: Move --list-{categories,
+ packages,repositories} to being displayed as internal / script use.
+
+2006-07-06 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/fake_repository.cc, paludis/nothing_repository.cc,
+ paludis/portage_repository.cc, paludis/portage_repository.hh,
+ paludis/repository.cc, paludis/repository.hh, paludis/vdb_repository.cc:
+ Change how repository information is handled.
+
+ * src/command_line.cc, src/command_line.hh, src/list.cc, src/paludis.cc:
+ Add --info support. Update --list-repositories to the new repository
+ information interface.
+
+2006-07-06 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/ebuild.bash: Be a bit quieter.
+
+2006-07-06 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/digests/md5.hh, paludis/digests/rmd160.hh,
+ paludis/digests/sha256.hh: Remove always_inline, gcc is smart enough to
+ handle this correctly.
+
+2006-07-05 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/ebuild.bash: Add eselect style backtraces to die.
+
+2006-07-05 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/build_functions.bash, +ebuild/utils/dounpack,
+ -ebuild/utils/unpack: Change how unpack is handled.
+
+2006-07-05 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/ebuild.cc, paludis/ebuild.hh, paludis/portage_repository.cc,
+ src/install_TEST_setup.sh: Add ${AA} support. Strip trailing spaces
+ from ${A} and ${AA}, kde-meta.eclass relies upon this.
+
+2006-07-05 Stephen Bennett <spb@gentoo.org>
+
+ * ebuild/utils/dosym, ebuild/utils/donewins: Export PATH in dosym to
+ work around sandbox weirdness, and add a deprecation notice to
+ donewins since noone knows why it exists anyway.
+
+2006-07-05 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/utils/merge.cc, ebuild/utils/unmerge.cc,
+ paludis/default_config.cc, paludis/default_environment.cc,
+ paludis/dep_atom.cc, paludis/dep_list.cc, paludis/ebuild.cc,
+ paludis/environment.cc, paludis/nothing_repository.cc,
+ paludis/portage_repository.cc, paludis/util/log.cc,
+ paludis/util/log.hh, paludis/util/log_TEST.cc,
+ paludis/util/pstream.cc, paludis/util/system.cc,
+ paludis/vdb_repository.cc, src/install.cc, src/list.cc: Don't display
+ context with all log messages, only the ones where it's useful.
+
+2006-07-05 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/Makefile.am, ebuild/ebuild.bash, ebuild/utils/Makefile.am,
+ ebuild/utils/unpack, -ebuild/unpack_functions.bash: Move unpack into
+ an external script so that it can be used by non-ebuilds.
+
+2006-07-04 Stephen Bennett <spb@gentoo.org>
+
+ * paludis/selinux/security_context.cc: When built with selinux support
+ and the library exists, check whether kernel support is enabled before
+ attempting any SELinux operations. This fixes merge in the case where
+ the userland part of SELinux is complete but the kernel support is
+ missing, potentially common in recovery scenarios.
+
+2006-07-04 Stephen Bennett <spb@gentoo.org>
+
+ * ebuild/utils/dosym: Create any necessary directories in dosym if
+ they don't exist. Portage changed behaviour here, so we sync to it for
+ now.
+
+2006-07-04 Stephen Bennett <spb@gentoo.org>
+
+ * configure.ac, paludis/Makefile.am.m4,
+ paludis/selinux/security_context.hh,
+ paludis/selinux/security_context.cc, paludis/selinux/Makefile.am,
+ ebuild/ebuild.bash, ebuild/utils/merge.cc, ebuild/utils/Makefile.am:
+ Initial SELinux support for merge. Does not handle all corner cases as
+ yet, but should work for SELinux-enabled and SELinux-not-present.
+
+2006-07-03 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/builtin_merge.bash, ebuild/builtin_unmerge.bash,
+ ebuild/ebuild.bash, ebuild/eclass_functions.bash, paludis/ebuild.cc,
+ paludis/ebuild.hh: Switch to VDB_FORMAT paludis-2. Save the repository
+ whence the package originated. Use Portage compatible environment
+ saving.
+
+ * paludis/vdb_repository.cc, paludis/vdb_repository.hh: Add buildroot
+ configuration option.
+
+ * src/upgrade_TEST_setup.sh: Test environment behaviour.
+
+2006-07-03 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/ebuild.cc: Fix behaviour of PVR.
+
+2006-07-03 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/Makefile.am, ebuild/ebuild.bash, paludis/ebuild.cc,
+ paludis/ebuild.hh, paludis/fake_repository.cc,
+ paludis/nothing_repository.cc, paludis/portage_repository.cc,
+ paludis/portage_repository.hh, paludis/repository.cc,
+ paludis/repository.hh, paludis/vdb_repository.cc,
+ paludis/vdb_repository.hh, src/applets.cc, src/applets.hh,
+ src/command_line.cc, src/command_line.hh, src/paludis.cc,
+ +ebuild/builtin_variable.bash: Add support for --environment-variable
+ on the commandline.
+
+2006-07-03 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/util/log.cc: Display context with log messages.
+
+2006-07-03 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/dep_atom.cc: Downgrade use of * with operators other than
+ equals from an error to a QA warning.
+
+2006-07-01 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/builtin_merge.bash, ebuild/builtin_unmerge.bash: Add code to
+ recover from sh breaking due to library downgrades.
+
+2006-06-30 Stephen Bennett <spb@gentoo.org>
+
+ * ebuild/utils/merge.cc: Better handle symlinks when merging.
+
+2006-06-30 Stephen Bennett <spb@gentoo.org>
+
+ * paludis/syncer.cc: Add svn+http syncer.
+
+2006-06-29 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/eclass_functions.bash: Fix eclassdirs.
+
+2006-06-29 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * src/sync.cc: Add xterm titles for syncing.
+
+2006-06-29 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/utils/Makefile.am, ebuild/utils/merge.cc,
+ ebuild/utils/unmerge.cc: Use internal md5 routines rather than calling
+ md5sum when merging and unmerging.
+
+2006-06-29 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * configure.ac, ebuild/Makefile.am, ebuild/digests/Makefile.am,
+ ebuild/digests/domd5.cc, ebuild/digests/dormd160.cc,
+ ebuild/digests/dosha256.cc, paludis/Makefile.am.m4, paludis/digests,
+ paludis/digests/Makefile.am, +paludis/digests/md5.cc,
+ +paludis/digests/md5.hh, +paludis/digests/md5_TEST.cc,
+ +paludis/digests/rmd160.cc, +paludis/digests/rmd160.hh,
+ +paludis/digests/rmd160_TEST.cc, +paludis/digests/sha256.cc,
+ +paludis/digests/sha256.hh, +paludis/digests/sha256_TEST.cc,
+ -ebuild/digests/dormd160_TEST.cc, -ebuild/digests/dosha256_TEST.cc,
+ -ebuild/digests/md5.cc, -ebuild/digests/md5.hh,
+ -ebuild/digests/md5_TEST.cc, -ebuild/digests/rmd160.cc,
+ -ebuild/digests/rmd160.hh, -ebuild/digests/sha256.cc,
+ -ebuild/digests/sha256.hh: Split up digest tools and classes. Move
+ digest classes into paludis/digests/ so that they can be used
+ internally.
+
+2006-06-29 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/digests/Makefile.am, ebuild/digests/domd5,
+ ebuild/digests/domd5.cc, ebuild/digests/md5.cc, ebuild/digests/md5.hh,
+ ebuild/digests/md5_TEST.cc: Implement MD5 internally, to avoid linkage
+ problems with external md5sum on upgrade.
+
+2006-06-29 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/builtin_merge.bash, ebuild/builtin_unmerge.bash,
+ ebuild/ebuild.bash, src/Makefile.am: Nasty hack to make distcheck work
+ when autotools starts sticking things in different directories.
+
+2006-06-29 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/dep_list.cc, paludis/dep_list.hh, src/command_line.cc,
+ src/command_line.hh, src/install.cc: Add --dl-no-unnecessary-upgrades
+ commandline option.
+
+2006-06-28 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/utils/merge.cc: Fix merge to /.
+
+2006-06-28 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/utils/Makefile.am, ebuild/utils/merge.cc,
+ ebuild/utils/merge_common.cc, ebuild/utils/merge_common.hh,
+ ebuild/utils/unmerge.cc: Move some common merge / unmerge code into
+ separate files.
+
+2006-06-28 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/builtin_unmerge.bash, ebuild/utils/unmerge.cc: Re-enable
+ config protect support.
+
+2006-06-28 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/utils/merge.cc, ebuild/builtin_merge.bash: Fix set*id handling.
+ Re-enable config protect support.
+
+2006-06-28 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/util/fs_entry.cc, paludis/util/fs_entry.hh: Add chmod member
+ function to FSEntry.
+
+2006-06-28 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/builtin_tidyup.bash: Be more verbose.
+
+2006-06-28 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/builtin_fetch.bash: Fix bogus error message text.
+
+2006-06-28 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/utils/Makefile.am, ebuild/utils/unmerge,
+ ebuild/utils/unmerge.cc, ebuild/utils/unmerge_TEST.bash: Replace the
+ icky bash unmerge with a slightly less icky C++ unmerge.
+
+2006-06-28 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/util/fs_entry.cc, paludis/util/fs_entry.hh: Add rmdir member
+ function to FSEntry.
+
+2006-06-28 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/utils/Makefile.am, ebuild/utils/merge, ebuild/utils/merge.cc,
+ ebuild/utils/merge_TEST.bash, ebuild/utils/unmerge_TEST.bash: Replace
+ the icky bash merge with a slightly less icky C++ merge.
+
+2006-06-27 David Morgan <david.morgan@wadham.oxford.ac.uk>
+
+ * paludis/trunk/qa/environment.cc, paludis/trunk/environment.hh: Misc
+ fixes for things broken by changes elsewhere (mostly QAEnvironment).
+
+ * paludis/trunk/qa/files.m4: Temporarily commented out tests that are
+ broken.
+
+2006-06-27 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/util/fs_entry.cc, paludis/util/fs_entry.hh: Add chown,
+ owner, group member functions to FSEntry.
+
+2006-06-27 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/util/fs_entry.cc, paludis/util/fs_entry.hh: Add readlink
+ member function to FSEntry.
+
+2006-06-27 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/util/fs_entry.cc, paludis/util/fs_entry.hh: Add
+ permissions member function to FSEntry. Add optional mode argument
+ to FSEntry mkdir member function. Add unlink member function to
+ FSEntry.
+
+2006-06-22 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * doc/Makefile.am, doc/header.html, doc/paludis.css,
+ paludis/args/args_option.cc, paludis/contents.hh,
+ paludis/default_config.cc, paludis/util/comparison_policy_TEST.cc,
+ paludis/util/counted_ptr_TEST.cc, paludis/util/destringify.hh,
+ paludis/util/smart_record.hh.m4, paludis/util/smart_record_TEST.cc,
+ paludis/util/stringify.hh, src/licence.hh: Documentation improvements.
+
+ * doc/doc_configuration_files.doxygen: Add documentation about our
+ config file formats.
+
+2006-06-18 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/builtin_fetch.bash: Give a better error if DISTDIR isn't a
+ directory.
+
+2006-06-18 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/dep_list.cc: Emit a warning when dropping circular
+ dependencies.
+
+2006-06-18 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/portage_repository.cc: If the user mirrors.conf file
+ contains an entry with a mirror named '*', first try fetching from
+ there.
+
+2006-06-18 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/fetchers/dofile: Make file:/// fetching work.
+
+2006-06-18 Fernando J. Pereda <ferdy@gentoo.org>
+
+ * paludis/util/files.m4: Add `testscript' to system.
+
+2006-06-17 Fernando J. Pereda <ferdy@gentoo.org>
+
+ * paludis/util/system.hh, paludis/util/system.cc,
+ paludis/util/system_TEST_setup.sh, paludis/util/system_TEST_cleanup.sh,
+ paludis/util/system_TEST.cc, paludis/syncer.cc: Introduce
+ run_command_in_directory and use it in GitSyncer::sync().
+
+2006-06-17 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/name.cc, paludis/name.hh, paludis/test_environment.hh,
+ paludis/version_metadata.hh, paludis/version_operator.cc,
+ paludis/version_operator.hh, paludis/version_spec.hh: Tidy up some
+ includes.
+
+2006-06-17 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/src_test.bash: Check for makefile and GNUmakefile.
+
+2006-06-17 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * doc/doxygen.conf.in: Generate include graphs.
+
+2006-06-15 Danny van Dyk <kugelfang@gentoo.org>
+
+ * doc/doc_security_advisories.doxygen, doc/Makefile.am: Add
+ specification for security advisories.
+
+ * utils/glsa2txt.py: Add python script to create security advisories
+ from GLSAs.
+
+ * paludis/config_file.cc: Change AdvisoryFile to parse new advisory
+ format.
+
+2006-06-15 Stephen Bennett <spb@gentoo.org>
+
+ * paludis/repository.hh: Add virtual destructors to interface classes
+ to get rid of some irritating compiler warnings.
+
+2006-06-12 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/config_file.cc, paludis/config_file.hh,
+ paludis/default_config.cc, paludis/default_config.hh: Tidy up some
+ includes and remove some unnecessary inlines.
+
+2006-06-11 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * configure.ac, ebuild/Makefile.am, ebuild/builtin_fetch.bash,
+ ebuild/fetchers, ebuild/fetchers/Makefile.am, ebuild/fetchers/dofile,
+ ebuild/fetchers/dowget.in: Move fetching things out into wrapper scripts
+ rather than hardcoding wget. Add file:/// URL support.
+
+2006-06-11 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * doc/doc_main.doxygen, paludis/files.m4, paludis/nothing_repository.cc,
+ paludis/nothing_repository.hh: Add a NothingRepository that supports
+ sync= but does not contain any packages.
+
+2006-06-11 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/portage_repository.hh, paludis/portage_repository.cc: Remove
+ unnecessary do_contents implementation.
+
+2006-06-11 Danny van Dyk <kugelfang@gentoo.org>
+
+ * paludis/default_environment.cc, paludis/default_environment.hh,
+ paludis/environment.cc, paludis/environment.hh,
+ paludis/portage_repository.cc, paludis/portage_repository.hh,
+ paludis/repository.hh, paludis/vdb_repository.cc,
+ paludis/vdb_repository.hh, paludis/version_operator.hh: Add support
+ for PackageSetOptions.
+
+ * paludis/config_file.cc, paludis/config_file.hh,
+ paludis/portage_repository.cc, paludis/portage_repository.hh: Revise
+ security algorithm.
+
+ * src/command_line.cc, src/command_line.hh, src/list.cc, src/list.hh,
+ src/paludis.cc: Add support for --list-vulnerabilities commandline
+ option.
+
+2006-06-11 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/portage_repository.cc: Show the location of the repository
+ config file rather than the repository in eclassdir / profiledir
+ deprecated notices.
+
+2006-06-11 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/builtin_merge.bash, ebuild/ebuild.bash,
+ ebuild/eclass_functions.bash, paludis/ebuild.cc, paludis/ebuild.hh,
+ paludis/portage_repository.cc, paludis/portage_repository.hh,
+ paludis/util/fs_entry.cc, paludis/util/fs_entry.hh,
+ paludis/vdb_repository.cc, src/install_TEST_setup.sh: Add support for
+ multiple eclass directories and multiple profile directories in
+ Portage repositories. The 'eclassdir' and 'profiledir' keys are now
+ deprecated, in favour of 'eclassdirs' and 'profiledirs'.
+
+2006-06-11 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/util/collection.hh: Add push_back method for
+ SequentialCollection, so that a std::back_insert_iterator can be used.
+ Include a const_reference typedef in SequentialCollection, for various
+ standard algorithms.
+
+2006-06-08 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * src/Makefile.am, src/exception_TEST, src/help_TEST,
+ src/install_TEST, src/list_dep_tag_categories_TEST,
+ src/list_repository_formats_TEST, src/list_sync_formats_TEST,
+ src/upgrade_TEST, src/version_TEST: Move the test scripts out of the
+ Makefile.
+
+ * src/upgrade_TEST_cleanup.sh, src/upgrade_TEST_setup.sh: Add a test
+ for installing then upgrading a package.
+
+2006-06-08 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/default_environment.cc: Add a PALUDIS_NO_GLOBAL_HOOKS env
+ var, mostly for test cases.
+
+ * src/Makefile.am, src/install_TEST_cleanup.sh,
+ src/install_TEST_setup.sh: Do a full package install as part of the
+ test cases.
+
+2006-06-06 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * src/install.cc: Display better counts for --install.
+
+2006-06-06 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/args/bad_argument.hh, paludis/args/bad_value.hh,
+ paludis/args/missing_value.hh, paludis/default_environment.hh,
+ paludis/dep_list.hh, paludis/util/comparison_policy.hh.m4,
+ test/test_framework.hh: Fix up Doxygen grouping.
+
+2006-06-06 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/util/files.m4, paludis/util/match_sequence.cc,
+ paludis/util/match_sequence.hh, paludis/util/match_sequence_TEST.cc:
+ Kill match_sequence. It's only used for one QA check, which is
+ probably better done using something more powerful anyway.
+
+2006-06-06 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/ebuild.bash, ebuild/echo_functions.bash.in: Handle date in
+ log code, global scope.
+
+2006-06-06 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * configure.ac: Move us onto the 0.3 branch.
+
+2006-06-06 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/default_environment.cc, paludis/dep_list.cc,
+ paludis/environment.cc, paludis/fake_repository.cc,
+ paludis/fake_repository.hh, paludis/match_package.cc,
+ paludis/package_database.cc, paludis/package_database.hh,
+ paludis/portage_repository.cc, paludis/portage_repository.hh,
+ paludis/portage_repository_TEST.cc, paludis/repository.cc,
+ paludis/repository.hh, paludis/vdb_repository.cc,
+ paludis/vdb_repository.hh, src/contents.cc, src/install.cc,
+ src/news.cc, src/owner.cc, src/query.cc, src/sync.cc,
+ src/uninstall.cc: Switch to a new capabilities interface for
+ repositories.
+
+2006-06-06 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/util/smart_record.hh.m4: Export smart record key types, for
+ utility functions.
+
+2006-06-06 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/util/counted_ptr.hh: Allow upcasts on construction.
+
+2006-06-05 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/build_functions.bash, ebuild/utils/Makefile.am,
+ ebuild/utils/emake: Move emake to an external app, like it is in
+ Portage, so things like xargs emake work.
+
+2006-06-05 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/unpack_functions.bash: Unpack .tar.Z files correctly.
+
+2006-06-05 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/Makefile.am.m4, paludis/ebuild.cc, paludis/ebuild.hh,
+ paludis/portage_repository.cc, paludis/portage_repository.hh,
+ paludis/vdb_repository.cc, src/Makefile.am, src/paludis.cc: Stop
+ hardcoding BIGTEMPDIR. Make the build directory a repository
+ configuration parameter (buildroot) instead.
+
+2006-06-05 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/dep_list.cc, paludis/environment.cc,
+ paludis/fake_repository.cc, paludis/fake_repository.hh,
+ paludis/package_database.cc, paludis/package_database.hh,
+ paludis/package_database_TEST.cc, paludis/portage_repository.cc,
+ paludis/portage_repository.hh, paludis/repository.hh,
+ paludis/vdb_repository.cc, paludis/vdb_repository.hh,
+ paludis/vdb_repository_TEST.cc: Interface tidyup.
+
+2006-06-05 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/util/random_TEST.cc: Make chi squared test less prone to
+ occasional random failures.
+
+2006-06-04 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/version_operator.cc, paludis/version_operator.hh,
+ paludis/version_operator_TEST.cc: Typo tidle -> tilde.
+
+2006-06-04 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/default_environment.hh, paludis/dep_atom_flattener.hh,
+ paludis/dep_list.hh, paludis/test_environment.hh: Fix environment
+ includes.
+
+2006-05-29 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * NEWS, configure.ac: Tag for 0.2.5
+
+ + Release: 0.2.5
+
+2006-05-27 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/hashed_containers.hh.in: Fix harmless compiler warning,
+ since people keep asking about it.
+
+2006-05-27 Stephen Bennett <spb@gentoo.org>
+
+ * ebuild/echo_functions.bash, ebuild/echo_functions.bash.in,
+ configure.ac, hooks/news.bash, hooks/eselect_env_update.bash,
+ hooks/find_config_updates.bash: Make bash and hook output pink when
+ appropriate.
+
+2006-05-26 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * hooks/gnu_info_index.bash, paludis/default_environment.cc: Fix up
+ remaining path issues.
+
+2006-05-26 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/utils/Makefile.am, ebuild/utils/sed, ebuild/utils/sed.in:
+ Move sed -> sed.in, and only generate sed wrapper when it's needed, to
+ avoid path issues.
+
+2006-05-25 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * doc/Makefile.am, ebuild/Makefile.am, ebuild/builtin_init.bash,
+ ebuild/builtin_merge.bash, ebuild/builtin_unmerge.bash,
+ ebuild/ebuild.bash, ebuild/portage_stubs.bash,
+ ebuild/utils/Makefile.am, ebuild/utils/canonicalise,
+ ebuild/utils/merge, ebuild/utils/merge_TEST.bash,
+ ebuild/utils/unmerge, ebuild/utils/unmerge_TEST.bash: Make a
+ canonicalise wrapper, rather than using realpath or readlink -f.
+ Tinker with PATH ordering so that this actually works.
+
+2006-05-25 Robert Sebastian Gerus <arachnist@gmail.com>
+
+ * hooks/gnu_info_index.bash, ebuild/utils/merge, ebuild/utils/getmtime,
+ ebuild/utils/unmerge: Add a wrapper that will call stat -f '%m' on
+ FreeBSD and stat -c '%Y' everywhere else.
+
+2006-05-25 Robert Sebastian Gerus <arachnist@gmail.com>
+
+ * ebuild/ebuild.bash, ebuild/portage_stubs.bash, ebuild/utils/merge,
+ ebuild/utils/unmerge, ebuild/builtin_merge.bash, doc/Makefile.am,
+ ebuild/builtin_unmerge.bash: Replace readlink -f with realpath, for
+ portability.
+
+2006-05-24 Robert Sebastian Gerus <arachnist@gmail.com>
+
+ * configure.ac, ebuild/utils/Makefile.am, ebuild/utils/sed: Add sed
+ wrapper script which calls gsed, installed only if sed isn't gnu sed.
+
+2006-05-24 Robert Sebastian Gerus <arachnist@gmail.com>
+
+ * test/test_runner.cc: Skip glibc-specific backtrace call on non-glibc
+ systems.
+
+2006-05-24 Robert Sebastian Gerus <arachnist@gmail.com>
+
+ * paludis/util/system_TEST.cc: Added a check for FreeBSD.
+
+2006-05-24 Robert Sebastian Gerus <arachnist@gmail.com>
+
+ * /trunk/configure.ac: date --iso=seconds -> date +%Y-%m-%dT%H:%M:%S%z
+ for portability.
+
+2006-05-23 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/version_spec.cc, paludis/version_spec_TEST.cc: Add -try
+ support to version specs.
+
+ * doc/doc_portage_differences.cc: Bring up to date.
+
+2006-05-23 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/vdb_repository.cc, paludis/vdb_repository.hh: Improve error
+ condition handling.
+
+2006-05-22 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/util/system.cc: Improve error condition handling.
+
+2006-05-22 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/environment.cc: Improve error condition handling.
+
+ * paludis/portage_repository.cc: Use
+ PortageRepositoryConfigurationError rather than InternalError for
+ profiles where ARCH is unset. Clean up various small todo items.
+
+ * paludis/portage_repository.cc: Don't hardcode mirror://gentoo/ as
+ the master mirror name.
+
+2006-05-22 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/default_config.cc, paludis/default_config.hh,
+ paludis/default_environment.cc, paludis/default_environment.hh,
+ paludis/environment.hh, paludis/portage_repository.cc,
+ paludis/test_environment.hh: Support a mirrors.conf file, with the
+ same format as thirdpartymirrors, in the config directory.
+
+2006-05-22 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/ebuild.bash, paludis/portage_repository_TEST.cc: Use EAPI="0"
+ when EAPI is unset. Improve version metadata generation tests.
+
+2006-05-22 Fernando J. Pereda <ferdy@gentoo.org>
+
+ * paludis/syncer.hh, paludis/syncer.cc: Add a Syncer to sync Git
+ repositories (GitSyncer).
+
+ * AUTHORS: Add myself as 'Contributor'.
+
+2006-05-21 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * NEWS, configure.ac: Tag for 0.2.4.
+
+ + Release: 0.2.4
+
+2006-05-21 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/ebuild.cc: Fix ebuild metadata generation.
+
+2006-05-20 Danny van Dyk <kugelfang@gentoo.org>
+
+ * paludis/util/smart_record.hh.m4: Increase maximal number of smartrecord
+ entries to 15.
+
+ * paludis/portage_repository.cc, paludis/portage_repository.hh: Turn
+ the location of the security advisory directory into a config item.
+
+2006-05-19 Stephen Bennett <spb@gentoo.org>
+
+ * NEWS, configure.ac: Tag for 0.2.3.
+
+ + Release: 0.2.3
+
+2006-05-19 Stephen Bennett <spb@gentoo.org>
+
+ * ebuild/kernel_functions.bash, ebuild/kernel_funtions_TEST.bash,
+ ebuild/ebuild.bash, ebuild/Makefile.am: Add KV_* functions imported
+ from functions.sh.
+
+2006-05-19 Stephen Bennett <spb@gentoo.org>
+
+ * paludis/portage_repository.cc: Support removal of packages from
+ system set in subprofiles.
+
+2006-05-19 Stephen Bennett <spb@gentoo.org>
+
+ * src/colour.hh, configure.ac: Allow a choice of colourschemes.
+
+2006-05-19 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * Makefile.am, configure.ac, eselect, eselect/Makefile.am,
+ eselect/news.eselect: Ship the news.eselect module as part of Paludis
+ for now.
+
+2006-05-18 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/Makefile.am, ebuild/digests/Makefile.am,
+ ebuild/utils/Makefile.am, ebuild/utils/merge_TEST_cleanup.sh,
+ ebuild/utils/merge_TEST_setup.sh,
+ ebuild/utils/unmerge_TEST_cleanup.sh,
+ ebuild/utils/unmerge_TEST_setup.sh, hooks/Makefile.am.m4,
+ paludis/Makefile.am.m4, paludis/args/Makefile.am,
+ paludis/config_file_TEST_cleanup.sh,
+ paludis/config_file_TEST_setup.sh,
+ paludis/portage_repository_TEST_cleanup.sh,
+ paludis/portage_repository_TEST_setup.sh, paludis/qa/Makefile.am.m4,
+ paludis/qa/file_permissions_check_TEST_cleanup.sh,
+ paludis/qa/file_permissions_check_TEST_setup.sh,
+ paludis/qa/has_ebuilds_check_TEST_cleanup.sh,
+ paludis/qa/has_ebuilds_check_TEST_setup.sh,
+ paludis/qa/has_misc_files_check_TEST_cleanup.sh,
+ paludis/qa/has_misc_files_check_TEST_setup.sh,
+ paludis/qa/package_name_check_TEST_cleanup.sh,
+ paludis/qa/package_name_check_TEST_setup.sh,
+ paludis/util/Makefile.am.m4,
+ paludis/util/dir_iterator_TEST_cleanup.sh,
+ paludis/util/dir_iterator_TEST_setup.sh,
+ paludis/util/fs_entry_TEST_cleanup.sh,
+ paludis/util/fs_entry_TEST_setup.sh,
+ paludis/util/is_file_with_extension_TEST_setup.sh,
+ paludis/vdb_repository_TEST_cleanup.sh,
+ paludis/vdb_repository_TEST_setup.sh, src/Makefile.am,
+ src/qualudis/Makefile.am, test/Makefile.am, test/run_test.sh: Use bash
+ rather than sh, since we already require it anyway and BSD sh sucks.
+
+2006-05-18 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/version_spec_TEST.cc: Check tilde comparison behaviour.
+
+2006-05-17 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/ebuild.cc, paludis/portage_repository_TEST.cc,
+ paludis/portage_repository_TEST_setup.sh: Handle ebuilds with really
+ broken metadata more gracefully.
+
+2006-05-17 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * src/install.cc: Fix text alignment issue when displaying tags.
+
+2006-05-17 Stephen Bennett <spb@gentoo.org>
+
+ * ebuild/echo_functions.bash: Add our own implementations of einfo and
+ friends to avoid depending on functions.sh.
+
+2006-05-17 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/ebuild.bash, paludis/ebuild.cc, paludis/ebuild.hh: Emulate
+ various Portage internals.
+
+2006-05-16 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/builtin_unmerge.bash: Don't sandbox unmerging from /, to work
+ around a sandbox 'feature'.
+
+2006-05-15 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * src/command_line.cc, src/command_line.hh, src/list.cc: Add
+ --repository, --category, --package filter options for the --list
+ actions.
+
+2006-05-14 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * doc/Makefile.am: Fix distcheck.
+
+2006-05-14 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/dep_lexer.cc, paludis/dep_lexer.hh,
+ paludis/dep_lexer_TEST.cc, paludis/dep_list.cc,
+ paludis/dep_list_TEST.cc, paludis/dep_parser.cc,
+ paludis/dep_parser.hh, paludis/dep_parser_TEST.cc, paludis/ebuild.cc,
+ paludis/environment.cc, paludis/fake_repository.cc, paludis/files.m4,
+ paludis/portage_repository.cc, paludis/vdb_repository.cc,
+ paludis/version_metadata.cc, paludis/version_metadata.hh,
+ src/install.cc, src/query.cc, paludis/portage_dep_lexer.cc,
+ paludis/portage_dep_lexer.hh, paludis/portage_dep_lexer_TEST.cc,
+ paludis/portage_dep_parser.cc, paludis/portage_dep_parser.hh,
+ paludis/portage_dep_parser_TEST.cc: Move DepParser ->
+ PortageDepParser, DepLexer -> PortageDepLexer, abstract out remaining
+ parser calls into VersionMetadata.
+
+2006-05-13 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/util/tokeniser.cc: Generalise the WhitespaceTokeniser to
+ include newlines.
+
+ * paludis/config_file.cc, paludis/default_config.cc,
+ paludis/default_environment.cc, paludis/portage_repository.cc,
+ paludis/vdb_repository.cc: Switch to using WhitespaceTokeniser rather
+ than separate instances.
+
+2006-05-13 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/dep_list.cc, paludis/dep_list_TEST.cc, paludis/dep_parser.cc,
+ paludis/dep_parser.hh, paludis/ebuild.cc, paludis/ebuild.hh,
+ paludis/environment.cc, paludis/fake_repository.cc,
+ paludis/match_package.cc, paludis/portage_repository.cc,
+ paludis/portage_repository_TEST.cc, paludis/vdb_repository.cc,
+ paludis/version_metadata.cc, paludis/version_metadata.hh,
+ src/install.cc, src/query.cc: Rework VersionMetadata to be far less
+ ebuild-centric.
+
+ * paludis/util/compare.hh: Avoid using always_inline, it breaks in
+ various weird circumstances.
+
+ * paludis/util/files.m4, paludis/util/tokeniser.cc,
+ paludis/util/tokeniser.hh: Add a singleton WhitespaceTokeniser class,
+ rather than declaring them all over the place.
+
+2006-05-08 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/utils/merge, ebuild/utils/unmerge: Avoid temporarily removing
+ symlinks where possible.
+
+2006-05-07 Danny van Dyk <kugelfang@gentoo.org>
+
+ * ebuild/utils/merge: Add 'hash -r' after removal of symlinks.
+
+ + Fixes: Berlios#7414.
+
+2006-05-07 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/builtin_merge.bash: Switch off sandbox when merging to / to
+ avoid sandbox getting upset when its own files get replaced.
+
+ + Fixes: Berlios#7402.
+
+2006-05-06 Stephen Bennett <spb@gentoo.org>
+
+ * src/install.cc: Display use.force info in --install output.
+
+2006-05-06 Stephen Bennett <spb@gentoo.org>
+
+ * paludis/repository.hh, paludis/vdb_repository.hh,
+ paludis/vdb_repository.cc, paludis/fake_repository.hh,
+ paludis/fake_repository.cc, paludis/portage_repository.hh,
+ paludis/portage_repository.cc, paludis/portage_repository_TEST.cc,
+ paludis/portage_repository_TEST_setup.sh: use.force, package.use.force
+ support.
+
+2006-05-05 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * doc/Makefile.am: Make clean, maintainer-clean remove the html/
+ generated content.
+
+2006-05-05 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * NEWS, configure.ac: Update for 0.2.2.
+
+ + Release: 0.2.2
+
+2006-05-05 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/default_environment.cc, paludis/dep_tag.cc,
+ paludis/dep_tag.hh, paludis/environment.cc,
+ paludis/portage_repository.cc, paludis/vdb_repository.cc,
+ src/install.cc: Rework dep tagging, and use it more heavily.
+
+2006-05-04 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/pkg_setup.bash: Allow extra pkg_ sandbox privs in pkg_setup.
+
+2006-05-04 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * src/query.cc: Explain the mask reasons shown with --query via a key.
+
+2006-05-04 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/portage_repository.cc: Don't try Gentoo mirrors for
+ RESTRICT=mirror packages.
+
+2006-05-04 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/ebuild.bash: Add /var/cache to the sandbox writelist.
+
+2006-05-04 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/build_functions.bash: Pass along quotes properly when calling
+ econf.
+
+ + Fixes: Berlios#7358.
+
+2006-05-03 Ilya A. Volynets-Evenbakh <ilya@total-knowledge.com>
+
+ * ebuild/util/Makefile.am: use $< and $@ to refer to lib input and
+ output files, in order to avoid out-of-tree build breackage
+
+2006-05-03 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/portage_repository_TEST.cc, test/test_framework.cc,
+ test/test_framework.hh: Don't try to run tests that launch sandbox if
+ sandbox is already active.
+
+2006-05-02 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * hooks/Makefile.am.m4, hooks/news.bash: Add GLEP 42 (News items)
+ hooks.
+
+ * paludis/config_file.cc, paludis/config_file.hh: Add GLEP 42 news
+ item file class.
+
+ * paludis/portage_repository.cc, paludis/portage_repository.hh,
+ paludis/repository.hh: Add repository support for creating unread news
+ file lists.
+
+ * src/Makefile.am, src/command_line.cc, src/command_line.hh,
+ src/install.cc, src/news.cc, src/news.hh, src/paludis.cc: Add
+ --update-news internal action.
+
+2006-05-02 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/default_config.hh, paludis/default_environment.cc: Pass
+ HOOK_LOG_LEVEL, HOOK_CONFIG_SUFFIX to hooks.
+
+2006-05-02 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * src/sync.cc: Hooks now get called even if repository names aren't
+ passed on the commandline.
+
+2006-05-02 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/dep_atom.cc, paludis/dep_atom_TEST.cc: Parse =foo/bar-scm
+ and the like correctly.
+
+2006-05-02 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/util/fs_entry_TEST_setup.sh: Add a one second delay and an
+ extra touch, to try to avoid tests occasionally failing when checking
+ mtime / ctime.
+
+2006-05-02 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * NEWS, configure.ac: Update for 0.2.1.
+
+ + Release: 0.2.1
+
+2006-05-02 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * doc/Makefile.am, doc/doc_news.doxygen, doc/header.html: Add a NEWS
+ docs page.
+
+2006-05-01 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/pkg_nofetch.bash, paludis/ebuild.cc, paludis/ebuild.hh,
+ paludis/portage_repository.cc: Better nofetch support.
+
+2006-05-01 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/util/system.cc: Don't spawn sandbox if we're already
+ sandboxed.
+
+2006-05-01 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * src/query.cc: Tell the user if they try to query a set.
+
+2006-05-01 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/portage_repository.cc, paludis/portage_repository.hh,
+ paludis/util/smart_record.hh.m4: Add file package sets to Portage
+ format repositories.
+
+ + Fixes: Paludis#FR2184.
+
+2006-05-01 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * hooks/Makefile.am.m4: Rework to avoid breaking distcheck's uninstall
+ checks.
+
+2006-05-01 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/vdb_repository.cc: Don't display the "key lookup failed"
+ warning for VDB entries where the file is missing.
+
+2006-05-01 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/vdb_repository.cc: USE may contain -flags. Ignore them.
+
+2006-05-01 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * src/applets.cc: Don't include the ::repo in --best-version output,
+ it confuses built_with_use.
+
+2006-05-01 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/default_environment.cc, paludis/default_environment.hh,
+ paludis/environment.cc, paludis/environment.hh,
+ paludis/test_environment.hh: Allow hooks to have additional associated
+ environment variables.
+
+ * src/install.cc, src/sync.cc, src/uninstall.cc: Provide appropriate
+ environment variables for hooks.
+
+ * hooks/Makefile.am.m4, hooks/log.bash: Add hook script for creating
+ paludis.log entries.
+
+2006-05-01 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * doc/doc_bootstrap_howto.doxygen: Use cat <<"END" to avoid having to
+ escape the dollar signs. Thanks to ecatmur.
+
+2006-05-01 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * doc/doc_portage_differences.doxygen, paludis/default_environment.cc,
+ paludis/default_environment.hh, paludis/environment.cc,
+ paludis/environment.hh: Support user defined package sets.
+
+2006-05-01 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * src/install.cc: Display EAPI in mask reasons, like we do for licence
+ and keywords.
+
+2006-05-01 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * doc/doc_bootstrap_howto.doxygen: Update with new overlay URL.
+
+2006-05-01 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ + Release: 0.2.0
+
+2006-05-01 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * src/install.cc: Don't add to world if --fetch is specified.
+
+2006-05-01 Stephen Bennett <spb@gentoo.org>
+
+ * NEWS, configure.ac: Paludis 0.2.0.
+
+2006-04-30 Stephen Bennett <spb@gentoo.org>
+
+ * ebuild/build_functions.bash: Killed some overzealous quoting in
+ einstall that was breaking some packages.
+
+2006-04-30 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/utils/Makefile.am, ebuild/utils/dolib.a,
+ ebuild/utils/dolib.so, ebuild/utils/newlib.a, ebuild/utils/newlib.so,
+ ebuild/utils/dolib.a.in, ebuild/utils/dolib.so.in,
+ ebuild/utils/newlib.a.in, ebuild/utils/newlib.so.in: Try to work
+ around svn ignoring things.
+
+2006-04-30 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * hooks/Makefile.am.m4: Fix EXTRA_DIST for distribution tarballs.
+
+2006-04-30 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/digests/Makefile.am: Fix include path.
+
+2006-04-30 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * doc/Makefile.am, doc/doxygen.conf.in, doc/footer.html,
+ doc/header.html, doc/paludis.css: Replace the icky default Doxygen
+ style with a marginally less icky style stolen from libebt.
+
+2006-04-30 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * autogen.bash, ebuild/utils/dobin_TEST.bash, hooks/Makefile.am ->
+ hooks/Makefile.am.m4: Restructure hooks Makefile and dobin tests to
+ avoid breaking distcheck.
+
+ + Fixes: Berlios#7328.
+ + Fixes: Berlios#7326.
+
+2006-04-30 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/syncer.cc: Make the local directory when syncing via rsync.
+
+2006-04-30 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/util/fs_entry.cc, paludis/util/fs_entry.hh,
+ paludis/util/fs_entry_TEST.cc: Add a mkdir method to FSEntry.
+
+2006-04-29 Stephen Bennett <spb@gentoo.org>
+
+ * ebuild/build_functions.bash: Make einstall pass libdir= to make.
+
+ + Fixes: Berlios#7305.
+
+2006-04-29 Danny van Dyk <kugelfang@gentoo.org>
+
+ * paludis/config_file.cc, paludis/config_file.hh,
+ paludis/portage_repository.cc, paludis/portage_repository.hh:
+ Rework of the built-in security set.
+
+2006-04-28 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * doc/doc_main.doxygen, paludis/contents.cc, paludis/contents.hh,
+ paludis/fake_repository.cc, paludis/fake_repository.hh,
+ paludis/files.m4, paludis/package_database.cc,
+ paludis/package_database.hh, paludis/portage_repository.cc,
+ paludis/portage_repository.hh, paludis/repository.hh,
+ paludis/vdb_repository.cc, paludis/vdb_repository.hh: Provide a way of
+ querying the contents of a package.
+
+ * src/Makefile.am, src/colour.hh, src/command_line.cc,
+ src/command_line.hh, src/contents.cc, src/contents.hh, src/owner.cc,
+ src/owner.hh, src/paludis.cc: Add --owner and --contents actions.
+
+2006-04-27 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/version_spec.cc, paludis/version_spec_TEST.cc: Allow scm-rX
+ on unversioned packages.
+
+2006-04-27 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/unpack_functions.bash: Make unpack know how to extract .ar
+ and .deb files.
+
+2006-04-27 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * doc/doc_bootstrap_howto.doxygen: Add gettext to the suggested test
+ blacklist.
+
+2006-04-26 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * src/Makefile.am, src/install.cc, src/licence.cc, src/licence.hh,
+ src/query.cc: Use the fancy licence displayer for --query as well as
+ --install.
+
+2006-04-26 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/vdb_repository.cc: Load HOMEPAGE, DESCRIPTION.
+
+ * src/query.cc: Prefer installed packages over uninstalled packages,
+ even if there are newer versions of uninstalled packages, when
+ displaying query output.
+
+2006-04-26 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/environment.cc: Handle || ( ) in LICENSE properly.
+
+2006-04-26 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/digests/Makefile.am, ebuild/digests/dormd160,
+ ebuild/digests/dormd160.cc, ebuild/digests/dormd160_TEST.cc,
+ ebuild/digests/rmd160.cc, ebuild/digests/rmd160.hh: Implement our own
+ RMD160 too, to avoid an OpenSSL dependency.
+
+2006-04-26 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * src/install.cc: Display keywords for masked packages, like we do for
+ licences.
+
+2006-04-26 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * src/paludis.cc: Show whether sandbox is enabled with --version.
+
+2006-04-25 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * doc/Makefile.am: Don't tinker with Doxygen niceness.
+
+ * doc/doc_bootstrap_howto.doxygen: Update with information about
+ avoiding sandbox and test issues with Python, avoiding test issues
+ with various packages, apr's pickiness and various wording and
+ formatting tweaks.
+
+ * configure.ac, ebuild/Makefile.am, ebuild/builtin_fetch.bash,
+ ebuild/builtin_init.bash, ebuild/builtin_merge.bash,
+ ebuild/builtin_strip.bash, ebuild/builtin_unmerge.bash,
+ ebuild/ebuild.bash, ebuild/pkg_postinst.bash, ebuild/pkg_postrm.bash,
+ ebuild/pkg_preinst.bash, ebuild/pkg_prerm.bash,
+ ebuild/sandbox_stubs.bash, ebuild/utils/doconfd, ebuild/utils/doenvd,
+ ebuild/utils/doinitd, ebuild/utils/doins, ebuild/utils/dolib.a,
+ ebuild/utils/dolib.so, ebuild/utils/donewins, ebuild/utils/newbin,
+ ebuild/utils/newconfd, ebuild/utils/newdoc, ebuild/utils/newenvd,
+ ebuild/utils/newexe, ebuild/utils/newinitd, ebuild/utils/newins,
+ ebuild/utils/newlib.a, ebuild/utils/newlib.so, ebuild/utils/newman,
+ ebuild/utils/newsbin, paludis/ebuild.cc, paludis/ebuild.hh,
+ paludis/util/system.cc, paludis/util/system.hh, ebuild/sandbox.bash:
+ Support sandbox.
+
+2006-04-25 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * doc/doc_bootstrap_howto.doxygen: Our list of required licences was
+ slightly too short. Extend it.
+
+2006-04-24 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * Makefile.am, configure.ac, ebuild/Makefile.am,
+ ebuild/builtin_merge.bash, ebuild/builtin_updateenv.bash,
+ ebuild/depend.bash, ebuild/ebuild.bash, hooks, hooks/Makefile.am,
+ hooks/eselect_env_update.bash, hooks/find_config_updates.bash,
+ hooks/gnu_info_index.bash, paludis/Makefile.am.m4,
+ paludis/default_config.cc, paludis/default_config.hh,
+ paludis/default_environment.cc, paludis/default_environment.hh,
+ paludis/ebuild.cc, paludis/environment.hh,
+ paludis/test_environment.hh, src/install.cc, src/sync.cc,
+ src/uninstall.cc, ebuild/builtin_metadata.bash: Rename depend ebuild
+ action to metadata and remove updateenv action. Add a hooks framework.
+ Use hooks for running eselect env update, updating GNU info
+ directories and checking for configuration files.
+
+ * ebuild/echo_functions.bash: Fix log output when redirected.
+
+ * doc/doc_portage_differences: We have hooks.
+
+2006-04-24 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/util/fs_entry_TEST.cc, paludis/util/fs_entry_TEST_setup.sh:
+ Add further symlink behaviour checks.
+
+ * paludis/util/is_file_with_extension.cc: Also allow symlinks to
+ files.
+
+2006-04-24 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/utils/merge: Name CONFIG_PROTECTed files in the same way
+ Portage does.
+
+2006-04-24 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * doc/doc_references.doxygen, doc/doxygen.conf.in,
+ paludis/util/files.m4, paludis/util/random.cc, paludis/util/random.hh,
+ paludis/util/random_TEST.cc: Don't use the c random number functions
+ that have global state, use our own instead.
+
+2006-04-23 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * doc/Makefile.am, doc/doc_mainpage.doxygen,
+ doc/doc_portage_differences.doxygen: Extend documentation to include how
+ we differ from Portage.
+
+2006-04-23 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/default_environment.cc, paludis/dep_atom.cc,
+ paludis/dep_atom.hh, paludis/dep_atom_TEST.cc, paludis/dep_list_TEST.cc,
+ paludis/match_package.cc, paludis/portage_repository.cc: Enable [use]
+ dependencies (library only, no nice user interface to them at present).
+ Enhance priority of use.mask. Add circular detection for per package use
+ masking when [use] deps are used, to avoid infinite recursion.
+
+2006-04-23 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * configure.ac: Don't enable QA ever, for now.
+
+2006-04-23 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * configure.ac, ebuild/Makefile.am, ebuild/builtin_fetch.bash,
+ ebuild/digests, ebuild/digests/Makefile.am, ebuild/digests/domd5,
+ ebuild/digests/dormd160, ebuild/digests/dosha256.cc,
+ ebuild/digests/dosha256_TEST.cc, ebuild/digests/sha256.cc,
+ ebuild/digests/sha256.hh: Split out digest checks into separate
+ programs, to make ferringb happy. Add our own SHA-256 implementation
+ to avoid pulling in nasty dependencies.
+
+2006-04-23 Stephen Bennett <spb@gentoo.org>
+
+ * paludis/repository.hh, paludis/portage_repository.hh,
+ paludis/fake_repository.hh, paludis/vdb_repository.hh,
+ paludis/portage_repository.cc, paludis/portage_repository_TEST.cc,
+ paludis/portage_repository_TEST_setup.sh, paludis/fake_repository.cc,
+ paludis/vdb_repository.cc, src_install.cc: Per-package USE masking
+ support.
+
+2006-04-21 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/default_environment.cc, paludis/dep_list.cc,
+ paludis/match_package.cc, paludis/match_package.hh,
+ paludis/package_database.cc, paludis/package_database.hh,
+ paludis/package_database_TEST.cc, paludis/portage_repository.cc,
+ paludis/test_environment.cc: Switch match_package to take Environment
+ rather than PackageDatabase as its first argument, since we're not
+ using multiple DBs per environment any more.
+
+2006-04-20 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/version_spec.cc: Don't do silly things when given "0" as a
+ version.
+
+2006-04-20 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/util/smart_record.hh.m4: Intel's compiler handles partial
+ specialisation slightly differently. Make the char * to string type
+ conversion work.
+
+2006-04-20 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/version_spec.cc: Fix STL usage issues that can cause
+ segfaults with Intel's compiler.
+
+2006-04-20 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * doc/doc_main.doxygen, paludis/args/args.cc, paludis/args/args.hh,
+ paludis/args/args_TEST.cc, paludis/args/args_dumper.cc,
+ paludis/args/args_dumper.hh, paludis/args/args_error.cc,
+ paludis/args/args_error.hh, paludis/args/args_group.cc,
+ paludis/args/args_group.hh, paludis/args/args_handler.cc,
+ paludis/args/args_handler.hh, paludis/args/args_option.cc,
+ paludis/args/args_option.hh, paludis/args/args_visitor.cc,
+ paludis/args/args_visitor.hh, paludis/dep_atom.hh,
+ paludis/dep_atom_flattener.hh, paludis/dep_list.hh,
+ paludis/dep_parser.cc, paludis/dep_tag.hh, paludis/ebuild.hh,
+ paludis/environment.cc, paludis/fake_repository.hh,
+ paludis/hashed_containers.cc, paludis/portage_repository.cc,
+ paludis/repository.hh, paludis/syncer.hh, paludis/test_extras.cc,
+ paludis/version_operator.hh, src/command_line.hh, src/install.cc,
+ src/paludis.cc: Last batch of code docs changes for now.
+
+2006-04-20 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * doc/doc_main.doxygen, paludis/util/attributes.hh,
+ paludis/util/collection.hh, paludis/util/compare.hh,
+ paludis/util/composite_pattern.hh, paludis/util/container_entry.hh,
+ paludis/util/counted_ptr.hh, paludis/util/counted_ptr_TEST.cc,
+ paludis/util/deleter.cc, paludis/util/deleter.hh,
+ paludis/util/deleter_TEST.cc, paludis/util/destringify.cc,
+ paludis/util/destringify.hh, paludis/util/destringify_TEST.cc,
+ paludis/util/dir_iterator.cc, paludis/util/dir_iterator.hh,
+ paludis/util/dir_iterator_TEST.cc, paludis/util/exception.cc,
+ paludis/util/exception.hh, paludis/util/files.m4,
+ paludis/util/fs_entry.cc, paludis/util/fs_entry.hh,
+ paludis/util/fs_entry_TEST.cc, paludis/util/instantiation_policy.cc,
+ paludis/util/instantiation_policy.hh,
+ paludis/util/instantiation_policy_TEST.cc, paludis/util/is_const.cc,
+ paludis/util/is_const.hh, paludis/util/is_const_TEST.cc,
+ paludis/util/is_file_with_extension.cc,
+ paludis/util/is_file_with_extension.hh,
+ paludis/util/is_file_with_extension_TEST.cc, paludis/util/iterator.hh,
+ paludis/util/iterator_TEST.cc, paludis/util/join.cc,
+ paludis/util/join.hh, paludis/util/join_TEST.cc, paludis/util/log.cc,
+ paludis/util/log.hh, paludis/util/log_TEST.cc,
+ paludis/util/match_sequence.cc, paludis/util/match_sequence.hh,
+ paludis/util/match_sequence_TEST.cc,
+ paludis/util/private_implementation_pattern.cc,
+ paludis/util/private_implementation_pattern.hh,
+ paludis/util/pstream.cc, paludis/util/pstream.hh,
+ paludis/util/pstream_TEST.cc, paludis/util/random.cc,
+ paludis/util/random.hh, paludis/util/save.cc, paludis/util/save.hh,
+ paludis/util/save_TEST.cc, paludis/util/smart_record.hh.m4,
+ paludis/util/smart_record_TEST.cc, paludis/util/stringify.hh,
+ paludis/util/stringify_TEST.cc, paludis/util/strip.cc,
+ paludis/util/strip.hh, paludis/util/strip_TEST.cc,
+ paludis/util/system.cc, paludis/util/system.hh,
+ paludis/util/system_TEST.cc, paludis/util/test_extras.cc,
+ paludis/util/tokeniser.hh, paludis/util/tokeniser_TEST.cc,
+ paludis/util/validated.hh, paludis/util/validated_TEST.cc,
+ paludis/util/virtual_constructor.hh,
+ paludis/util/virtual_constructor_TEST.cc, paludis/util/visitor.hh,
+ paludis/util/visitor_TEST.cc: Fix up docs for paludis/util/ .
+
+2006-04-19 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * doc/doc_main.doxygen, paludis/package_database.cc,
+ paludis/package_database.hh, paludis/package_database_TEST.cc,
+ paludis/portage_repository.cc, paludis/portage_repository.hh,
+ paludis/portage_repository_TEST.cc, paludis/repository.cc,
+ paludis/repository.hh, paludis/syncer.cc, paludis/syncer.hh,
+ paludis/test_environment.cc, paludis/test_environment.hh,
+ paludis/test_extras.cc, paludis/vdb_repository.cc,
+ paludis/vdb_repository.hh, paludis/vdb_repository_TEST.cc,
+ paludis/version_metadata.cc, paludis/version_metadata.hh,
+ paludis/version_operator.cc, paludis/version_operator.hh,
+ paludis/version_operator_TEST.cc, paludis/version_spec.cc,
+ paludis/version_spec.hh, paludis/version_spec_TEST.cc: And the rest of
+ the docs for paludis/.
+
+2006-04-19 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/utils/merge_TEST.bash, ebuild/utils/unmerge_TEST.bash:
+ Support autotools "build somewhere else" mode.
+
+2006-04-19 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * src/install.cc, src/sync.cc, src/uninstall.cc: Stop relying upon
+ namespaces being pulled in magically.
+
+2006-04-19 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * doc/doc_main.doxygen, paludis/ebuild.cc, paludis/ebuild.hh,
+ paludis/environment.cc, paludis/environment.hh,
+ paludis/fake_repository.cc, paludis/fake_repository.hh,
+ paludis/hashed_containers.cc, paludis/hashed_containers.hh.in,
+ paludis/hashed_containers_TEST.cc, paludis/mask_reasons.cc,
+ paludis/mask_reasons.hh, paludis/match_package.cc,
+ paludis/match_package.hh, paludis/name.cc, paludis/name.hh,
+ paludis/name_TEST.cc: Some more progress on the documentation rework.
+
+2006-04-19 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/ebuild.bash, ebuild/echo_functions.bash, paludis/util/log.cc,
+ paludis/util/log.hh, src/paludis.cc: Add program name and time to log
+ messages.
+
+ * paludis/vdb_repository.cc: Add debug messages for operations that
+ are expected to be slow.
+
+2006-04-19 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * doc/doc_main.doxygen, doc/doc_namespaces.doxygen,
+ paludis/about.hh.in, paludis/about_TEST.cc, paludis/config_file.cc,
+ paludis/config_file.hh, paludis/config_file_TEST.cc,
+ paludis/default_config.cc, paludis/default_config.hh,
+ paludis/dep_atom.cc, paludis/dep_atom.hh, paludis/dep_atom_TEST.cc,
+ paludis/dep_atom_dumper.cc, paludis/dep_atom_dumper.hh,
+ paludis/dep_atom_dumper_TEST.cc, paludis/dep_atom_flattener.cc,
+ paludis/dep_atom_flattener.hh, paludis/dep_atom_pretty_printer.cc,
+ paludis/dep_atom_pretty_printer.hh, paludis/dep_lexer.cc,
+ paludis/dep_lexer.hh, paludis/dep_lexer_TEST.cc,
+ paludis/dep_parser.cc, paludis/dep_parser.hh,
+ paludis/dep_parser_TEST.cc, paludis/dep_tag.cc, paludis/dep_tag.hh:
+ First part of the documentation rework, plus minor formatting and code
+ style fixes. More to come.
+
+2006-04-19 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * src/Makefile.am, src/applets.cc, src/applets.hh,
+ src/command_line.cc, src/command_line.hh, src/paludis.cc: Add
+ --list-dep-tag-categories and related test.
+
+2006-04-19 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * doc/doc_mainpage.doxygen, doc/HOWTO.rst, doc/doc_changelog.doxygen,
+ doc/Makefile.am, doc/doc_bootstrap_howto.doxygen, Makefile.am,
+ README: Rework the documentation.
+
+2006-04-19 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/version_spec_TEST.cc, paludis/version_spec.cc,
+ paludis/version_spec.hh: Add support for -scm versions. Rework
+ version spec internals to be substantially cleaner. Make the tests a
+ lot more extensive.
+
+2006-04-19 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/util/compare.hh, paludis/util/smart_record_TEST.cc: Make
+ CompareByAll comparisons work correctly.
+
+2006-04-18 Stephen Bennett <spb@gentoo.org>
+
+ * paludis/portage_repository.cc: Fix compiler warning.
+
+2006-04-18 Stephen Bennett <spb@gentoo.org>
+
+ * paludis/fake_repository.cc, paludis/vdb_repository.cc,
+ paludis/default_environment.cc, paludis/fake_repository.hh,
+ paludis/vdb_repository.hh, paludis/repository.hh,
+ paludis/portage_repository.cc, paludis/vdb_repository_TEST.cc,
+ paludis/vdb_repository_TEST_setup.sh, paludis/package_database.hh,
+ paludis/portage_repository.hh, paludis/package_database_entry.hh:
+ Support querying of USE from VDBRepository.
+
+2006-04-18 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/portage_repository_TEST.cc, paludis/portage_repository.cc,
+ paludis/portage_repository_TEST_setup.sh: Ignore any weird version specs
+ with a warning, rather than bombing out.
+
+2006-04-18 Stephen Bennett <spb@gentoo.org>
+
+ * ebuild/build_functions.bash: Replace non-existant ${PREFIX} with /usr.
+
+2006-04-18 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * src/install.cc: Fix (5 of 4) style counts caused by incrementing the
+ package counter when cleaning.
+
+2006-04-18 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/vdb_repository.hh: Explicitly include fs_entry, rather than
+ relying upon magic.
+
+ * paludis/files.m4, paludis/vdb_repository_TEST_cleanup.sh,
+ paludis/vdb_repository_TEST_setup.sh, paludis/vdb_repository_TEST.cc:
+ Some very crude VDB repo tests.
+
+2006-04-18 Stephen Bennett <spb@gentoo.org>
+
+ * ebuild/ebuild.bash: Export variables set in make.defaults.
+
+2006-04-18 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/ebuild.hh, paludis/portage_repository.cc, paludis/ebuild.cc:
+ Provide A during the ebuild build phase.
+
+2006-04-18 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * doc/HOWTO.rst: Add a note about the backslashes being for cat.
+
+2006-04-18 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/portage_repository.cc: Fix SLOT being set to an empty string
+ for some non-default virtual providers.
+
+2006-04-18 Danny van Dyk <kugelfang@gentoo.org>
+
+ * paludis/config_file.cc, paludis/config_file.hh: Fix typo.
+
+ * paludis/portage_repository.cc: Fix return value for an empty
+ security package set. Fix whitespaces.
+
+2006-04-17 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/dep_tag.cc, paludis/dep_list.cc, paludis/vdb_repository.cc,
+ paludis/files.m4, paludis/dep_atom.hh, paludis/dep_list.hh,
+ paludis/dep_tag.hh, paludis/portage_repository.cc, paludis/dep_atom.cc:
+ Turn dep tags into a proper class. Associate some basic GLSA information
+ with GLSA tags (future expansion expected).
+
+ * src/install.cc: Display new style dep tags.
+
+2006-04-17 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/util/iterator.hh: Add convenience indirect_iterator generation
+ function.
+
+2006-04-17 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/ebuild.cc, paludis/ebuild.hh, paludis/files.m4,
+ paludis/portage_repository.cc, paludis/repository.cc,
+ paludis/repository.hh, paludis/vdb_repository.cc: Split ebuild
+ execution code out into its own EbuildCommand classes.
+
+2006-04-17 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/config_file.cc: Typo fix.
+
+2006-04-17 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/util/fs_entry.hh, paludis/util/fs_entry.cc,
+ paludis/util/fs_entry_TEST.cc: Remove automatic cast from FSEntry to
+ std::string, since all it does is lead to silly bugs going undetected
+ at compile time.
+
+ * paludis/vdb_repository.cc, paludis/portage_repository.cc: Don't rely
+ upon automatic casts from FSEntry to std::string.
+
+ * paludis/config_file.cc, paludis/config_file.hh,
+ paludis/config_file_TEST.cc: Provide overloaded constructors that take
+ an FSEntry rather than a std::string.
+
+2006-04-17 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/portage_repository.hh: Sync is a string, not a filesystem
+ entry.
+
+2005-04-17 Danny van Dyk <kugelfang@gentoo.org>
+
+ * paludis/config_file.cc, paludis/config_file.hh,
+ paludis/dep_parser.cc, paludis/dep_parser.hh,
+ paludis/portage_repository.cc, paludis/portage_repository.hh:
+ Implement built-in 'security' package set.
+
+2006-04-17 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/vdb_repository.cc: Fix VDBEntry's operator< to return false
+ rather than an undefined value on equality.
+
+2006-04-16 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/vdb_repository.cc, paludis/vdb_repository.hh,
+ paludis/portage_repository.cc, paludis/portage_repository.hh: Use a
+ smart record for the constructor, allowing named parameters to be
+ provided, rather than passing around huge parameter lists containing
+ lots of things of the same type
+
+2006-04-16 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/util/smart_record.hh.m4, paludis/util/smart_record_TEST.cc:
+ Add support for named parameters to smart records.
+
+2006-04-16 Stephen Bennett <spb@gentoo.org>
+
+ * paludis/portage_repository.cc, ebuild/ebuild.bash: Support multiple
+ inheritance in profiles.
+
+2006-04-16 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * ebuild/builtin_fetch.bash: After a failed fetch, wget has a tendency
+ to leave zero byte files lying around. When checking for existing
+ files in DISTDIR in builtin_fetch, if the file is zero bytes in size
+ then delete and refetch it.
+
+ + Fixes: Berlios#7163.
+
+2006-04-16 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/portage_repository.cc: Remove iostream include, it was only
+ there for early debugging code and adds overhead (see TC++SL 13.2.3).
+
+2006-04-16 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/portage_repository.cc, ebuild/builtin_tidyup.bash,
+ ebuild/ebuild.bash, ebuild/builtin_updateenv.bash, ebuild/Makefile.am:
+ Split out the eselect env update call from builtin_tidyup into a new
+ builtin_updateenv, making SKIP_FUNCTIONS="tidyup" a lot more sensible.
+
+2006-04-16 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+
+ * paludis/portage_repository.cc: Expand mirror:// components that have
+ a path before the filename correctly.
+
+ + Fixes: Berlios#7161.
+
diff --git a/0.4.0/Makefile.am b/0.4.0/Makefile.am
new file mode 100644
index 000000000..201a396b9
--- /dev/null
+++ b/0.4.0/Makefile.am
@@ -0,0 +1,24 @@
+CLEANFILES = *~ done-check gmon.out *.gcov *.gcno *.gcda
+MAINTAINERCLEANFILES = Makefile.in configure config/* aclocal.m4 \
+ config.h config.h.in INSTALL COPYING
+AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip std-options
+EXTRA_DIST = autogen.bash
+SUBDIRS = misc test paludis ebuild src doc hooks eselect
+
+doxygen :
+ $(MAKE) -C doc doxygen
+
+upload-homepage :
+ $(MAKE) -C doc upload-homepage
+
+check-local :
+ touch $(top_builddir)/done-check
+
+install-data-local :
+ @[ -f $(top_builddir)/done-check ] || echo || true
+ @[ -f $(top_builddir)/done-check ] || echo "**************************************" || true
+ @[ -f $(top_builddir)/done-check ] || echo "Looks like you didn't run 'make check'" || true
+ @[ -f $(top_builddir)/done-check ] || echo " No cookies for you today. " || true
+ @[ -f $(top_builddir)/done-check ] || echo "**************************************" || true
+ @[ -f $(top_builddir)/done-check ] || echo || true
+
diff --git a/0.4.0/NEWS b/0.4.0/NEWS
new file mode 100644
index 000000000..208b8c437
--- /dev/null
+++ b/0.4.0/NEWS
@@ -0,0 +1,147 @@
+News for Paludis
+================
+
+This file lists the major changes between versions. For a more detailed list
+of every change, see the ChangeLog.
+
+0.4.0:
+ * Lots of internal code cleanup.
+
+ * Doxygen generated documentation is much cleaner. Documentation about
+ configuration file formats is now provided.
+
+ * The build directory for Portage format repositories is now configurable
+ using a parameter named 'buildroot'.
+
+ * --pretend --install now displays detailed counts ('1 upgrade, 3 new')
+ rather than just a raw number. USE_EXPAND flags are displayed in a much
+ more useful manner.
+
+ * As part of the test suite, various full installs of test packages are
+ now performed.
+
+ * Multiple eclass directories and multiple profile directories can now
+ be specified for Portage format repositories. The 'eclassdir' and
+ 'profiledir' keys are now deprecated in favour of 'eclassdirs' and
+ 'profiledirs'.
+
+ * New commandline options: --list-vulnerabilities, mostly for use by
+ tree maintainers; --dl-no-unnecessary-upgrades, for avoiding upgrades of
+ dependencies; --environment-variable which can be used to print
+ the value of an environment variable for an installed or uninstalled
+ package; similarly, --configuration-variable can be used to get a repository
+ configuration variable; --info, as per portage.
+
+ * A new repository format named "nothing" is available. It does not
+ contain any packages, but supports a sync parameter to make automatically
+ syncing other directories simpler.
+
+ * Fetching is now handled via wrapper scripts. Support for file:/// URLs
+ has been added.
+
+ * If the user mirrors.conf file contains an entry with a mirror named '*',
+ first try fetching everything from that location.
+
+ * A warning is now emitted when dropping circular dependencies.
+
+ * The merge / unmerge code is now written in C++ rather than bash, and the
+ MD5 implementation is now internal rather than relying upon 'md5sum', which
+ works around problems when upgrading libc. When upgrading and downgrading,
+ sh breakages due to library version changes are less likely to be a problem.
+
+ * xterm titles are now updated for syncing, similar to previous behaviour
+ for installing.
+
+ * Syncing via Subversion over HTTP (svn+http://) has been enabled.
+
+ * Improved Portage compatibility: .tar.Z files are now unpacked correctly;
+ the 'date' command in ebuild global scope now works with a warning, rather
+ than being a hard failure; use of * with operators other than equals in dep
+ atoms is now a QA warning rather than a fatal error; PVR and AA are
+ supported, and A and AA do not include extra whitespace; dosym now calls
+ dodir as necessary as per Portage 2.1; elog is available.
+
+ * Some log messages include program context, to make finding the cause
+ of the problem simpler.
+
+ * The repository whence a package originates is saved in VDB. Portage
+ compatible environment saving is now used. VDB_FORMAT is now "paludis-2".
+
+ * SELinux is supported.
+
+ * Backtraces are now displayed from 'die'.
+
+ * World file updates are now carried out for packages that are unrestricted
+ except where --preserve-world is specified, regardless of whether the
+ package was previously installed. World updates are carried out after
+ packages are installed rather than before.
+
+ * Dependency errors due to [use] requirements now have more friendly error
+ messages.
+
+0.2.5:
+ * Syncing via Git is possible (git://, git+http://, git+ssh://).
+
+ * A new mirrors.conf configuration file can be used by the user to specify
+ favourite mirrors. It has the same format as thirdpartymirrors from the
+ repository.
+
+ * Error condition handling is improved in many places.
+
+ * Versions can now include -try.
+
+ * Initial work towards FreeBSD support has been started.
+
+0.2.4:
+ * An ebuild metadata generation bug has been fixed.
+
+ * For Portage format repositories, the location of security advisories is
+ now a configuration option.
+
+0.2.3:
+ * Added support for repository-level global and per-package USE forcing.
+
+ * Added --repository, --category, and --package filter options for --list
+ actions.
+
+ * Added an eselect-based newsreader. Paludis now provides a reference
+ implementation of GLEP 42.
+
+ * Various bugfixes -- reinstalling glibc and coreutils should work now,
+ amongst others.
+
+0.2.2:
+ * Deplist tags are now used for all package sets.
+
+ * The --query output now includes a key explaining the mask symbols.
+
+ * News items can now be delivered via repositories (GLEP 42).
+
+ * Various sandbox issues have been fixed.
+
+ * Various bugfixes.
+
+0.2.1:
+ * Build issues caused by trying to invoke sandbox from inside sandbox have
+ been fixed.
+
+ * The value of EAPI is now shown in the --install mask reasons.
+
+ * User and repository defined package sets are supported.
+
+ * The hook script interface has been enhanced. A hook script for logging
+ important actions to paludis.log is included.
+
+ * The --best-version output no longer includes the ::repository suffix.
+
+ * VDB reading is more tolerant of missing and malformed files.
+
+ * Using --query on a package set produces a better error.
+
+ * Ebuilds using fetch restrict will now have pkg_nofetch called where
+ appropriate.
+
+0.2.0:
+ Initial public release.
+
+.. vim: set tw=80 spell spelllang=en :
diff --git a/0.4.0/README b/0.4.0/README
new file mode 100644
index 000000000..740368de1
--- /dev/null
+++ b/0.4.0/README
@@ -0,0 +1,18 @@
+README for Paludis
+==================
+
+Paludis is in the really early prototype not intended for real use stage. If you
+aren't comfortable with C++, ebuild internals and Gentoo in general then you
+shouldn't be touching it.
+
+Developer documentation is available via 'make doxygen' (you need Doxygen
+installed, and having GraphViz will help too). It will be created under
+'doc/html/'. User documentation is kept in the bottom of a locked filing cabinet
+stuck in a disused lavatory with a sign on the door saying 'Beware of the
+Leopard'.
+
+If you don't feel like building your own docs, see:
+
+ http://paludis.berlios.de/
+
+.. vim: set spell spelllang=en tw=80 : ..
diff --git a/0.4.0/autogen.bash b/0.4.0/autogen.bash
new file mode 100755
index 000000000..22ed878ca
--- /dev/null
+++ b/0.4.0/autogen.bash
@@ -0,0 +1,44 @@
+#!/usr/bin/env bash
+# vim: set sw=4 sts=4 et tw=80 :
+
+if test "xyes" = x"${BASH_VERSION}" ; then
+ echo "This is not bash!"
+ exit 127
+fi
+
+trap 'echo "exiting." ; exit 250' 15
+KILL_PID=$$
+
+run() {
+ echo ">>> $@" 1>&2
+ if ! $@ ; then
+ echo "oops!" 1>&2
+ exit 127
+ fi
+}
+
+get() {
+ type ${1}-${2} &>/dev/null && echo ${1}-${2} && return
+ type ${1}${2//.} &>/dev/null && echo ${1}${2//.} && return
+ type ${1} &>/dev/null && echo ${1} && return
+ echo "Could not find ${1} ${2}" 1>&2
+ kill $KILL_PID
+}
+
+misc/do_m4.bash paludis/Makefile.am || exit $?
+misc/do_m4.bash paludis/paludis.hh || exit $?
+misc/do_m4.bash paludis/qa/Makefile.am || exit $?
+misc/do_m4.bash paludis/qa/qa.hh || exit $?
+misc/do_m4.bash paludis/util/util.hh || exit $?
+misc/do_m4.bash paludis/util/Makefile.am || exit $?
+misc/do_m4.bash paludis/util/smart_record.hh || exit $?
+misc/do_m4.bash paludis/util/comparison_policy.hh || exit $?
+misc/do_m4.bash hooks/Makefile.am || exit $?
+run mkdir -p config
+run $(get libtoolize 1.5 ) --copy --force --automake
+rm -f config.cache
+run $(get aclocal 1.9 )
+run $(get autoheader 2.59 )
+run $(get autoconf 2.59 )
+run $(get automake 1.9 ) -a --copy
+
diff --git a/0.4.0/configure.ac b/0.4.0/configure.ac
new file mode 100644
index 000000000..48ef8b2fd
--- /dev/null
+++ b/0.4.0/configure.ac
@@ -0,0 +1,463 @@
+dnl vim: set sw=4 sts=4 ts=4 noet ft=config foldmethod=marker foldmarker={{{,}}} :
+
+dnl {{{ program, version
+AC_PREREQ(2.59)
+AC_INIT([paludis/paludis.hh])
+AC_CONFIG_AUX_DIR(config)
+
+VERSION_MAJOR=0
+VERSION_MINOR=4
+VERSION_MICRO=0
+VERSION_FULL="$VERSION_MAJOR.$VERSION_MINOR.$VERSION_MICRO"
+VERSION="$VERSION_FULL"
+
+AC_SUBST([VERSION_MAJOR])
+AC_SUBST([VERSION_MINOR])
+AC_SUBST([VERSION_MICRO])
+AC_SUBST([VERSION_FULL])
+
+AM_INIT_AUTOMAKE(paludis, [$VERSION_FULL])
+dnl }}}
+
+dnl {{{ basic toolchain checks
+AC_LANG([C++])
+AC_PROG_CXX
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_RANLIB
+AC_PROG_MAKE_SET
+dnl }}}
+
+dnl {{{ check for partial specialisation of template classes
+AC_MSG_CHECKING([for compiler support for partial specialisation of template classes])
+AC_COMPILE_IFELSE([
+template <typename T_>
+struct S
+{
+ static const int s = 0;
+};
+
+template <typename T_>
+struct S<const T_>
+{
+};
+
+template <typename T_>
+struct S<const T_ &>
+{
+ static const int t = 0;
+};
+
+int main(int, char *[])
+{
+ return S<int &>::s + S<const int &>::t;
+}
+],
+ [AC_MSG_RESULT([yes])],
+ [
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([Your C++ compiler doesn't compile C++ code])
+ ])
+dnl }}}
+
+dnl {{{ check for basic_string and string::find_last_not_of
+AC_MSG_CHECKING([for a sufficiently standard std::basic_string<>])
+AC_COMPILE_IFELSE([
+#include <string>
+int main(int, char **)
+{
+ std::string s("test");
+ std::basic_string<int> t;
+ return std::string::npos != s.find_last_not_of("abcde") ? 0 : 1;
+}
+],
+ [AC_MSG_RESULT([yes])],
+ [
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([I need a less broken std::basic_string<> implementation])
+ ])
+dnl }}}
+
+dnl {{{ check for limits
+AC_MSG_CHECKING([for a usable std::numeric_limits])
+AC_COMPILE_IFELSE([
+#include <limits>
+int main(int, char **)
+{
+ return std::numeric_limits<unsigned>::digits >> 3;
+}
+],
+ [AC_MSG_RESULT([yes])],
+ [
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([Your std::numeric_limits either doesn't exist or hates me])
+ ])
+dnl }}}
+
+dnl {{{ check for broken std::set<>::const_reverse_iterator
+AC_MSG_CHECKING([for a usable std::set<>::const_reverse_iterator])
+AC_COMPILE_IFELSE([
+#include <set>
+int main(int, char **)
+{
+ std::set<int> s;
+ s.insert(1);
+ std::set<int>::const_reverse_iterator i;
+ return *i;
+}
+],
+ [AC_MSG_RESULT([yes])],
+ [
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([Your std::set<>::const_reverse_iterator is h0rked])
+ ])
+dnl }}}
+
+dnl {{{ check for broken std::deque<NoDefaultConstructor>
+AC_MSG_CHECKING([for a usable std::deque<NoDefaultConstructor>])
+AC_COMPILE_IFELSE([
+#include <deque>
+struct NoDefaultConstructor
+{
+ NoDefaultConstructor(int);
+};
+int main(int, char **)
+{
+ std::deque<NoDefaultConstructor> d, e;
+ d = e;
+}
+],
+ [AC_MSG_RESULT([yes])],
+ [
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([Your std::deque doesn't work])
+ ])
+dnl }}}
+
+dnl {{{ check for hashes
+have_tr1_hashes=0
+have_ext_hashes=0
+have_std_hashes=0
+AC_MSG_CHECKING([for hashed associative containers])
+AC_COMPILE_IFELSE([
+#include <tr1/unordered_map>
+int main(int, char **)
+{
+ std::tr1::unordered_map<int, int> m;
+ m.insert(std::make_pair(1, 2));
+}
+],
+ [
+ AC_MSG_RESULT([std::tr1::unordered_map])
+ have_tr1_hashes=1
+ ],
+ [
+ AC_COMPILE_IFELSE([
+#include <ext/hash_map>
+int main(int, char **)
+{
+ __gnu_cxx::hash_map<int, int> m;
+ m.insert(std::make_pair(1, 2));
+}
+],
+ [
+ AC_MSG_RESULT([__gnu_cxx::hash_map])
+ have_ext_hashes=1
+ ],
+ [
+ AC_COMPILE_IFELSE([
+#include <hash_map>
+int main(int, char **)
+{
+ std::hash_map<int, int> m;
+ m.insert(std::make_pair(1, 2));
+}
+],
+ [
+ AC_MSG_RESULT([std::hash_map])
+ have_std_hashes=1
+ ],
+ [
+ AC_MSG_RESULT([no, falling back to std::map (slower)])
+ ])])])
+
+HAVE_TR1_HASHES=$have_tr1_hashes
+AC_DEFINE_UNQUOTED([HAVE_TR1_HASHES], $have_tr1_hashes, [Do we have std::tr1:: hashes?])
+AC_SUBST([HAVE_TR1_HASHES])
+HAVE_EXT_HASHES=$have_ext_hashes
+AC_DEFINE_UNQUOTED([HAVE_EXT_HASHES], $have_ext_hashes, [Do we have __gnu_cxx:: hashes?])
+AC_SUBST([HAVE_EXT_HASHES])
+HAVE_STD_HASHES=$have_std_hashes
+AC_DEFINE_UNQUOTED([HAVE_STD_HASHES], $have_std_hashes, [Do we have std:: hashes?])
+AC_SUBST([HAVE_STD_HASHES])
+dnl }}}
+
+dnl {{{ we need libebt.
+dnl don't use AC_CHECK_HEADER, it does silly things
+AC_MSG_CHECKING([for libebt])
+AC_COMPILE_IFELSE([
+#include <libebt/libebt.hh>
+#include <string>
+struct Tag { };
+int main(int, char **)
+{
+ libebt::BacktraceContext<Tag> context("blah");
+}
+],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+ AC_MSG_ERROR([libebt (http://libebt.berlios.de/) is required])])
+dnl }}}
+
+dnl {{{ check for various misc functions.
+dnl It's probably possible to make many of these optional rather than
+dnl hard requirements. If any of these fail for you, send patches.
+AC_CHECK_FUNCS([alarm], [], [AC_MSG_ERROR([I need alarm])])
+AC_CHECK_FUNCS([strerror], [], [AC_MSG_ERROR([I need strerror])])
+AC_CHECK_FUNCS([signal], [], [AC_MSG_ERROR([I need signal])])
+AC_CHECK_FUNCS([popen], [], [AC_MSG_ERROR([I need popen])])
+dnl }}}
+
+dnl {{{ check for cxxflags
+AC_MSG_CHECKING([whether our compiler is iccy])
+AC_COMPILE_IFELSE([
+#ifndef __ICC
+#error nope
+#endif
+],
+ [cxx_compiler_icc=yes],
+ [cxx_compiler_icc=no])
+AC_MSG_RESULT([${cxx_compiler_icc}])
+
+AC_DEFUN([CHECK_CXXFLAG], [
+ save_CXXFLAGS=$CXXFLAGS
+ CXXFLAGS="$CXXFLAGS $1 -Werror"
+ AC_COMPILE_IFELSE([
+#include <string>
+#include <iostream>
+int main(int, char **)
+{
+ std::string s("test");
+ std::cout << s << std::endl;
+}
+ ],
+ [cxxflag_success=yes],
+ [cxxflag_success=no])
+ CXXFLAGS="$save_CXXFLAGS"
+ if test "x$cxxflag_success" = "xyes" ; then
+ CXXFLAGS="$CXXFLAGS $1"
+ cxxflags_message="${cxxflags_message} $1"
+ fi
+ ])
+
+AC_MSG_CHECKING([for appropriate compiler flags])
+if test "x${cxx_compiler_icc}" = "xyes" ; then
+ CHECK_CXXFLAG([-Wall])
+ CHECK_CXXFLAG([-wd279])
+ CHECK_CXXFLAG([-wd304])
+ CHECK_CXXFLAG([-wd383])
+ CHECK_CXXFLAG([-wd444])
+ CHECK_CXXFLAG([-wd488])
+ CHECK_CXXFLAG([-wd981])
+ CHECK_CXXFLAG([-wd1125])
+ CHECK_CXXFLAG([-wd1418])
+elif test "x${ac_cv_cxx_compiler_gnu}" = "xyes" ; then
+ CHECK_CXXFLAG([-Wall])
+ CHECK_CXXFLAG([-Wextra])
+ if ! test "x$cxxflag_success" = "xyes" ; then
+ CHECK_CXXFLAG([-W])
+ fi
+ CHECK_CXXFLAG([-Wold-style-cast])
+ CHECK_CXXFLAG([-Wredundant-decls])
+ CHECK_CXXFLAG([-Wstrict-null-sentinel])
+ CHECK_CXXFLAG([-Wmissing-noreturn])
+ CHECK_CXXFLAG([-Woverloaded-virtual])
+ CHECK_CXXFLAG([-pedantic])
+else
+ CHECK_CXXFLAG([-Wall])
+fi
+AC_MSG_RESULT([${cxxflags_message}])
+dnl }}}
+
+dnl {{{ sandbox
+AC_MSG_CHECKING([whether to enable sandbox])
+AC_ARG_ENABLE([sandbox],
+ [ --enable-sandbox Enable sandbox],
+ [HAVE_SANDBOX=$enableval
+ AC_MSG_RESULT([$enableval])],
+ [AC_MSG_RESULT([autodetect])
+ AC_CHECK_PROG(HAVE_SANDBOX, [sandbox], [yes], [no])])
+AC_SUBST([HAVE_SANDBOX])
+AM_CONDITIONAL([HAVE_SANDBOX], test "x$HAVE_SANDBOX" = "xyes")
+if test x"$HAVE_SANDBOX" = "xyes" ; then
+ AC_DEFINE([HAVE_SANDBOX], 1, [Do we have sandbox?])
+else
+ AC_DEFINE([HAVE_SANDBOX], 0)
+fi
+dnl }}}
+
+dnl {{{ doxygen, dot
+AC_MSG_CHECKING([whether to enable doxygen])
+AC_ARG_ENABLE([doxygen],
+ [ --enable-doxygen Enable 'make doxygen' (developer docs)],
+ [HAVE_DOXYGEN=$enableval
+ AC_MSG_RESULT([$enableval])],
+ [AC_MSG_RESULT([autodetect])
+ AC_CHECK_PROG(HAVE_DOXYGEN, [doxygen], [yes], [no])])
+AC_SUBST([HAVE_DOXYGEN])
+AM_CONDITIONAL([HAVE_DOXYGEN], test "x$HAVE_DOXYGEN" = "xyes")
+
+AC_MSG_CHECKING([whether to enable dot])
+AC_ARG_ENABLE([dot],
+ [ --enable-dot Enable 'HAVE_DOT' in doxygen.conf],
+ [HAVE_DOT=$enableval
+ AC_MSG_RESULT([$enableval])],
+ [AC_MSG_RESULT([autodetect])
+ AC_CHECK_PROG(HAVE_DOT, [dot], [yes], [no])])
+AC_SUBST([HAVE_DOT])
+AM_CONDITIONAL([HAVE_DOT], test "x$HAVE_DOT" = "xyes")
+dnl }}}
+
+dnl {{{ check for whether to build qa stuff
+dnl AC_MSG_CHECKING([whether to build QA tools])
+dnl AC_ARG_ENABLE([qa],
+dnl [ --enable-qa Build QA tool (qualudis) and library],
+dnl [ENABLE_QA=$enableval
+dnl AC_MSG_RESULT([$enableval])],
+dnl [ENABLE_QA=no
+dnl AC_MSG_RESULT([no])])
+ENABLE_QA=no
+AC_SUBST([ENABLE_QA])
+AM_CONDITIONAL([ENABLE_QA], test "x$ENABLE_QA" = "xyes")
+dnl }}}
+
+dnl {{{ colourschemes
+AC_MSG_CHECKING([whether we like pink])
+AC_ARG_ENABLE([pink],
+ [ --enable-pink Make it pink],
+ [WANT_PINK=$enableval
+ AC_MSG_RESULT([$enableval])
+ if test x$enableval = xyes ; then
+ COLOURSCHEME=pink
+ else
+ COLOURSCHEME=default
+ fi
+ ],
+ [WANT_PINK=no
+ AC_MSG_RESULT([no :(])
+ COLOURSCHEME=default])
+AM_CONDITIONAL([WANT_PINK], test "x$WANT_PINK" = "xyes")
+AC_SUBST([COLOURSCHEME])
+if test x"$WANT_PINK" = "xyes"; then
+ AC_DEFINE([PALUDIS_COLOUR_PINK], 1, [Are we pinkified?])
+else
+ AC_DEFINE([PALUDIS_COLOUR_PINK], 0)
+fi
+dnl }}}
+
+dnl {{{ Check for dlopen symbol and set DYNAMIC_LD_LIBS.
+dnl
+dnl AM_DL()
+dnl
+
+AC_CHECK_LIB(c, dlopen,
+[DYNAMIC_LD_LIBS=""
+have_dl=yes])
+
+if test x$have_dl != "xyes"; then
+AC_CHECK_LIB(dl, dlopen,
+ [DYNAMIC_LD_LIBS="-ldl"
+ have_dl=yes])
+fi
+
+if test x$have_dl != "xyes"; then
+AC_MSG_ERROR(dynamic linker needed)
+fi
+
+AC_SUBST(DYNAMIC_LD_LIBS)
+
+dnl }}}
+
+dnl {{{ selinux support
+AC_MSG_CHECKING([whether to enable selinux support])
+AC_ARG_ENABLE([selinux],
+ AS_HELP_STRING([--enable-selinux], [Enable selinux support (default: check)]),
+ enable_selinux=$enableval,
+ enable_selinux=autodetect)
+AC_MSG_RESULT($enable_selinux)
+
+if test "x$enable_selinux" != "xno"; then
+ AC_CHECK_LIB([selinux],
+ [is_selinux_enabled],
+ found_selinux=yes,
+ found_selinux=no)
+ if test "x$enable_selinux" = "xyes" && test "x$found_selinux" != "xyes"; then
+ AC_MSG_ERROR([SElinux support requested but not found])
+ fi
+fi
+
+if test "x$found_selinux" = "xyes"; then
+ AC_DEFINE([HAVE_SELINUX], [1], [Build selinux support])
+fi
+dnl }}}
+
+dnl {{{ is sed gnu sed
+AC_MSG_CHECKING([if we need a sed wrapper])
+AC_SUBST([NEED_SED_WRAPPER])
+AM_CONDITIONAL([NEED_SED_WRAPPER], test x`sed --version &>/dev/null || echo yes` = "xyes")
+if test x`sed --version &>/dev/null || echo yes` = "xyes"; then
+ AC_DEFINE([NEED_SED_WRAPPER], 1, [Do we need sed wrapper?])
+ AC_MSG_RESULT([yes])
+else
+ AC_DEFINE([NEED_SED_WRAPPER], 0)
+ AC_MSG_RESULT([no])
+fi
+dnl }}}
+
+dnl {{{ built sources
+GENERATED_FILE=misc/generated-file.txt
+AC_SUBST_FILE(GENERATED_FILE)
+
+BUILDUSER=`whoami`
+AC_SUBST([BUILDUSER])
+BUILDHOST=`hostname`
+AC_SUBST([BUILDHOST])
+BUILDDATE=`date +%Y-%m-%dT%H:%M:%S%z`
+AC_SUBST([BUILDDATE])
+if test -d "${ac_top_srcdir:-./}/.svn" ; then
+ SVNVERSION=`svnversion "${ac_top_srcdir:-./}"`
+else
+ SVNVERSION=
+fi
+AC_SUBST([SVNVERSION])
+dnl }}}
+
+dnl {{{ output
+AM_CONFIG_HEADER(config.h)
+AC_OUTPUT(
+ Makefile
+ doc/Makefile
+ doc/doxygen.conf
+ ebuild/Makefile
+ ebuild/digests/Makefile
+ ebuild/fetchers/Makefile
+ ebuild/utils/Makefile
+ ebuild/echo_functions.bash
+ eselect/Makefile
+ hooks/Makefile
+ misc/Makefile
+ misc/svn-version-filter-data.bash
+ paludis/Makefile
+ paludis/about.hh
+ paludis/args/Makefile
+ paludis/digests/Makefile
+ paludis/hashed_containers.hh
+ paludis/qa/Makefile
+ paludis/util/Makefile
+ paludis/selinux/Makefile
+ src/Makefile
+ src/qualudis/Makefile
+ test/Makefile
+ )
+dnl }}}
+
diff --git a/0.4.0/doc/Makefile.am b/0.4.0/doc/Makefile.am
new file mode 100644
index 000000000..a5a8b1e98
--- /dev/null
+++ b/0.4.0/doc/Makefile.am
@@ -0,0 +1,49 @@
+CLEANFILES = *~ html/* html
+MAINTAINERCLEANFILES = Makefile.in
+
+docfiles = \
+ doc_main.doxygen \
+ doc_mainpage.doxygen \
+ doc_coding_standards.doxygen \
+ doc_namespaces.doxygen \
+ doc_directories.doxygen \
+ doc_references.doxygen \
+ doc_licence.doxygen \
+ doc_authors.doxygen \
+ doc_bootstrap_howto.doxygen \
+ doc_changelog.doxygen \
+ doc_portage_differences.doxygen \
+ doc_news.doxygen \
+ doc_security_advisories.doxygen \
+ doc_configuration_files.doxygen
+
+EXTRA_DIST = doxygen.conf.in header.html footer.html paludis.css $(docfiles)
+
+if HAVE_DOXYGEN
+
+doxygen : doxygen.conf $(top_srcdir)/paludis/*.cc $(top_srcdir)/paludis/*.hh \
+ $(docfiles)
+ doxygen doxygen.conf
+
+else
+
+doxygen :
+ @echo "You don't have doxygen installed!"
+ exit 1
+
+endif
+
+clean-local :
+ mkdir -p html
+ touch html/dummy
+ find html/ -type f | grep -v '\.svn' | xargs rm
+
+maintainer-clean-local :
+ mkdir -p html
+ touch html/dummy
+ find html/ -type f | grep -v '\.svn' | xargs rm
+
+upload-homepage : doxygen
+ cd `readlink -f $(top_srcdir)/doc/html` && tar jc ./ | \
+ ssh shell.berlios.de tar vjx -C /home/groups/paludis/htdocs/
+
diff --git a/0.4.0/doc/doc_authors.doxygen b/0.4.0/doc/doc_authors.doxygen
new file mode 100644
index 000000000..8d9d855de
--- /dev/null
+++ b/0.4.0/doc/doc_authors.doxygen
@@ -0,0 +1,9 @@
+/* vim: set ft=cpp tw=80 sw=4 et : */
+
+/**
+\page Authors Authors
+
+\verbinclude AUTHORS
+
+*/
+
diff --git a/0.4.0/doc/doc_bootstrap_howto.doxygen b/0.4.0/doc/doc_bootstrap_howto.doxygen
new file mode 100644
index 000000000..bb386cae2
--- /dev/null
+++ b/0.4.0/doc/doc_bootstrap_howto.doxygen
@@ -0,0 +1,317 @@
+/* vim: set ft=cpp tw=80 sw=4 et : */
+
+/**
+\page BootstrapHowto Bootstrap Howto
+
+\section BootstrapHowtoMain How to make a Paludis chroot
+
+<b>THIS WILL PROBABLY NOT ACTUALLY WORK!</b> Paludis is at the very
+early alpha stage. It can sometimes install things, if you're very lucky, and
+if you're really lucky it might let you upgrade or uninstall them too. There are
+zillions of things that are not implemented. There are zillions of things that
+Paludis does differently from Portage -- some of these are intentional, some are
+not.
+
+<b>You may encounter problems!</b> Paludis is still undergoing heavy development,
+and although it's getting to be fairly reliable, there are still issues. Most
+ebuild authors don't test their code with both package managers.
+
+You should join the <code>\#paludis</code> channel on Freenode. If you're doing
+anything development-related, you should probably also ask to be allowed to
+subscribe to the <code>paludis-sekrit</code> mailing list.
+
+\warning Do not try to use Paludis and Portage to install things inside the same
+ root. The config and vdb formats are not compatible!
+
+\warning Do not file bugs related to Paludis on Gentoo Bugzilla. Do not discuss
+ Paludis on Gentoo mailing lists or forums. Do not pester Gentoo developers
+ about Paludis.
+
+\section BootstrapHowtoRequirements Requirements
+
+Install Paludis locally, being sure to configure <code>sysconfdir</code> as
+<code>/etc</code> to avoid confusion later on. There're ebuilds in the tree, or in
+<a href="http://svn.berlios.de/viewcvs/paludis/overlay/sys-apps/paludis/">
+the Paludis overlay</a> if you need SVN ebuilds.
+
+You'll need libebt, eselect and Subversion. You'll also need either g++-3.4,
+g++-4.1 or some other reasonably standard C++ compiler along with a complete
+standard library implementation (so no uClibc++). If you're trying to run on
+non-Linux, you'll also need to fix a few includes and submit a patch.
+
+Make sure the test suite passes (either <code>FEATURES="test"</code> for
+Portage, or <code>make check</code>). If it fails, don't continue until you
+figure out why.
+
+\section BootstrapConfiguration Configuration
+
+Set up a local bootstrap config directory. We're assuming in this document that
+you're using <code>/mychroot</code> as the root path, but anywhere not on a
+noexec / nodev filesystem should work. The reason for doing things this way will
+become apparent later on.
+
+\verbatim
+mkdir ~/.paludis-bootstrap
+cat <<"END" > ~/.paludis-bootstrap/specpath
+root = /mychroot
+config-suffix =
+END
+\endverbatim
+
+Make some skeleton directories and files:
+
+\verbatim
+mkdir -p /mychroot/etc/{env.d,paludis/repositories}
+mkdir -p /mychroot/var/{db/pkg,paludis/repositories/gentoo/distfiles}
+mkdir -p /mychroot/tmp/
+touch /mychroot/etc/ld.so.conf
+\endverbatim
+
+Set up your <code>keywords.conf</code>. At the very least, you'll need a <code>*
+keywords</code> line. Further lines can be added in the form "atom keywords".
+Like with Portage, accepting <code>~keyword</code> does <b>not</b> accept
+<code>keyword</code>, so if you want a fully <code>~arch</code> system you
+should use <code>* arch ~arch</code>.
+
+\verbatim
+cat <<"END" > /mychroot/etc/paludis/keywords.conf
+* x86
+dev-cpp/libebt x86 ~x86
+sys-apps/paludis x86 ~x86
+dev-util/subversion x86 ~x86
+app-admin/eselect x86 ~x86
+app-editors/vim x86 ~x86
+app-editors/vim-core x86 ~x86
+END
+\endverbatim
+
+Set up your <code>use.conf</code>. At the very least, you'll need a <code>*
+flags</code> line. Again, additional per-atom lines can be specified. The
+<code>-apache2</code> is important, if you value your sanity, since you'll be
+installing subversion. We're experimenting with a slightly different way of
+handling <code>USE_EXPAND</code> variables that allows different settings for
+different packages. This may change, but for now it looks like this:
+
+\verbatim
+cat <<"END" > /mychroot/etc/paludis/use.conf
+* -doc nls -apache2 LINGUAS: en INPUT_DEVICES: keyboard mouse VIDEO_CARDS: ati
+app-editors/vim -nls
+END
+\endverbatim
+
+Set up your <code>licenses.conf</code>. If you don't care about licences, which
+is probably wise until we get licence grouping, it should look like this:
+
+\verbatim
+cat <<"END" > /mychroot/etc/paludis/licenses.conf
+* *
+END
+\endverbatim
+
+If you want some more fun, the following list might be enough to install a
+base system if you don't turn on too many extra USE flags:
+
+\verbatim
+cat <<"END" > /mychroot/etc/paludis/licenses.conf
+# These are the basic system requirements. It's possible to knock off
+# a few of these by turning off some default USE flags.
+* LGPL-2.1 LGPL-2 GPL-2 BSD MIT BZIP2 Artistic DB PSF-2.1.1 PSF-2.2
+* as-is tcp_wrappers_license freedist ZLIB openssl CRACKLIB PAM FLEX
+
+# These are needed to get Subversion.
+* Apache-1.1 Apache-2.0
+
+# These are needed to get an editor that doesn't suck.
+* vim
+
+# These are needed if you want modular X. This is utterly ridiculous,
+# and the people responsible for using different licence IDs for
+# identical licences should be shot.
+* xorg-server libXfont xtrans util-macros libfontenc xproto fontsproto
+* FTL fontcacheproto libXau libXext libX11 libXdmcp kbproto inputproto
+* xf86bigfontproto bigreqsproto xextproto xcmiscproto libxkbfile libXmu
+* libXt libSM libICE libXrender renderproto libXi libXxf86vm
+* xf86vidmodeproto libdrm MOTIF libXaw libXpm libXp printproto xbitmaps
+* makedepend xf86driproto glproto font-adobe-75dpi bdftopcf font-util
+* encodings mkfontscale mkfontdir font-misc-misc font-cursor-misc
+* xkbcomp iceauth rgb xauth xinit twm xclock libXft fontconfig xrdb X11
+* libXxf86misc xf86miscproto libdmx dmxproto libXtst recordproto libXres
+* resourceproto libxkbui liblbxutil randrproto fixesproto damageproto
+* xf86dgaproto xf86rushproto compositeproto videoproto scrnsaverproto
+* evieext trapproto xineramaproto glut setxkbmap xhost xmodmap xrandr
+* libXrandr libXcomposite libXfixes libXcursor libXdamage libXv
+* libXxf86dga libXinerama libXScrnSaver BitstreamVera font-bh-type1
+* font-adobe-utopia-type1 font-adobe-100dpi xorg-docs
+* xf86-input-keyboard xf86-input-mouse xf86-video-ati font-alias
+END
+\endverbatim
+
+Set up your <code>package_unmask.conf</code> and <code>package_mask.conf</code>,
+if necessary:
+
+\verbatim
+cat <<"END" > /mychroot/etc/paludis/package_unmask.conf
+app-editors/vim
+app-editors/vim-core
+END
+\endverbatim
+
+Set up your <code>mirrors.conf</code>, if you feel like it (note that 0.2.5 or
+later is required, or this file is ignored). It uses the same format as
+<code>thirdpartymirrors</code>. Remember to include the <code>/distfiles</code>
+for Gentoo mirrors.
+
+\verbatim
+cat <<"END" > /mychroot/etc/paludis/mirrors.conf
+gentoo http://gentoo.blueyonder.co.uk/distfiles/
+gnu http://gnu.blueyonder.co.uk/
+debian http://debian.blueyonder.co.uk/
+END
+\endverbatim
+
+Set up your <code>bashrc</code>. This must <b>NOT</b> be used to change any
+values that affect dependency resolution (e.g. <code>USE</code>,
+<code>LINGUAS</code>). It can be used to set <code>CFLAGS</code>,
+<code>CHOST</code> and the like (on some archs you'll have to do this to
+avoid getting junk from your profile). Remember to <code>export</code> your
+variables.
+
+Unfortunately, some packages in system have broken test suites, and some
+packages abuse non-${ROOT} locations in pkg_postinst. Thus, you will also
+need to add a bit of magic to work around these packages.
+
+\verbatim
+cat <<"END" > /mychroot/etc/paludis/bashrc
+export CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer"
+export CXXFLAGS="${CFLAGS}"
+export CHOST="i686-pc-linux-gnu"
+export MAKEOPTS="-j2"
+export EBEEP_IGNORE="yes"
+export EPAUSE_IGNORE="yes"
+
+case "${PN}" in
+
+ python|portage)
+ export SKIP_FUNCTIONS=test
+ export SANDBOX_PREDICT=/
+ ;;
+
+ automake|glibc|e2fsprogs|neon|gettext|tar)
+ export SKIP_FUNCTIONS=test
+ ;;
+
+esac
+
+END
+\endverbatim
+
+Set up your repository files. Do not tinker with the VDB location, it
+<b>must</b> go in <code>${ROOT}/var/db/pkg</code>. Here we'll avoid using
+<code>/usr/portage</code> for the main tree because sticking data that gets
+changed on <code>/usr</code> is silly. We use the <code>${ROOT}</code> variable,
+which is set magically, to make the config work both in and outside of a
+chroot (this is one of the reasons we have the weird-looking specpath
+thing). The Paludis overlay is optional but recommended.
+
+\verbatim
+cat <<"END" > /mychroot/etc/paludis/repositories/gentoo.conf
+location = ${ROOT}/var/paludis/repositories/gentoo/
+sync = rsync://rsync.europe.gentoo.org/gentoo-portage/
+profiles = ${ROOT}/var/paludis/repositories/gentoo/profiles/default-linux/x86/2006.0
+format = portage
+END
+
+cat <<"END" > /mychroot/etc/paludis/repositories/installed.conf
+location = ${ROOT}/var/db/pkg/
+format = vdb
+END
+
+cat <<"END" > /mychroot/etc/paludis/repositories/paludis-overlay.conf
+location = ${ROOT}/var/paludis/repositories/paludis-overlay/
+sync = svn://svn.berlios.de/paludis/overlay
+profiles = ${ROOT}/var/paludis/repositories/gentoo/profiles/default-linux/x86/2006.0
+eclassdirs = ${ROOT}/var/paludis/repositories/gentoo/eclass
+distdir = ${ROOT}/var/paludis/repositories/gentoo/distfiles
+cache = /var/empty
+format = portage
+importance = 10
+END
+\endverbatim
+
+\section BootstrapHowtoSync Initial Sync
+
+Now check that the config looks ok, and sync:
+
+\verbatim
+paludis --config-suffix bootstrap --list-repositories
+sudo paludis --config-suffix bootstrap --sync
+\endverbatim
+
+If you have problems, try adding <code>--log-level debug</code>. This may or may
+not give helpful information... This applies at all stages.
+
+The initial sync will be slow. You can cheat and copy an existing Portage tree
+checkout into <code>/mychroot/var/paludis/repositories/gentoo/</code>, but
+remember to preserve mtimes and permissions if you do. Note that there's no
+hideously painful 'Updating the Portage cache...' to go through. Paludis will
+use the metadata cache, if available, but does not use the dep cache.
+
+\section BootstrapInstalling Installing Things
+
+Now install baselayout and then system. We install baselayout manually first
+because it's easier than creating a bunch of directories by hand.
+
+Note that there're a whole load of circular dependencies in system
+(ncurses <-> gpm, patch <-> patch, gcc <-> glibc for example), so you'll
+almost certainly need --dl-drop-circular at this stage.
+
+\verbatim
+paludis --config-suffix bootstrap --install --pretend --dl-drop-all sys-apps/baselayout
+sudo paludis --config-suffix bootstrap --install --dl-drop-all sys-apps/baselayout
+
+paludis --config-suffix bootstrap --install --pretend --dl-drop-circular system
+sudo paludis --config-suffix bootstrap --install --dl-drop-circular system
+\endverbatim
+
+Note that system will pull in Portage. That's a profiles thing that's
+unavoidable for now. It won't pull in Paludis, so we do that manually.
+
+\note It seems apr and apr-util are rather picky about compiling into ROOT
+unless an identical version is installed onto / .
+
+\verbatim
+paludis --config-suffix bootstrap --install --pretend sys-apps/paludis
+sudo paludis --config-suffix bootstrap --install sys-apps/paludis
+\endverbatim
+
+\section BootstrapHowtoChroot Chrooting
+
+And that should (but probably won't) give you a usable chroot:
+
+\verbatim
+sudo cp /etc/resolv.conf /mychroot/etc/
+sudo chroot /mychroot
+reset
+export HOME=/root
+cd
+cp /etc/skel/.bashrc .
+. .bashrc
+ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime
+mount -tproc none /proc
+mount -tsysfs none /sys
+udevstart
+mount -tdevpts none /dev/pts
+eselect env update
+source /etc/profile
+( . /etc/paludis/bashrc ; export REAL_CHOST=$CHOST ; gcc-config 1 )
+eselect env update
+source /etc/profile
+paludis --uninstall sys-apps/portage
+paludis --install app-editors/vim
+paludis --uninstall app-editors/nano
+\endverbatim
+
+You can also tar up the system and use it as a stage3 or NFS root image.
+
+*/
+
diff --git a/0.4.0/doc/doc_changelog.doxygen b/0.4.0/doc/doc_changelog.doxygen
new file mode 100644
index 000000000..7d387e23c
--- /dev/null
+++ b/0.4.0/doc/doc_changelog.doxygen
@@ -0,0 +1,10 @@
+/* vim: set ft=cpp tw=80 sw=4 et : */
+
+/**
+\page ChangeLog ChangeLog
+
+\verbinclude ChangeLog
+
+*/
+
+
diff --git a/0.4.0/doc/doc_coding_standards.doxygen b/0.4.0/doc/doc_coding_standards.doxygen
new file mode 100644
index 000000000..50030231c
--- /dev/null
+++ b/0.4.0/doc/doc_coding_standards.doxygen
@@ -0,0 +1,184 @@
+/* vim: set ft=cpp tw=80 sw=4 et : */
+
+/**
+\page CodingStandards Coding Standards
+
+These are rough guidelines. You should stick to these unless there's a good
+reason to do otherwise. There are lots more standards that aren't documented
+here yet -- ask for clarification as necessary.
+
+\section CodingStandardsCopyrights Copyrights and Licence
+
+Paludis is licenced under the GPLv2. Any contributions must use this licence.
+You should copy the standard licence header from another source file when
+creating new source files.
+
+Copyright is handled on a per-file basis. If you are the primary author of
+a file, you should list yourself as the copyright holder. If you make a
+substantial contribution to a source file (for example, one or more
+non-trivial classes, functions or methods), you should add yourself as a
+copyright holder on that file. You should <em>not</em> add to the copyright for
+small changes or bug fixes.
+
+Copyright years are per contributor. See, for example, paludis/fs_entry.hh for
+a file that has multiple copyright holders with different years.
+
+Substantial contributors should also list themselves in the AUTHORS file.
+
+\section CodingStandardsIndentingAndSpacing Indenting and Spacing
+
+Indents are four spaces. There are no tabs anywhere. Braces go on a line of
+their own, and may be omitted if the clarity of the code isn't affected. Make
+sure you don't include trailing whitespace.
+
+Function calls have no space before or after the parentheses. Most operators
+and built-in functions have spaces before the opening parenthesis but not
+inside. The ! operator has a space after it.
+
+For example::
+\code
+if (some_function("moo", 2))
+ do_stuff("moo");
+else
+{
+ // this needs some explanation
+ while (end != do_other_stuff(foo) || ! foo)
+ ++foo;
+}
+\endcode
+
+\section CodingStandardsSwitches Switches
+
+You'll sometimes see code like this:
+
+\code
+do
+{
+ switch (my_enum)
+ {
+ case e_one:
+ // ...
+ continue;
+
+ case e_two:
+ // ...
+ continue;
+ }
+
+ throw InternalError(PALUDIS_HERE, "Unexpected value for my_enum");
+} while (false);
+\endcode
+
+The reason for using this rather than a <code>default:</code> label is that the
+compiler will (or at least the compiler we use will) generate a warning if
+someone later goes and adds <code>e_three</code>, and we haven't updated our
+switch to recognise it.
+
+\section CodingStandardsComments Comments
+
+All public and protected interfaces and classes should be documented in the
+header files via Doxygen. Implementations should be documented appropriately --
+explain complicated or unobvious parts and anything that can easily be broken
+by other people. Don't bother with comments on obvious things.
+
+\section CodingStandardsNaming Naming
+
+Types are named in <code>MixedCaseNoUnderscores</code>.
+
+Variables and functions are named in <code>lower_case_with_underscores</code>.
+
+Private member variables that aren't going to end up being used anywhere
+external are <code>_prefixed_with_underscore</code>.
+
+Template values are <code>suffixed_with_underscore_</code>, and template
+typenames are <code>SuffixedAsWell_</code> (and use <code>typename</code> rather
+than <code>class</code>, \ref EffCpp item 42).
+
+The files for <code>SomeClass</code> (and any small related utilities) would be
+<code>some_class.hh</code> and <code>some_class.cc</code>. We are somewhat
+inconsistent when it comes to what warrants its own file -- originally it was
+pretty much one class per file, but then compiles started taking too long so
+it's now more like one class plus related utilities and exceptions per file.
+
+Macros are <code>PALUDIS_UPPER_CASE</code>, but they're evil (\ref TCppPL
+section 7.8, \ref EffCpp item 2) so don't use them.
+
+Very short names for loop indices and the like are fine, but prefer longer,
+self-documenting names for proper variables. For loop iterator pairs, the
+usual style is:
+
+\code
+for (MyType::Iterator i(my_container.begin()), i_end(my_container.end()) ;
+ i != i_end ; ++i)
+{
+ // ...
+}
+\endcode
+
+If there's a convenient standard library algorithm available, use that
+instead of a manual loop (\ref EffSTL item 43).
+
+\section CodingStandardsPointers Pointers and References
+
+Try to avoid returning raw pointer types from raw interfaces, especially if the
+programmer is expected to deallocate them manually. Make liberal use of
+<code>paludis::CountedPtr</code> instead -- it's low overhead and a lot less
+prone to subtle screwups. See \ref EffCpp item 18.
+
+Pass object parameters by const reference rather than pointer to const unless
+you're prepared to accept a zero pointer. Avoid pass by value except for small
+integral types. See \ref EffCpp item 20.
+
+\section CodingStandardsNamespaces Namespaces
+
+Everything under <code>paludis/</code> should be inside namespace
+<code>paludis</code>. Sometimes sub-namespaces are used where they look useful.
+
+\section CodingStandardsIncludeGuards Include Guards
+
+Include guards are <code>\#define PALUDIS_GUARD_FILE_NAME_HH 1</code>.
+
+\section CodingStandardsStandardLibrary Standard Library
+
+Never use <code>using namespace std</code>. It can bring arbitrary weirdness
+into the current namespace. It's ok to selectively introduce things from std
+where they're used a lot. See \ref TCppPL section 8.2.9.1.
+
+Make use of the standard library where suitable. It has fewer bugs than
+code you write yourself, and it may be doing clever optimisations behind
+the scenes.
+
+Remember the container member functions. Many containers have template
+constructors that take iterator pairs. Many containers have assign and
+swap methods. Use these over <code>std::copy</code>. See \ref EffSTL item
+25.
+
+Don't use <code>vector&lt;bool&gt;</code>. It's just not worth it. See
+\ref EffSTL item 18.
+
+Although some compilers will let you get away with <code>std::make_pair("foo",
+"bar")</code>, some won't. Strictly speaking this violates the standard.
+Use <code>std::make_pair(std::string("foo"), std::string("bar"))</code> instead.
+
+\section CodingStandardsCasts Casts
+
+<code>dynamic_cast</code> is banned. It's slow (\ref EffCpp item 27) and a sign
+that you should be using one of visitors (\ref GoF Visitor), multiple dispatch
+(\ref MCppD chapter 11) or capability queries via a <code>get_interface</code>
+type method (for example, as described in \ref GoF Composite -- Implementation
+item 4) instead.
+
+<code>reinterpret_cast</code> is probably banned as well, unless we end up
+having to talk to some weirdly broken C libraries.
+
+There are very few legitimate uses for <code>const_cast</code>. It
+<em>might</em> be ok to use it as described in \ref EffCpp item 3. It
+<em>might</em> be ok to use it to talk to C libraries.
+
+There's nothing wrong with making appropriate use of <code>static_cast</code>.
+
+Old C style <code>(Type) variable</code> casts are banned. Function style casts
+(that is, <code>Type(value)</code>) should only be used when calling an explicit
+constructor to pass an object to a function. See \ref EffCpp item 27.
+
+*/
diff --git a/0.4.0/doc/doc_configuration_files.doxygen b/0.4.0/doc/doc_configuration_files.doxygen
new file mode 100644
index 000000000..7031d4404
--- /dev/null
+++ b/0.4.0/doc/doc_configuration_files.doxygen
@@ -0,0 +1,214 @@
+/* vim: set ft=cpp tw=80 sw=4 et : */
+
+/**
+\page ConfigurationFiles Configuration Files
+
+\section ConfigurationFilesOverview Overview
+
+This document explains where Paludis looks for user configuration files, and
+describes the format of these files.
+
+\section ConfigurationFilesGeneralFormat General File Format
+
+Except where otherwise noted, configuration files are plain text files where
+blank lines and lines starting with optional whitespace followed by a hash
+symbol are ignored.
+
+Many files use a key = value format. Here, any whitespace around the outside
+of key and value is stripped. The value may be quoted using single or double
+quotes. Variable expansion on previously defined keys (and sometimes on
+predefined special values) may be done using <code>${variable}</code>. To
+include a literal dollar, use <code>\$</code>.
+
+\section ConfigurationFilesLocations Locations
+
+Paludis tries the following locations for its configuration directory:
+
+- <code>${PALUDIS_HOME}/.paludis/</code>, if the <code>PALUDIS_HOME</code>
+ environment variable is set, or <code>${HOME}/.paludis/</code> otherwise.
+- <code>SYSCONFDIR/paludis/</code>, where <code>SYSCONFDIR</code> is
+ <code>/etc</code> on most systems.
+
+If the <code>--config-suffix</code> commandline argument is supplied, Paludis
+will use <code>.paludis-thesuffix</code> or <code>paludis-thesuffix</code>
+instead.
+
+If a file named <code>specpath</code> exists in this directory, Paludis uses
+this file to determine the real configuration directory. The <code>specpath</code>
+file is a standard key / value configuration file (see above). The keys that
+are used are:
+
+- <code>root</code>, which specifies the install root for packages and the
+ real configuration directory, which is <code>${root}/SYSCONFDIR/paludis/</code>
+ (note that the HOME values are <em>not</em> used here). This value is set in
+ <code>specpath</code> rather than the real configuration directory so
+ that chrooting into an image can work with no configuration changes.
+- <code>config-suffix</code>, which specifies a new configuration suffix. By
+ default, no configuration suffix is used under root.
+
+If no <code>specpath</code> file is present, the original directory is used.
+
+\section ConfigurationFilesUseConf The use.conf File
+
+User <code>USE</code> preferences are controlled by the <code>use.conf</code>
+file. The basic format of a line is <code>atom use use use ...</code>, where
+<code>atom</code> is a package depend atom or <code>*</code> for "all packages",
+and <code>use use use ...</code> is one or more USE flag names, prefixed by
+a minus if they are to be disabled.
+
+For <code>USE_EXPAND</code> variables such as <code>LINGUAS</code> and
+<code>VIDEO_CARDS</code>, <code>atom VARIABLE: value value ...</code>
+should be used.
+
+\verbatim
+# By default, apply these to all packages
+* -doc nls -apache2
+
+# Turn off nls for vim
+app-editors/vim -nls
+
+# For gvim 7, turn on and off various interpreters
+>=app-editors/gvim-7_alpha mzscheme perl -python ruby
+
+# For gtk+ with SLOT=2, enable tiff support
+x11-libs/gtk+:2 tiff
+
+# We like English
+* LINGUAS: en_GB en
+\endverbatim
+
+Note that if a package matches multiple lines, <em>all</em> of these lines will
+be considered, not just the best or last match.
+
+\section ConfigurationFilesKeywordsConf The keywords.conf File
+
+Which <code>KEYWORDS</code> to accept is controlled through
+<code>keywords.conf</code>. The format of a line is
+<code>atom keyword ...</code>. As with Portage, accepting
+<code>~arch</code> does <em>not</em> implicitly accept <code>arch</code>.
+For example:
+
+\verbatim
+# We want a mostly stable system:
+* x86
+
+# But some ~arch packages:
+dev-cpp/libebt x86 ~x86
+sys-apps/paludis x86 ~x86
+dev-util/subversion x86 ~x86
+app-admin/eselect x86 ~x86
+app-editors/vim x86 ~x86
+app-editors/vim-core x86 ~x86
+\endverbatim
+
+Note that if a package matches multiple lines, <em>all</em> of these lines will
+be considered, not just the best or last match.
+
+\section ConfigurationFilesLicensesConf The licenses.conf File
+
+Licence filtering can be controlled via <code>licenses.conf</code>. If no
+filtering is desired, use:
+
+\verbatim
+* *
+\endverbatim
+
+For filtering, the format is similar to the keywords and use files:
+
+\verbatim
+* GPL-2 BSD
+app-editors/vim-core vim
+\endverbatim
+
+\section ConfigurationFilesMirrorsConf The mirrors.conf File
+
+Mirrors and downloading can be controlled via <code>mirrors.conf</code>. Each
+line takes the form <code>mirrorname http://mirror/blah/ http://another.mirror/</code>.
+A special mirror named <code>*</code>, if present, will be consulted <em>before</em>
+any other location for all files. For example:
+
+\verbatim
+* file:///mnt/nfs/distfiles
+gentoo http://gentoo.blueyonder.co.uk/distfiles
+\endverbatim
+
+\section ConfigurationFilesBashrc The bashrc File
+
+Paludis will source <code>bashrc</code> when doing ebuild work. This file
+can be used to set environment variables (<code>CHOST</code>, <code>CFLAGS</code>
+and so on), but <em>cannot</em> be used to change metadata-affecting variables
+such as <code>USE</code> or <code>LINGUAS</code>.
+
+\section ConfigurationFilesRepositories The repositories/ Files
+
+Each file named <code>*.conf</code> in the <code>repositories/</code> subdirectory
+creates a repository for Paludis. This is a key = value format file, and the special
+variable <code>${ROOT}</code> is defined based upon <code>specpath</code>. All
+files must define a <code>format =</code> key; depending upon the value used, other
+optional and mandatory keys are available.
+
+\subsection ConfigurationFilesRepositoriesPortage portage Format Repositories
+
+\note The name <code>portage</code> is used here to refer to repositories in the
+format used by the <code>gentoo-portage</code> (or <code>gentoo-x86</code>) tree.
+The name is far from ideal...
+
+The following keys are available for <code>format = portage</code>:
+
+- <code>location</code> (mandatory), which points to the location of the
+ tree.
+- <code>profiles</code> (mandatory), which should be a space separated list of
+ directories used for profile data. Later directories have priority.
+- <code>buildroot</code> (default: <code>/var/tmp/paludis</code>), which controls
+ the temporary directory used by Paludis for compiling software.
+- <code>cache</code> (default: <code>${location}/metadata/cache</code>), which
+ controls the location of the metadata cache for a repository. It should be set
+ to <code>/var/empty</code> if there is no metadata cache available.
+- <code>distdir</code> (default: <code>${location}/distfiles</code>), which
+ controls where downloaded files are saved.
+- <code>eclassdirs</code> (default: <code>${location}/eclass</code>), which
+ is a space separated list of locations of eclasses. The value of ECLASSDIR
+ is taken from the <em>first</em> entry, but eclasses from later entries are
+ favoured.
+- <code>newsdir</code> (default: <code>${location}/metadata/news</code>), which
+ controls where GLEP 42 news items are located.
+- <code>securitydir</code> (default: <code>${location}/metadata/security</code>),
+ which controls where security advisories are located.
+- <code>setsdir</code> (default: <code>${location}/sets</code>), which controls
+ where package set files are located.
+- <code>sync</code> (default: empty), which controls how the repository is
+ synced. Typically values are in the form <code>rsync://rsync.europe.gentoo.org/gentoo-portage</code>
+ or <code>svn://svn.berlios.de/paludis/overlay</code>. Use
+ <code>paludis --list-sync-protocols</code> to see supported protocols.
+- <code>sync_exclude</code> (default: empty), which can point to a file that
+ contains a list of directories to exclude when syncing via
+ <code>rsync://</code>.
+
+\subsection ConfigurationFilesRepositoriesVDB vdb Format Repositories
+
+You should have exactly one VDB format repository. It holds packages that have
+been installed from a <code>portage</code> format repository.
+
+The following keys are available for <code>format = vdb</code>:
+
+- <code>location</code> (mandatory), which <strong>must</strong> be set to
+ <code>${ROOT}/var/db/pkg</code>.
+- <code>buildroot</code> (default: <code>/var/tmp/paludis</code>), which is
+ used as a temporary directory when carrying out uninstall operations,
+- <code>world</code> (default: <code>${location}/world</code>), which is used
+ for the world file.
+
+\subsection ConfigurationFilesRepositoriesNothing nothing Format Repositories
+
+Usually you won't have any <code>nothing</code> repositories. They are used as
+a convenience when certain locations have to be synced at <code>--sync</code>
+time; they do not contain any packages.
+
+The following keys are available for <code>format = vdb</code>:
+
+- <code>location</code> (mandatory).
+- <code>sync</code> (default: empty), as per <code>format = portage</code>.
+- <code>sync_exclude</code> (default: empty), idem.
+*/
+
+
diff --git a/0.4.0/doc/doc_directories.doxygen b/0.4.0/doc/doc_directories.doxygen
new file mode 100644
index 000000000..6db86ff2c
--- /dev/null
+++ b/0.4.0/doc/doc_directories.doxygen
@@ -0,0 +1,18 @@
+/* vim: set ft=cpp tw=80 sw=4 et : */
+
+/** \dir paludis
+ * Paludis library code.
+ */
+
+/** \dir src
+ * Paludis program source.
+ */
+
+/** \dir paludis/args
+ * Paludis commandline argument handling utilities.
+ */
+
+/** \dir test
+ * Test framework.
+ */
+
diff --git a/0.4.0/doc/doc_licence.doxygen b/0.4.0/doc/doc_licence.doxygen
new file mode 100644
index 000000000..f1938f5f0
--- /dev/null
+++ b/0.4.0/doc/doc_licence.doxygen
@@ -0,0 +1,12 @@
+/* vim: set ft=cpp tw=80 sw=4 et : */
+
+/**
+\page Licence Licence
+
+Paludis is distributed under the terms of the GNU General Public Licence,
+version 2.
+
+\verbinclude COPYING
+
+*/
+
diff --git a/0.4.0/doc/doc_main.doxygen b/0.4.0/doc/doc_main.doxygen
new file mode 100644
index 000000000..f2fbc6cb5
--- /dev/null
+++ b/0.4.0/doc/doc_main.doxygen
@@ -0,0 +1,326 @@
+/* vim: set ft=cpp tw=80 sw=4 et : */
+
+// ----- Top Level Groups -----
+
+/** \defgroup grplibpaludis Main Paludis library
+ */
+
+/** \defgroup grplibpaludisutil Paludis utilities library
+ */
+
+/** \defgroup grplibpaludisqa Paludis QA library
+ */
+
+/** \defgroup grplibpaludisargs Paludis args library
+ */
+
+/** \defgroup grptestcases Test cases
+ */
+
+/** \defgroup grpexceptions Exceptions
+ */
+
+// ----- grplibpaludis Subgroups -----
+
+/** \defgroup grpdependencies Dependencies
+ *
+ * \ingroup grplibpaludis
+ */
+
+/** \defgroup grpabout About Paludis
+ *
+ * \ingroup grplibpaludis
+ */
+
+/** \defgroup grpconfigfile Configuration files
+ *
+ * \ingroup grplibpaludis
+ */
+
+/** \defgroup grpenvironment Environment
+ *
+ * \ingroup grplibpaludis
+ */
+
+/** \defgroup grphashedcontainers Hashed containers
+ *
+ * \ingroup grplibpaludis
+ */
+
+/** \defgroup grpnames Names
+ *
+ * \ingroup grplibpaludis
+ */
+
+/** \defgroup grpversions Versions
+ *
+ * \ingroup grplibpaludis
+ */
+
+/** \defgroup grpcontents Contents
+ *
+ * \ingroup grplibpaludis
+ */
+
+// ----- grpconfigfile Subgroups -----
+
+/** \defgroup grpkvconfigfile Key/Value configuration file
+ *
+ * \ingroup grpconfigfile
+ */
+
+/** \defgroup grplineconfigfile Line configuration file
+ *
+ * \ingroup grpconfigfile
+ */
+
+/** \defgroup grpadvisoryconfigfile Security advisory file
+ *
+ * \ingroup grpconfigfile
+ */
+
+// ----- grpenvironment Subgroups -----
+
+/** \defgroup grpdefaultenvironment Default environment
+ *
+ * \ingroup grpenvironment
+ */
+
+/** \defgroup grptestenvironment Test environment
+ *
+ * \ingroup grpenvironment
+ */
+
+/** \defgroup grppackagedatabase Package database
+ *
+ * \ingroup grpenvironment
+ */
+
+/** \defgroup grpmaskreasons Mask reasons
+ *
+ * \ingroup grpenvironment
+ */
+
+// ----- grpdefaultenvironment Subgroups -----
+
+/** \defgroup grpdefaultconfig Default configuration
+ *
+ * \ingroup grpdefaultenvironment
+ */
+
+// --- grppackagedatabase Subgroups -----
+
+/** \defgroup grprepository Repositories
+ *
+ * \ingroup grppackagedatabase
+ */
+
+// --- grprepository Subgroups -----
+
+/** \defgroup grpfakerepository Fake repository
+ *
+ * \ingroup grprepository
+ */
+
+/** \defgroup grpportagerepository Portage repository
+ *
+ * \ingroup grprepository
+ */
+
+/** \defgroup grpnothingrepository Nothing repository
+ *
+ * \ingroup grprepository
+ */
+
+/** \defgroup grpvdbrepository VDB repository
+ *
+ * \ingroup grprepository
+ */
+
+/** \defgroup grpebuildinterface Ebuild interface
+ *
+ * \ingroup grprepository
+ */
+
+/** \defgroup grpsyncer Sync protocol handler classes
+ *
+ * \ingroup grprepository
+ */
+
+// ----- grpdepatoms Subgroups -----
+
+/** \defgroup grpdepatomdumper Dep atom dumper
+ *
+ * \ingroup grpdepatoms
+ */
+
+/** \defgroup grpdepatomflattener Dep atom flattener
+ *
+ * \ingroup grpdepatoms
+ */
+
+/** \defgroup grpdepatomprettyprinter Dep atom pretty printer
+ *
+ * \ingroup grpdepatoms
+ */
+
+// ----- grpdependencies Subgroups -----
+
+/** \defgroup grpdepresolver Dependency resolution
+ *
+ * \ingroup grpdependencies
+ */
+
+/** \defgroup grpdepatoms Dependency atoms
+ *
+ * \ingroup grpdependencies
+ */
+
+/** \defgroup grpdepparser Dependency parsing
+ *
+ * \ingroup grpdependencies
+ */
+
+/** \defgroup grpmatchpackage Match package
+ *
+ * \ingroup grpdependencies
+ */
+
+// ----- grpdepparser Subgroups -----
+
+/** \defgroup grpdeplexer Dependency lexing
+ *
+ * \ingroup grpdepparser
+ */
+
+// ----- grplibpaludisutil Subgroups -----
+
+/** \defgroup grpcollections Collections
+ *
+ * \ingroup grplibpaludisutil
+ */
+
+/** \defgroup grpcompare Comparisons
+ *
+ * \ingroup grplibpaludisutil
+ */
+
+/** \defgroup grppatterns Patterns
+ *
+ * \ingroup grplibpaludisutil
+ */
+
+/** \defgroup grpcontainerentries Container entries
+ *
+ * \ingroup grplibpaludisutil
+ */
+
+/** \defgroup grppointers Pointers
+ *
+ * \ingroup grplibpaludisutil
+ */
+
+/** \defgroup grpdeleter Deleter
+ *
+ * \ingroup grplibpaludisutil
+ */
+
+/** \defgroup grpfilesystem Filesystem
+ *
+ * \ingroup grplibpaludisutil
+ */
+
+/** \defgroup grpstrings Strings
+ *
+ * \ingroup grplibpaludisutil
+ */
+
+/** \defgroup grplog Log
+ *
+ * \ingroup grplibpaludisutil
+ */
+
+/** \defgroup grpsystem System
+ *
+ * \ingroup grplibpaludisutil
+ */
+
+/** \defgroup grprandom Random numbers
+ *
+ * \ingroup grplibpaludisutil
+ */
+
+/** \defgroup grpsave Save
+ *
+ * \ingroup grplibpaludisutil
+ */
+
+/** \defgroup grprecords Records
+ *
+ * \ingroup grplibpaludisutil
+ */
+
+/** \defgroup grpvalidated Validated
+ *
+ * \ingroup grplibpaludisutil
+ */
+
+// ----- grppatterns Subgroups -----
+
+/** \defgroup grpcomposite Composite pattern
+ *
+ * \ingroup grppatterns
+ */
+
+/** \defgroup grpinstance Instance patterns
+ *
+ * \ingroup grppatterns
+ */
+
+/** \defgroup grppimp Private implementation pattern
+ *
+ * \ingroup grppatterns
+ */
+
+/** \defgroup grpvc Virtual constructor
+ *
+ * \ingroup grppatterns
+ */
+
+/** \defgroup grpvisitor Visitor
+ *
+ * \ingroup grpvisitor
+ */
+
+// ----- grpstrings Subgroups -----
+
+/** \defgroup grpdestringify Destringify
+ *
+ * \ingroup grpstrings
+ */
+
+/** \defgroup grpjoin Join
+ *
+ * \ingroup grpstrings
+ */
+
+/** \defgroup grpstringify Stringify
+ *
+ * \ingroup grpstrings
+ */
+
+/** \defgroup grptokenise Tokenise
+ *
+ * \ingroup grpstrings
+ */
+
+/** \defgroup grpmatch Match
+ *
+ * \ingroup grpstrings
+ */
+
+/** \defgroup grpstrippers Strippers
+ *
+ * \ingroup grpstrings
+ */
+
diff --git a/0.4.0/doc/doc_mainpage.doxygen b/0.4.0/doc/doc_mainpage.doxygen
new file mode 100644
index 000000000..8d4d432e7
--- /dev/null
+++ b/0.4.0/doc/doc_mainpage.doxygen
@@ -0,0 +1,58 @@
+/* vim: set ft=cpp tw=80 sw=4 et : */
+
+/** \mainpage
+
+\section overview Overview
+
+This is the documentation for Paludis, the other package manager. It is available as part of Paludis via <code>make doxygen</code>, or on the web at <a href="http://paludis.berlios.de/">the Paludis project page</a>.
+
+\section userdocs For End Users
+
+Paludis is still undergoing heavy development. It is not a mature solution, and
+still has quite a few missing features. You <b>will</b> run into bugs if you use
+Paludis (some of which may leave your system unusable). Most ebuild authors do
+not test their code with both package managers.
+
+If you find this acceptable, read \link BootstrapHowto the Bootstrap HOWTO
+\endlink for how to set up a chroot or make a stage. You may also like to read
+about \link PortageDifferences some of the differences between Paludis and
+Portage\endlink.
+
+We have a <a href="https://developer.berlios.de/bugs/?group_id=6360">bug
+tracker</a> and some
+<a href="https://developer.berlios.de/mail/?group_id=6360">mailing lists</a>, but
+you shouldn't try to use these until after you've discussed your problem in our
+IRC channel. Read the howto for more details.
+
+\warning Do not file bugs related to Paludis on Gentoo Bugzilla. Do not discuss
+ Paludis on Gentoo mailing lists or forums. Do not pester Gentoo developers
+ about Paludis.
+
+\section developerdocs For Developers
+
+Start by getting a
+<a href="https://developer.berlios.de/svn/?group_id=6360">Subversion
+checkout</a>, and reading the \link PortageDifferences Paludis and Portage
+differences \endlink document.
+
+It's best to start by skimming over the main program to get a feel for how
+everything fits together. The interface code is kept in the src/ directory,
+and library code is in paludis/ .
+
+The following classes are good places to begin:
+
+- paludis::DefaultEnvironment provides a representation of the default
+ operating environment.
+- paludis::PackageDatabase provides routines for querying packages. An
+ instance can be obtained via paludis::DefaultEnvironment.
+- paludis::DepList can be used for making dependency lists.
+- paludis::Repository is subclassed to do querying, installing,
+ uninstalling, syncing and the like.
+
+The <a href="modules.html">Modules</a> link in the header bar will probably
+be of more use than any of the full class lists.
+
+You should also read \link CodingStandards the Coding Standards \endlink
+before tinkering.
+
+*/
diff --git a/0.4.0/doc/doc_namespaces.doxygen b/0.4.0/doc/doc_namespaces.doxygen
new file mode 100644
index 000000000..8b8164f16
--- /dev/null
+++ b/0.4.0/doc/doc_namespaces.doxygen
@@ -0,0 +1,29 @@
+/* vim: set ft=cpp tw=80 sw=4 et : */
+
+/** \namespace test_cases
+ * Test cases.
+ *
+ * \ingroup Test
+ */
+
+/** \namespace test
+ * Test framework.
+ *
+ * \ingroup Test
+ */
+
+/** \namespace paludis
+ * Paludis library code.
+ */
+
+/** \namespace paludis::args
+ * Commandline argument handling.
+ *
+ * \ingroup Args
+ */
+
+/** \namespace paludis::qa
+ * QA checks.
+ *
+ * \ingroup Args
+ */
diff --git a/0.4.0/doc/doc_news.doxygen b/0.4.0/doc/doc_news.doxygen
new file mode 100644
index 000000000..4914a904e
--- /dev/null
+++ b/0.4.0/doc/doc_news.doxygen
@@ -0,0 +1,11 @@
+/* vim: set ft=cpp tw=80 sw=4 et : */
+
+/**
+\page News News
+
+\verbinclude NEWS
+
+*/
+
+
+
diff --git a/0.4.0/doc/doc_portage_differences.doxygen b/0.4.0/doc/doc_portage_differences.doxygen
new file mode 100644
index 000000000..20f2106be
--- /dev/null
+++ b/0.4.0/doc/doc_portage_differences.doxygen
@@ -0,0 +1,88 @@
+/* vim: set ft=cpp tw=80 sw=4 et spell spelllang=en : */
+
+/**
+\page PortageDifferences How Paludis and Portage Differ
+
+This is not a complete list. It's not even vaguely near complete. Rather, it's
+a collection of lists of things of interest that are intentionally different
+between Paludis and its predecessor, Portage.
+
+\section PortageDifferencesEndUser For the End User
+
+Paludis isn't aimed at end users. Having said that, the following features
+would be relevant if it were:
+
+- A whole different configuration system, making it far easier to maintain
+ multiple systems, some in chroots, with entirely separate configuration
+ files.
+
+- Performance. Paludis is fast.
+
+- Low dependency bloat. No Python, no big external crypto libraries.
+
+- Security integration.
+
+- Multiple repository support, replacing Portage's highly limited overlays.
+
+- Simple per-(category, package, version, anything else) environment variable
+ setting (e.g. CFLAGS).
+
+- Licence filtering.
+
+- Hook scripts, for running code after a certain action occurs.
+
+- Wrappers for econf, emake, wget etc to allow user defined command bindings
+ (nice, ionice, taskset etc).
+
+- User definable package sets.
+
+- Repositories can deliver news items, warning the user of important changes
+ before they take place.
+
+- Ability to sync from Subversion, Git.
+
+\section PortageDifferencesEbuildDeveloper For the Ebuild Developer
+
+As well as the end user advantages, ebuild authors will benefit from:
+
+- :slot dependencies
+
+- ::repository dependencies
+
+- [use] dependencies
+
+- Circular dependency detection
+
+- Per package use masking, and from this per package use combination
+ restrictions.
+
+- Profile-level use forcing, globally and per-package, and from this the
+ ability to specify a default in cases where one of n USE flags must be
+ enabled.
+
+- Default deep dependency resolution.
+
+- Support for -scm, -try versions.
+
+- Multiple inheritance for profiles.
+
+- Ability to install hook scripts.
+
+- Repository definable package sets.
+
+- Ability to deliver news items to the end user.
+
+\section PortageDifferencesProgrammer For the Programmer
+
+- Proper library / interface separation.
+
+- Reasonable internals documentation, via Doxygen.
+
+- Consistent interfaces for different repository types.
+
+- Modularity where it matters.
+
+- Test suites, to detect the impact of changes.
+
+*/
+
diff --git a/0.4.0/doc/doc_references.doxygen b/0.4.0/doc/doc_references.doxygen
new file mode 100644
index 000000000..2609f8de6
--- /dev/null
+++ b/0.4.0/doc/doc_references.doxygen
@@ -0,0 +1,43 @@
+/* vim: set ft=cpp tw=80 sw=4 et : */
+
+/**
+\page References References
+
+\section ReferencesBooks Books
+
+\anchor AppCrypt
+<strong>AppCrypt</strong>: Applied Cryptography Second Edition / Bruce
+Schneier / Wiley / ISBN 0-471-11709-9
+
+\anchor EffCpp
+<strong>EffCpp</strong>: Effective C++ Third Edition / Scott Meyers /
+Addison-Wesley / ISBN 0-321-33487-6
+
+\anchor EffSTL
+<strong>EffSTL</strong>: Effective STL / Scott Meyers / Addison-Wesley / ISBN
+0-201-74962-9
+
+\anchor GoF
+<strong>GoF</strong>: Design Patterns: Elements of Reusable Object-Oriented
+Software / Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides /
+Addison-Wesley / ISBN 0-201-63361-2
+
+\anchor MCppD
+<strong>MCppD</strong>: Modern C++ Design: Generic Programming and Design
+Patterns Applied / Andrei Alexandrescu / Addison-Wesley / ISBN 0-201-70431-5
+
+\anchor TaoCP2
+<strong>TaoCP2</strong>: The Art of Computer Programming, Volume 2:
+Seminumerical Algorithms, Third Edition / Donald E. Knuth / Addison-Wesley /
+ISBN 0-201-89684-2
+
+\anchor TCppSL
+<strong>TCppSL</strong>: The C++ Standard Library / Nicolai M. Josuttis /
+Addison-Wesley / ISBN 0-201-37926-0
+
+\anchor TCppPL
+<strong>TCppPL</strong>: The C++ Programming Language Third Edition / Bjarne
+Stroustrup / Addison-Wesley / ISBN 0-201-88954-4
+
+*/
+
diff --git a/0.4.0/doc/doc_security_advisories.doxygen b/0.4.0/doc/doc_security_advisories.doxygen
new file mode 100644
index 000000000..1f290f898
--- /dev/null
+++ b/0.4.0/doc/doc_security_advisories.doxygen
@@ -0,0 +1,154 @@
+/* vim: set ft=cpp tw=80 sw=4 et spell spelllang=en : */
+
+/**
+\page SecurityAdvisoriesSpecs Handling of Security Advisories
+
+\version 1
+\author Danny van Dyk <kugelfang@gentoo.org>
+\author Stefan Cornelius <dercorny@gentoo.org>
+
+
+\section SecurityAdvisoriesSpecsAbstract Abstract
+
+This specification describes how security advisory files should be named,
+stored, structured and handled by Paludis.
+
+
+\section SecurityAdvisoriesSpecsNaming Naming
+
+The format of file names shall be
+\code
+ advisory-YYYYMM-XX.conf
+\endcode
+where XX is a unique ID that is increased with every GLSA in the month and
+YYYYMM is the usual date notation.
+
+
+\section SecurityAdvisoriesSpecsStorage Storage
+
+Security advisories shall be stored as text files in
+\code
+ ${repo}/metadata/security
+\endcode
+by default. Files within subdirectories shall not be parsed by Paludis. However,
+the user can change this path in the repository's configuration file. The key's
+name shall be <code>securitydir</code>.
+
+Once tree wide Manifest support (aka as Manifest2 support) will be implemented,
+all advisories should be listed by a Manifest file and checked against this
+manifest before parsing them.
+
+
+\section SecurityAdvisoriesSpecsStructure Structure
+
+The file format shall consist of a RFC 822 style header and a trailing text
+body. This document describes specification <code>0</code>. The following keys shall be
+understood by Paludis:
+
+The following keys are mandatory and must be unique in the advisory.
+Paludis shall throw an exception otherwise.
+
+<table>
+ <tr>
+ <td>Id</td>
+ <td>Unique identifier of this advisory. Must be in <code>YYYYMM-XX</code> format and
+ reflect the suffix of the advisory's file name.</td>
+ </tr>
+ <tr>
+ <td>Title</td>
+ <td>A string that describes the kind of vulnerability indicated by the advisory.</td>
+ </tr>
+ <tr>
+ <td>Access</td>
+ <td>Describes if if the vulnerability can be exploited by <code>local</code> or
+ <code>remote</code> users.</td>
+ </tr>
+ <tr>
+ <td>Last-Modified</td>
+ <td>A date string that describes when the advisory was changed.</td>
+ </tr>
+ <tr>
+ <td>Revision</td>
+ <td>The advisory's revision number. It must start with <code>1.0</code> and should be
+ increased by <code>0.1</code> whenever the advisory's metadata was changed
+ substantially.</td>
+ <tr>
+ <td>Severity</td>
+ <td>The severity of the vulnerabilities described by the advisory.
+ Supported values are <code>high</code>, <code>normal</code> and <code>low</code>.</td>
+ </tr>
+ <tr>
+ <td>Spec-Version</td>
+ <td>The version of the specification that the advisory applies to should be
+ referenced here. As of this specification, the only valid value is <code>1</code>.</td>
+ </tr>
+</table>
+
+\note The following keys can be specified more than once.
+
+<table>
+ <tr>
+ <td>Affected</td>
+ <td>A string of one dependency atom or two ranged dependency atoms. When two
+ dependency atoms are given, their intersection must not describe and empty
+ set of packages.</td>
+ </tr>
+ <tr>
+ <td>Bug-Id</td>
+ <td>Identifier of a bug report that is associated with this advisory.\n
+
+ Must be in format <code>DISTRO#YY</code>, where <code>DISTRO</code> is a unique string
+ describing the distribution that the bug report is filed against and <code>YY</code>
+ is the bug's local identifier.
+
+ There is no restriction on the values of <code>DISTRO</code> besides the uniqueness,
+ but each used distribution identifier should be listed along a short
+ description and/or URL of the associated bug tracker in the text file
+\code
+ ${repo}/metadata/security/bugtracker
+\endcode </td>
+ </tr>
+ <tr>
+ <td>CVE</td>
+ <td>A string of one CVE IDs in the format <code>CVE-XXXX-XXXX</code>. Historically,
+ there have been CVE references prefixed by CAN instead of CVE. These
+ are explicitly permitted by this specification, but are to be treated as
+ deprecated.</td>
+ </tr>
+ <tr>
+ <td>Reference</td>
+ <td>URL to a public web-based advisory, announcement or (possibly) exploit.
+ Optionally, a descriptive string can be prepended.</td>
+ </tr>
+ <tr>
+ <td>Restart</td>
+ <td>The name of a service or init script that should be restarted by
+ Paludis after the vulnerable package has been replaced.</td>
+ </tr>
+ <tr>
+ <td>Unaffected</td>
+ <td>A string of one dependency atom or two ranged dependency atoms. When two
+ dependency atoms are given, their intersection must not describe and empty
+ set of packages.</td>
+ </tr>
+</table>
+
+The text body shall be separated from the aforementioned header by an empty
+line. The contents of the text body is not subject of this advisory.
+
+Paludis shall provide an eselect module to display advisory texts.
+
+
+\section Handling Handling
+
+Paludis will parse security advisories when it builds the built-in
+package set <code>security</code> or when it is called with command line option
+<code>--list-vulnerabilities</code>. The later shall support all modifiers, which are
+respected by other <code>--list</code> actions.
+
+All packages that match the contents of at least one <code>Affected</code> item and that
+do not match any <code>Unaffected</code> item will be treated as vulnerable. Paludis shall
+then search for a package in the same slot that matches at least one
+<code>Unaffected</code> items and does not match any <code>Affected</code> item. If several
+package versions match this criterion, Paludis shall select the highest version.
+*/
diff --git a/0.4.0/doc/doxygen.conf.in b/0.4.0/doc/doxygen.conf.in
new file mode 100644
index 000000000..735778642
--- /dev/null
+++ b/0.4.0/doc/doxygen.conf.in
@@ -0,0 +1,1223 @@
+# Doxyfile 1.4.2
+
+@GENERATED_FILE@
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = @PACKAGE@
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = "Version @VERSION@"
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = ./
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish,
+# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese,
+# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish,
+# Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# This tag can be used to specify the encoding used in the generated output.
+# The encoding is not always determined by the language that is chosen,
+# but also whether or not the output is meant for Windows or non-Windows users.
+# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES
+# forces the Windows encoding (this is the default for the Windows binary),
+# whereas setting the tag to NO uses a Unix-style encoding (the default for
+# all platforms other than Windows).
+
+USE_WINDOWS_ENCODING = NO
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF =
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like the Qt-style comments (thus requiring an
+# explicit @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF = YES
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member
+# documentation.
+
+DETAILS_AT_TOP = YES
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 8
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources
+# only. Doxygen will then generate output that is more tailored for Java.
+# For instance, namespaces will be presented as packages, qualified scopes
+# will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = YES
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation.
+
+SHOW_DIRECTORIES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from the
+# version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the progam writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER = "../misc/svn-version-filter.bash"
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = YES
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = ../paludis ../paludis/args ../paludis/util ../paludis/digests ../paludis/selinux ../test ../doc ../src
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm
+
+FILE_PATTERNS = *.hh *.cc *.doxygen
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = YES
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories.
+
+EXCLUDE_PATTERNS =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH = ../
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER = "grep -v '^#define .*_GUARD_'"
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = NO
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default)
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES (the default)
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = YES
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER = header.html
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER = footer.html
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET = paludis.css
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = YES
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader. This is useful
+# if you want to understand what is going on. On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_PREDEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = DOXYGEN
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = YES
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = @HAVE_DOT@
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = NO
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will
+# generate a call dependency graph for every global function or class method.
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_WIDTH = 1024
+
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_HEIGHT = 1024
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that a graph may be further truncated if the graph's
+# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH
+# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default),
+# the graph is not depth-constrained.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, which results in a white background.
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
+# read).
+
+DOT_TRANSPARENT = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
+
+
+
diff --git a/0.4.0/doc/footer.html b/0.4.0/doc/footer.html
new file mode 100644
index 000000000..08bb63d13
--- /dev/null
+++ b/0.4.0/doc/footer.html
@@ -0,0 +1,12 @@
+<div class="qindex" style="text-align: center; margin-top: 1em;">
+ <p>Copyright &copy; 2005, 2006 <a href="mailto:ciaran.mccreesh@blueyonder.co.uk">Ciaran McCreesh</a> and various others. See the <a href="Authors.html">Authors list</a> and <a href="Licence.html">Licence</a> for details and redistribution conditions.</p>
+ <table style="border-style: none; margin: auto;">
+ <tr>
+ <td style="text-align: center; padding: 2px 50px;"><a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" border="0"></a></td>
+ <td style="text-align: center; padding: 2px 50px;"><a href="http://developer.berlios.de" title="BerliOS Developer"><img src="http://developer.berlios.de/bslogo.php?group_id=6360" border="0" alt="BerliOS Developer Logo"></a></td>
+ </tr>
+ </table>
+</div>
+</body>
+</html>
+
diff --git a/0.4.0/doc/header.html b/0.4.0/doc/header.html
new file mode 100644
index 000000000..d45f2a11c
--- /dev/null
+++ b/0.4.0/doc/header.html
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!-- vim: set sw=4 sts=4 et : -->
+<html>
+ <head>
+ <title>$title</title>
+ <link href="$relpath$paludis.css" rel="stylesheet" type="text/css">
+ </head>
+ <body>
+ <div class="qindex">About Paludis: [
+ <a class="qindex" href="index.html">Paludis&nbsp;Homepage</a> |
+ <a class="qindex" href="News.html">News</a> |
+ <a class="qindex" href="ChangeLog.html">ChangeLog</a> |
+ <a class="qindex" href="Licence.html">Licence</a> |
+ <a class="qindex" href="Authors.html">Authors</a> |
+ <a class="qindex" href="https://developer.berlios.de/projects/paludis/">Berlios&nbsp;Project</a> |
+ <a class="qindex" href="https://developer.berlios.de/project/showfiles.php?group_id=6360">Download</a> |
+ <a class="qindex" href="https://developer.berlios.de/svn/?group_id=6360">SVN</a> ]
+ </div>
+
+ <div class="qindex">User Documentation: [
+ <a class="qindex" href="BootstrapHowto.html">Bootstrap&nbsp;Howto</a> |
+ <a class="qindex" href="ConfigurationFiles.html">Configuration&nbsp;Files</a> |
+ <a class="qindex" href="PortageDifferences.html">Portage&nbsp;Differences</a> ]
+ </div>
+
+ <div class="qindex">Code Documentation: [
+ <a class="qindex" href="modules.html">Modules</a> |
+ <a class="qindex" href="namespaces.html">Namespaces</a> |
+ <a class="qindex" href="annotated.html">Classes</a> |
+ <a class="qindex" href="files.html">Files</a> |
+ <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> |
+ <a class="qindex" href="functions.html">Class&nbsp;Members</a> |
+ <a class="qindex" href="globals.html">File&nbsp;Members</a> |
+ <a class="qindex" href="CodingStandards.html">Coding&nbsp;Standards</a> |
+ <a class="qindex" href="pages.html">Other&nbsp;Topics</a> ]
+ </div>
+
diff --git a/0.4.0/doc/paludis.css b/0.4.0/doc/paludis.css
new file mode 100644
index 000000000..41d761a56
--- /dev/null
+++ b/0.4.0/doc/paludis.css
@@ -0,0 +1,326 @@
+body {
+ background-color: #eeeeee;
+ color: #333333;
+}
+
+h1 {
+ text-align: center;
+ font-size: x-large;
+ border-bottom: 1px dashed #999999;
+}
+
+h2 {
+ text-align: left;
+ border-bottom: 1px dashed #999999;
+ font-size: x-large;
+}
+
+h3 {
+ font-size: large;
+}
+
+caption {
+ font-weight: bold;
+}
+
+div.qindex {
+ width: 100%;
+ background-color: #cccccc;
+ border: 1px solid #999999;
+ text-align: center;
+ margin: 2px;
+ padding: 2px;
+ font-size: 80%;
+ line-height: 140%;
+}
+
+div.nav {
+ width: 100%;
+ background-color: #cccccc;
+ border: 1px solid #999999;
+ text-align: center;
+ margin: 2px;
+ padding: 2px;
+ font-size: 80%;
+ line-height: 140%;
+}
+
+a:link {
+ text-decoration: none;
+ font-weight: bold;
+ color: #663399;
+}
+
+a:visited {
+ text-decoration: none;
+ font-weight: bold;
+ color: #663399;
+}
+
+a:hover {
+ text-decoration: none;
+ background-color: #663399;
+ font-weight: bold;
+ color: #ffffff;
+}
+
+a.el {
+ font-weight: bold;
+}
+
+a.elRef {
+ font-weight: bold;
+}
+
+.fragment {
+ font-family: monospace;
+}
+
+pre.fragment {
+ border: 1px solid #cccccc;
+ background-color: #f5f5f5;
+ margin-top: 4px;
+ margin-bottom: 4px;
+ margin-left: 2px;
+ margin-right: 8px;
+ padding-left: 6px;
+ padding-right: 6px;
+ padding-top: 4px;
+ padding-bottom: 4px;
+}
+
+div.ah {
+ background-color: black;
+ font-weight: bold;
+ color: #ffffff;
+ margin-bottom: 3px;
+ margin-top: 3px;
+}
+
+td.md {
+ background-color: #f4f4fb;
+ font-weight: bold;
+}
+
+td.mdPrefix {
+ background-color: #F4F4FB;
+ color: #606060;
+}
+
+td.mdname1 {
+ background-color: #f4f4fb;
+ font-weight: bold;
+ color: #602020;
+}
+
+td.mdname {
+ background-color: #f4f4fb;
+ font-weight: bold;
+ color: #602020;
+}
+
+div.groupHeader {
+ margin-left: 16px;
+ margin-top: 12px;
+ margin-bottom: 6px;
+ font-weight: bold;
+}
+
+div.groupText {
+ margin-left: 16px;
+ font-style: italic;
+ font-size: 90%;
+}
+
+td.indexkey {
+ background-color: #eeeeff;
+ font-weight: bold;
+ padding-right : 10px;
+ padding-top : 2px;
+ padding-left : 10px;
+ padding-bottom : 2px;
+ margin-left : 0px;
+ margin-right : 0px;
+ margin-top : 2px;
+ margin-bottom : 2px;
+ border: 1px solid #cccccc;
+}
+
+td.indexvalue {
+ background-color: #eeeeff;
+ font-style: italic;
+ padding-right : 10px;
+ padding-top : 2px;
+ padding-left : 10px;
+ padding-bottom : 2px;
+ margin-left : 0px;
+ margin-right : 0px;
+ margin-top : 2px;
+ margin-bottom : 2px;
+ border: 1px solid #cccccc;
+}
+
+tr.memlist {
+ background-color: #f0f0f0;
+}
+
+p.formulaDsp { text-align: center; }
+IMG.formulaDsp { }
+IMG.formulaInl { vertical-align: middle; }
+SPAN.keyword { color: #008000 }
+SPAN.keywordtype { color: #604020 }
+SPAN.keywordflow { color: #e08000 }
+SPAN.comment { color: #800000 }
+SPAN.preprocessor { color: #806020 }
+SPAN.stringliteral { color: #002080 }
+SPAN.charliteral { color: #008080 }
+.mdTable {
+ border: 1px solid #868686;
+ background-color: #F4F4FB;
+}
+.mdRow {
+ padding: 8px 10px;
+}
+.mdescLeft {
+ padding: 0px 8px 4px 8px;
+ font-size: 80%;
+ font-style: italic;
+ background-color: #FAFAFA;
+ border-top: 1px none #E0E0E0;
+ border-right: 1px none #E0E0E0;
+ border-bottom: 1px none #E0E0E0;
+ border-left: 1px none #E0E0E0;
+ margin: 0px;
+}
+.mdescRight {
+ padding: 0px 8px 4px 8px;
+ font-size: 80%;
+ font-style: italic;
+ background-color: #FAFAFA;
+ border-top: 1px none #E0E0E0;
+ border-right: 1px none #E0E0E0;
+ border-bottom: 1px none #E0E0E0;
+ border-left: 1px none #E0E0E0;
+ margin: 0px;
+}
+.memItemLeft {
+ padding: 1px 0px 0px 8px;
+ margin: 4px;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ border-top-color: #E0E0E0;
+ border-right-color: #E0E0E0;
+ border-bottom-color: #E0E0E0;
+ border-left-color: #E0E0E0;
+ border-top-style: solid;
+ border-right-style: none;
+ border-bottom-style: none;
+ border-left-style: none;
+ background-color: #FAFAFA;
+ font-size: 80%;
+}
+.memItemRight {
+ padding: 1px 8px 0px 8px;
+ margin: 4px;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ border-top-color: #E0E0E0;
+ border-right-color: #E0E0E0;
+ border-bottom-color: #E0E0E0;
+ border-left-color: #E0E0E0;
+ border-top-style: solid;
+ border-right-style: none;
+ border-bottom-style: none;
+ border-left-style: none;
+ background-color: #FAFAFA;
+ font-size: 80%;
+}
+.memTemplItemLeft {
+ padding: 1px 0px 0px 8px;
+ margin: 4px;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ border-top-color: #E0E0E0;
+ border-right-color: #E0E0E0;
+ border-bottom-color: #E0E0E0;
+ border-left-color: #E0E0E0;
+ border-top-style: none;
+ border-right-style: none;
+ border-bottom-style: none;
+ border-left-style: none;
+ background-color: #FAFAFA;
+ font-size: 80%;
+}
+.memTemplItemRight {
+ padding: 1px 8px 0px 8px;
+ margin: 4px;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ border-top-color: #E0E0E0;
+ border-right-color: #E0E0E0;
+ border-bottom-color: #E0E0E0;
+ border-left-color: #E0E0E0;
+ border-top-style: none;
+ border-right-style: none;
+ border-bottom-style: none;
+ border-left-style: none;
+ background-color: #FAFAFA;
+ font-size: 80%;
+}
+.memTemplParams {
+ padding: 1px 0px 0px 8px;
+ margin: 4px;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ border-top-color: #E0E0E0;
+ border-right-color: #E0E0E0;
+ border-bottom-color: #E0E0E0;
+ border-left-color: #E0E0E0;
+ border-top-style: solid;
+ border-right-style: none;
+ border-bottom-style: none;
+ border-left-style: none;
+ color: #606060;
+ background-color: #FAFAFA;
+ font-size: 80%;
+}
+.search { color: #003399;
+ font-weight: bold;
+}
+FORM.search {
+ margin-bottom: 0px;
+ margin-top: 0px;
+}
+INPUT.search { font-size: 75%;
+ color: #000080;
+ font-weight: normal;
+ background-color: #eeeeff;
+}
+TD.tiny { font-size: 75%;
+}
+.dirtab { padding: 4px;
+ border-collapse: collapse;
+ border: 1px solid #b0b0b0;
+}
+TH.dirtab { background: #eeeeff;
+ font-weight: bold;
+}
+HR { height: 1px;
+ border: none;
+ border-top: 1px solid black;
+}
+
+code {
+ background-color: #f5f5f5;
+}
+
diff --git a/0.4.0/ebuild/Makefile.am b/0.4.0/ebuild/Makefile.am
new file mode 100644
index 000000000..746f90f02
--- /dev/null
+++ b/0.4.0/ebuild/Makefile.am
@@ -0,0 +1,49 @@
+MAINTAINERCLEANFILES = Makefile.in
+CLEANFILES = *~
+SUBDIRS = . digests fetchers utils
+
+libexecprogdir = $(libexecdir)/paludis/
+
+libexecprog_SCRIPTS = \
+ build_functions.bash \
+ builtin_fetch.bash \
+ builtin_init.bash \
+ builtin_merge.bash \
+ builtin_metadata.bash \
+ builtin_strip.bash \
+ builtin_tidyup.bash \
+ builtin_unmerge.bash \
+ builtin_variable.bash \
+ ebuild.bash \
+ echo_functions.bash \
+ kernel_functions.bash \
+ eclass_functions.bash \
+ install_functions.bash \
+ list_functions.bash \
+ multilib_functions.bash \
+ pkg_config.bash \
+ pkg_nofetch.bash \
+ pkg_postinst.bash \
+ pkg_postrm.bash \
+ pkg_preinst.bash \
+ pkg_prerm.bash \
+ pkg_setup.bash \
+ portage_stubs.bash \
+ sandbox.bash \
+ src_compile.bash \
+ src_install.bash \
+ src_test.bash \
+ src_unpack.bash \
+ usage_error.bash
+
+TESTS_ENVIRONMENT = env \
+ PALUDIS_EBUILD_DIR="$(top_srcdir)/ebuild/" \
+ TEST_SCRIPT_DIR="$(srcdir)/" \
+ bash $(top_srcdir)/ebuild/run_test.bash
+
+TESTS = echo_functions_TEST.bash list_functions_TEST.bash kernel_functions_TEST.bash
+EXTRA_DIST = $(libexecprog_SCRIPTS) run_test.bash $(TESTS)
+
+check_SCRIPTS = run_test.bash $(TESTS)
+check_PROGRAMS =
+
diff --git a/0.4.0/ebuild/build_functions.bash b/0.4.0/ebuild/build_functions.bash
new file mode 100644
index 000000000..ec3b129a5
--- /dev/null
+++ b/0.4.0/ebuild/build_functions.bash
@@ -0,0 +1,99 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+econf()
+{
+ local LOCAL_EXTRA_ECONF="${EXTRA_ECONF}"
+ local LOCAL_ECONF_WRAPPER="${ECONF_WRAPPER}"
+
+ [[ -z "${ECONF_SOURCE}" ]] && ECONF_SOURCE=.
+
+ if [[ -x "${ECONF_SOURCE}/configure" ]] ; then
+ if [[ -d /usr/share/gnuconfig ]] ; then
+ local f
+ for f in $(find "${WORKDIR}" -type f -name config.guess -or -name config.sub ) ; do
+ echo "econf: updating ${f} with /usr/share/gnuconfig/${f##*/}"
+ cp -f /usr/share/gnuconfig/${f##*/} ${f}
+ done
+ fi
+
+ [[ -z "${CBUILD}" ]] || LOCAL_EXTRA_ECONF="--build=${CBUILD} ${LOCAL_EXTRA_ECONF}"
+ [[ -z "${CTARGET}" ]] || LOCAL_EXTRA_ECONF="--target=${CTARGET} ${LOCAL_EXTRA_ECONF}"
+
+ # Check that this is actually what's wanted for multilib etc.
+ local libcmd=
+ if [[ -n "${ABI}" ]] ; then
+ local v="LIBDIR_${ABI}"
+ if [[ -n "${!v}" ]] ; then
+ libcmd="--libdir=/usr/$(ebuild_get_libdir)"
+ fi
+ fi
+
+ echo ${LOCAL_ECONF_WRAPPER} ${ECONF_SOURCE}/configure \
+ --prefix=/usr \
+ --host=${CHOST} \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --datadir=/usr/share \
+ --sysconfdir=/etc \
+ --localstatedir=/var/lib \
+ ${libcmd} "$@" ${LOCAL_EXTRA_ECONF} 1>&2
+
+ ${LOCAL_ECONF_WRAPPER} ${ECONF_SOURCE}/configure \
+ --prefix=/usr \
+ --host=${CHOST} \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --datadir=/usr/share \
+ --sysconfdir=/etc \
+ --localstatedir=/var/lib \
+ ${libcmd} "$@" ${LOCAL_EXTRA_ECONF} || die "econf failed"
+
+ else
+ die "No configure script for econf"
+ fi
+}
+
+einstall()
+{
+ if [[ -f Makefile ]] || [[ -f makefile ]] || [[ -f GNUmakefile ]] ; then
+ local cmd="${EINSTALL_WRAPPER} make prefix=${D}/usr"
+ cmd="${cmd} mandir=${D}/usr/share/man"
+ cmd="${cmd} infodir=${D}/usr/share/info"
+ cmd="${cmd} datadir=${D}/usr/share"
+ cmd="${cmd} sysconfdir=${D}/etc"
+ cmd="${cmd} localstatedir=${D}/var/lib"
+ cmd="${cmd} libdir=${D}/usr/$(ebuild_get_libdir)"
+ cmd="${cmd} ${EXTRA_EINSTALL} ${@} install"
+ echo "${cmd}" 1>&2
+ ${cmd} || die "einstall failed"
+ else
+ die "No Makefile for einstall"
+ fi
+}
+
+unpack()
+{
+ dounpack ${@} || die "unpack failed"
+}
+
diff --git a/0.4.0/ebuild/builtin_fetch.bash b/0.4.0/ebuild/builtin_fetch.bash
new file mode 100644
index 000000000..e58aace0f
--- /dev/null
+++ b/0.4.0/ebuild/builtin_fetch.bash
@@ -0,0 +1,132 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+builtin_fetch()
+{
+ [[ -d "${DISTDIR}" ]] || die "DISTDIR \"${DISTDIR}\" is not a directory"
+
+ local a nofetch unique_aa old_aa
+ for a in ${FLAT_SRC_URI} ; do
+ local aa=${a##*/}
+ hasq "${aa}" ${unique_aa} || unique_aa="${unique_aa} ${aa}"
+
+ if [[ -f "${DISTDIR}/${aa}" ]] && [[ "0" != $(stat -c '%s' "${DISTDIR}/${aa}" ) ]] ; then
+ if [[ "${old_aa}" != "${aa}" ]] ; then
+ ebuild_section "Already have ${aa}"
+ old_aa="${aa}"
+ fi
+ else
+ if [[ -f "${DISTDIR}/${aa}" ]] ; then
+ ebuild_section "Trying to remove existing ${aa}..."
+ rm -f "${DISTDIR}/${aa}"
+ fi
+
+ if ! hasq fetch ${RESTRICT} ; then
+ if [[ "${old_aa}" != "${aa}" ]] ; then
+ ebuild_section "Need to fetch ${aa}"
+ old_aa="${aa}"
+ fi
+ prg="${PALUDIS_EBUILD_DIR}/fetchers/do$(echo ${a%%://*} )"
+ if [[ -x "${prg}" ]] ; then
+ ${prg} "${a}" "${DISTDIR}/${aa}"
+ else
+ eerror "Don't know how to fetch '${a}'"
+ fi
+ else
+ if ! [[ "${old_aa}" != "${aa}" ]] ; then
+ ebuild_section "Can't fetch ${aa}"
+ old_aa="${aa}"
+ fi
+ fi
+ fi
+ done
+
+ for a in ${unique_aa} ; do
+ [[ -f ${DISTDIR}/${a} ]] || nofetch="${nofetch} ${a}"
+ done
+
+ if [[ -n "${nofetch}" ]] ; then
+ local c
+ echo
+ eerror "Couldn't fetch the following components:"
+ for c in ${nofetch} ; do
+ eerror " * ${c}"
+ done
+ echo
+ die "builtin_fetch failed"
+ fi
+
+ local badfetch=
+ if [[ -f "${FILESDIR}/digest-${PN}-${PVR%-r0}" ]] ; then
+ local line items prg
+ while read line ; do
+ line=( ${line} )
+ if ! hasq "${line[2]}" ${A} ; then
+ ebuild_section "Skipping check for ${line[2]}"
+ continue
+ fi
+
+ prg="${PALUDIS_EBUILD_DIR}/digests/do$(echo ${line[0]} | tr \
+ '[[:upper:]]' '[[:lower:]]')"
+ if [[ -x "${prg}" ]] ; then
+ ebegin "Checking ${line[0]} for ${line[2]}"
+ if [[ $("${prg}" "${DISTDIR}/${line[2]}" ) == "${line[1]}" ]] ; then
+ eend 0
+ else
+ eend 1
+ hasq "${line[2]}" ${badfetch} || badfetch="${badfetch} ${line[2]}"
+ fi
+ else
+ einfo "Can't check ${line[0]} for ${line[2]}"
+ fi
+
+ done < "${FILESDIR}"/digest-${PN}-${PVR%-r0}
+ else
+ ebuild_section "No digest file, skipping integrity checks"
+ fi
+
+ if [[ -n "${badfetch}" ]] ; then
+ local c
+ echo
+ eerror "Bad digests encountered for the following components:"
+ for c in ${badfetch} ; do
+ eerror " * ${c}"
+ done
+ echo
+ die "builtin_fetch failed"
+ fi
+}
+
+ebuild_f_fetch()
+{
+ local old_sandbox_write="${SANDBOX_WRITE}"
+ SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${DISTDIR}"
+ if hasq "fetch" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_fetch (RESTRICT)"
+ elif hasq "fetch" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_fetch (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting builtin_fetch"
+ builtin_fetch
+ ebuild_section "Done builtin_fetch"
+ fi
+ SANDBOX_WRITE="${old_sandbox_write}"
+}
+
+
diff --git a/0.4.0/ebuild/builtin_init.bash b/0.4.0/ebuild/builtin_init.bash
new file mode 100644
index 000000000..2a45eeaa8
--- /dev/null
+++ b/0.4.0/ebuild/builtin_init.bash
@@ -0,0 +1,73 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+builtin_init()
+{
+ export ROOT="${ROOT//+(\/)//}"
+
+ local a
+ for a in P PV PR PN PVR PF CATEGORY FILESDIR ECLASSDIR PORTDIR \
+ DISTDIR KV PALUDIS_TMPDIR PALUDIS_EBUILD_LOG_LEVEL PALUDIS_EBUILD_DIR \
+ USERLAND KERNEL ARCH CHOST PALUDIS_COMMAND ROOT ; do
+ [[ -z "${!a}" ]] && die "\$${a} unset or empty"
+ declare -r ${a}="${!a}"
+ done
+
+ for a in FILESDIR ECLASSDIR PORTDIR DISTDIR ; do
+ [[ -d "${!a}" ]] || die "\$${a} (\"${!a}\") not a directory"
+ done
+
+ if [[ -e "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" ]] ; then
+ rm -fr "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" || die "Couldn't remove previous work"
+ fi
+
+ export WORKDIR="${PALUDIS_TMPDIR}/${CATEGORY}/${PF}/work"
+ mkdir -p "${WORKDIR}" || die "Couldn't create \$WORKDIR (\"${WORKDIR}\")"
+ declare -r WORKDIR="${WORKDIR}"
+
+ export T="${PALUDIS_TMPDIR}/${CATEGORY}/${PF}/temp/"
+ mkdir -p "${T}" || die "Couldn't create \$T (\"${T}\")"
+ declare -r T="${T}"
+ export PALUDIS_HOME="${HOME}"
+ export HOME="${T}"
+
+ export D="${PALUDIS_TMPDIR}/${CATEGORY}/${PF}/image/"
+ export D="${D//+(\/)//}"
+ mkdir -p "${D}" || die "Couldn't create \$D (\"${D}\")"
+ declare -r D="${D}"
+
+ export IMAGE="${D}"
+ declare -r IMAGE="${IMAGE}"
+
+ export S="${WORKDIR}/${P}"
+}
+
+ebuild_f_init()
+{
+ if hasq "init" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_init (RESTRICT)"
+ elif hasq "init" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_init (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting builtin_init"
+ builtin_init
+ ebuild_section "Done builtin_init"
+ fi
+}
+
diff --git a/0.4.0/ebuild/builtin_merge.bash b/0.4.0/ebuild/builtin_merge.bash
new file mode 100644
index 000000000..6859cb76d
--- /dev/null
+++ b/0.4.0/ebuild/builtin_merge.bash
@@ -0,0 +1,118 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+builtin_merge()
+{
+ ebuild_section "Merging to '${ROOT:-/}'..."
+
+ shopt -q dotglob
+ local olddotglob=$?
+ shopt -s dotglob
+
+ local dbdir="${ROOT%/}"/var/db/pkg/"${CATEGORY}/${PF}"
+ ebuild_section "Writing VDB entry to '${dbdir}'..."
+ install -d "${dbdir}" || die "couldn't make pkg db directory (\"${dbdir}\")"
+ install -d "${ROOT%/}"/var/db/pkg/.cache || die "couldn't make pkg db cache"
+
+ local v VDB_FORMAT="paludis-2"
+ for v in CATEGORY CBUILD CHOST DEPEND DESCRIPTION EAPI \
+ FEATURES HOMEPAGE INHERITED IUSE KEYWORDS LICENSE PDEPEND PF \
+ PROVIDE RDEPEND SLOT SRC_URI USE CONFIG_PROTECT CONFIG_PROTECT_MASK \
+ VDB_FORMAT ; do
+ echo "${!v}" > "${dbdir}"/${v} || die "pkg db write ${v} failed"
+ done
+ for v in ASFLAGS CBUILD CC CFLAGS CHOST CTARGET CXX CXXFLAGS \
+ EXTRA_ECONF EXTRA_EINSTALL EXTRA_EMAKE LDFLAGS LIBCXXFLAGS \
+ REPOSITORY ; do
+ [[ -z "${!v}" ]] && continue
+ echo "${!v}" > "${dbdir}"/${v} || die "pkg db write ${v} failed"
+ done
+
+ if [[ -n ${PALUDIS_EBUILD_OVERRIDE_CONFIG_PROTECT} ]]; then
+ CONFIG_PROTECT=${PALUDIS_EBUILD_OVERRIDE_CONFIG_PROTECT}
+ fi
+ if [[ -n ${PALUDIS_EBUILD_OVERRIDE_CONFIG_PROTECT_MASK} ]]; then
+ CONFIG_PROTECT_MASK=${PALUDIS_EBUILD_OVERRIDE_CONFIG_PROTECT_MASK}
+ fi
+
+ export CONFIG_PROTECT="${CONFIG_PROTECT}"
+ export CONFIG_PROTECT_MASK="${CONFIG_PROTECT_MASK}"
+
+ [[ -f "${EBUILD}" ]] && cp "${EBUILD}" ${dbdir}/
+
+ local reinstall=
+ if [[ -f "${dbdir}/CONTENTS" ]] ; then
+ mv "${dbdir}/CONTENTS" "${dbdir}/OLDCONTENTS" || die "save contents failed"
+ reinstall="yes"
+ fi
+
+ ( set ; export -p | sed 's:^declare -rx:declare -x:' ) | bzip2 > ${dbdir}/environment.bz2
+ > ${dbdir}/CONTENTS
+
+ if [[ -n "${D}" ]] && [[ -d "${D}" ]] ; then
+ install -d "${ROOT%/}/" || die "couldn't make \${ROOT} (\"${ROOT}\")"
+ if [[ -d "${D}" ]] ; then
+ merge "${D%/}/" "${ROOT%/}/" "${dbdir}/CONTENTS" \
+ || die "merge failed"
+ fi
+ fi
+
+ if ! /bin/sh -c 'echo Good, our shell is still usable' ; then
+ echo "Looks like our shell broke. Trying an ldconfig to fix it..."
+ ldconfig -r ${ROOT}
+ fi
+
+ if [[ -n "${reinstall}" ]] ; then
+ unmerge "${ROOT%/}/" "${dbdir}/OLDCONTENTS" \
+ || die "unmerge failed"
+
+ if ! /bin/sh -c 'echo Good, our shell is still usable' ; then
+ echo "Looks like our shell broke. Trying an ldconfig to fix it..."
+ ldconfig -r ${ROOT}
+ fi
+
+ rm -f "${dbdir}/OLDCONTENTS"
+ fi
+
+ [[ $olddotglob != 0 ]] && shopt -u dotglob
+ shopt -q dotglob
+ [[ $olddotglob == $? ]] || ebuild_notice "warning" "shopt dotglob restore failed"
+}
+
+ebuild_f_merge()
+{
+ local old_sandbox_write="${SANDBOX_WRITE}"
+ SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${ROOT%/}/"
+ local old_sandbox_on="${SANDBOX_ON}"
+ [[ "$(canonicalise ${ROOT} )" != "/" ]] || SANDBOX_ON=0
+
+ if hasq "merge" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_merge (RESTRICT)"
+ elif hasq "merge" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_merge (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting builtin_merge"
+ builtin_merge
+ ebuild_section "Done builtin_merge"
+ fi
+
+ SANDBOX_WRITE="${old_sandbox_write}"
+ SANDBOX_ON="${old_sandbox_on}"
+}
+
diff --git a/0.4.0/ebuild/builtin_metadata.bash b/0.4.0/ebuild/builtin_metadata.bash
new file mode 100644
index 000000000..35f408565
--- /dev/null
+++ b/0.4.0/ebuild/builtin_metadata.bash
@@ -0,0 +1,39 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+ebuild_f_metadata()
+{
+ local key
+
+ for key in DEPEND RDEPEND PDEPEND IUSE SLOT SRC_URI RESTRICT LICENSE \
+ KEYWORDS INHERITED PROVIDE EAPI HOMEPAGE DESCRIPTION E_IUSE \
+ E_DEPEND E_RDEPEND E_PDEPEND E_KEYWORDS ; do
+ set -o noglob
+ local k=${!key}
+ k=${k/\\/\\\\}
+ k=${k/\"/\\\"}
+ echo "${key}=\""${k}"\""
+ set +o noglob
+ done
+}
+
diff --git a/0.4.0/ebuild/builtin_strip.bash b/0.4.0/ebuild/builtin_strip.bash
new file mode 100644
index 000000000..9e4bb7274
--- /dev/null
+++ b/0.4.0/ebuild/builtin_strip.bash
@@ -0,0 +1,57 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+builtin_strip()
+{
+ STRIP=${STRIP:-${CHOST}-strip}
+ if ! type -p -- ${STRIP} >/dev/null; then
+ STRIP=strip
+ fi
+ PALUDIS_STRIP_FLAGS=${PALUDIS_STRIP_FLAGS:---strip-unneeded}
+
+ for fn in $(find "${D}" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 -or -name '*.so' -or -name '*.so.*' \)); do
+ local ft=$(file "${fn}")
+ if [[ $? != 0 || -z ${ft} ]]; then
+ return 1
+ fi
+
+ if [[ ${ft} == *"current ar archive"* ]]; then
+ echo ${STRIP} -g "${fn}"
+ ${STRIP} -g "${fn}"
+ elif [[ ${ft} == *"SB executable"* || ${ft} == *"SB shared object"* ]]; then
+ echo ${STRIP} ${PALUDIS_STRIP_FLAGS} "${fn}"
+ ${STRIP} ${PALUDIS_STRIP_FLAGS} "${fn}"
+ fi
+ done
+}
+
+ebuild_f_strip()
+{
+ if hasq "strip" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_strip (RESTRICT)"
+ elif hasq "strip" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_strip (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting builtin_strip"
+ builtin_strip
+ ebuild_section "Done builtin_strip"
+ fi
+}
+
diff --git a/0.4.0/ebuild/builtin_tidyup.bash b/0.4.0/ebuild/builtin_tidyup.bash
new file mode 100644
index 000000000..7d6045914
--- /dev/null
+++ b/0.4.0/ebuild/builtin_tidyup.bash
@@ -0,0 +1,40 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+builtin_tidyup()
+{
+ if [[ -e "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" ]] ; then
+ echo rm -fr "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" 1>&2
+ rm -fr "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}" || die "Couldn't remove work"
+ fi
+}
+
+ebuild_f_tidyup()
+{
+ if hasq "tidyup" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_tidyup (RESTRICT)"
+ elif hasq "tidyup" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_tidyup (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting builtin_tidyup"
+ builtin_tidyup
+ ebuild_section "Done builtin_tidyup"
+ fi
+}
+
diff --git a/0.4.0/ebuild/builtin_unmerge.bash b/0.4.0/ebuild/builtin_unmerge.bash
new file mode 100644
index 000000000..c965b3342
--- /dev/null
+++ b/0.4.0/ebuild/builtin_unmerge.bash
@@ -0,0 +1,96 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+builtin_unmerge()
+{
+ local dbdir="${ROOT}"/var/db/pkg/"${CATEGORY}/${PF}" entry
+ [[ -d "${dbdir}" ]] || die "couldn't find pkg db directory (\"${dbdir}\")"
+
+ for v in CATEGORY CBUILD CHOST DEPEND DESCRIPTION EAPI \
+ FEATURES HOMEPAGE INHERITED IUSE KEYWORDS LICENSE PDEPEND PF \
+ PROVIDE RDEPEND SLOT SRC_URI USE CONFIG_PROTECT CONFIG_PROTECT_MASK \
+ VDB_FORMAT ASFLAGS CBUILD CC CFLAGS CHOST CTARGET CXX CXXFLAGS \
+ EXTRA_ECONF EXTRA_EINSTALL EXTRA_EMAKE LDFLAGS LIBCXXFLAGS \
+ REPOSITORY ; do
+ if [[ -f "${dbdir}/${v}" ]] ; then
+ eval "${v}=\$(< ${dbdir}/${v} ) || die \"Load key ${v} failed\""
+ else
+ eval "${v}="
+ fi
+ done
+
+ if [[ -f ${dbdir}/CONFIG_PROTECT ]]; then
+ CONFIG_PROTECT="$(< ${dbdir}/CONFIG_PROTECT) ${CONFIG_PROTECT}"
+ if [[ -f ${dbdir}/CONFIG_PROTECT_MASK ]]; then
+ CONFIG_PROTECT_MASK="$(< ${dbdir}/CONFIG_PROTECT_MASK)"
+ fi
+ else
+ eval $(bzcat "${dbdir}/environment.bz2" | while read line; do
+ line=${line//\'}
+ if [[ ${line%%=*} == CONFIG_PROTECT ]]; then
+ echo "CONFIG_PROTECT='${line#*=} ${CONFIG_PROTECT}'"
+ elif [[ ${line%%=*} == CONFIG_PROTECT_MASK ]]; then
+ echo "CONFIG_PROTECT_MASK='${line#*=}'"
+ fi
+ done)
+ fi
+
+ if [[ -n ${PALUDIS_EBUILD_OVERRIDE_CONFIG_PROTECT} ]]; then
+ CONFIG_PROTECT=${PALUDIS_EBUILD_OVERRIDE_CONFIG_PROTECT}
+ fi
+ if [[ -n ${PALUDIS_EBUILD_OVERRIDE_CONFIG_PROTECT_MASK} ]]; then
+ CONFIG_PROTECT_MASK=${PALUDIS_EBUILD_OVERRIDE_CONFIG_PROTECT_MASK}
+ fi
+
+ export CONFIG_PROTECT="${CONFIG_PROTECT}"
+ export CONFIG_PROTECT_MASK="${CONFIG_PROTECT_MASK}"
+
+ unmerge "${ROOT}/" "${dbdir}/CONTENTS" \
+ || die "unmerge failed"
+
+ if ! /bin/sh -c 'echo Good, our shell is still usable' ; then
+ echo "Looks like our shell broke. Trying an ldconfig to fix it..."
+ ldconfig -r ${ROOT}
+ fi
+
+ rm -fr "${dbdir}"
+}
+
+ebuild_f_unmerge()
+{
+ local old_sandbox_write="${SANDBOX_WRITE}"
+ SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${ROOT%/}/"
+ local old_sandbox_on="${SANDBOX_ON}"
+ [[ "$(canonicalise ${ROOT} )" != "/" ]] || SANDBOX_ON=0
+
+ if hasq "unmerge" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_unmerge (RESTRICT)"
+ elif hasq "unmerge" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_unmerge (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting builtin_unmerge"
+ builtin_unmerge
+ ebuild_section "Done builtin_unmerge"
+ fi
+
+ SANDBOX_WRITE="${old_sandbox_write}"
+ SANDBOX_ON="${old_sandbox_on}"
+}
+
+
diff --git a/0.4.0/ebuild/builtin_variable.bash b/0.4.0/ebuild/builtin_variable.bash
new file mode 100644
index 000000000..3ffa7d623
--- /dev/null
+++ b/0.4.0/ebuild/builtin_variable.bash
@@ -0,0 +1,24 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+ebuild_f_variable()
+{
+ echo "${!PALUDIS_VARIABLE}"
+}
+
diff --git a/0.4.0/ebuild/digests/Makefile.am b/0.4.0/ebuild/digests/Makefile.am
new file mode 100644
index 000000000..9a2161f22
--- /dev/null
+++ b/0.4.0/ebuild/digests/Makefile.am
@@ -0,0 +1,26 @@
+MAINTAINERCLEANFILES = Makefile.in
+CLEANFILES = *~
+SUBDIRS = .
+
+libexecprogdir = $(libexecdir)/paludis/digests/
+
+libexecprog_PROGRAMS = \
+ dosha256 \
+ dormd160 \
+ domd5
+
+dosha256_SOURCES = dosha256.cc
+dosha256_LDADD = $(top_builddir)/paludis/digests/libpaludisdigests.a
+
+dormd160_SOURCES = dormd160.cc
+dormd160_LDADD = $(top_builddir)/paludis/digests/libpaludisdigests.a
+
+domd5_SOURCES = domd5.cc
+domd5_LDADD = $(top_builddir)/paludis/digests/libpaludisdigests.a
+
+TESTS_ENVIRONMENT = env \
+ PALUDIS_EBUILD_DIR="$(srcdir)/ebuild/" \
+ TEST_SCRIPT_DIR="$(srcdir)/" \
+ bash $(top_srcdir)/test/run_test.sh
+
+AM_CXXFLAGS = -I$(top_srcdir)
diff --git a/0.4.0/ebuild/digests/domd5.cc b/0.4.0/ebuild/digests/domd5.cc
new file mode 100644
index 000000000..5c6fc2901
--- /dev/null
+++ b/0.4.0/ebuild/digests/domd5.cc
@@ -0,0 +1,54 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * 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
+ */
+
+#include <paludis/digests/md5.hh>
+#include <iostream>
+#include <cstdlib>
+#include <fstream>
+
+int
+main(int argc, char * argv[])
+{
+ if (argc >= 3)
+ {
+ std::cerr << "usage: " << argv[0] << " [filename]" << std::endl;
+ return EXIT_FAILURE;
+ }
+
+ if (argc == 2)
+ {
+ std::ifstream f(argv[1]);
+ if (! f)
+ {
+ std::cerr << argv[0] << ": could not open '" << argv[1] << "'" << std::endl;
+ return EXIT_FAILURE;
+ }
+ paludis::MD5 sum(f);
+ std::cout << sum.hexsum() << std::endl;
+ }
+ else
+ {
+ paludis::MD5 sum(std::cin);
+ std::cout << sum.hexsum() << std::endl;
+ }
+
+}
+
+
+
diff --git a/0.4.0/ebuild/digests/dormd160.cc b/0.4.0/ebuild/digests/dormd160.cc
new file mode 100644
index 000000000..bc9a81e5f
--- /dev/null
+++ b/0.4.0/ebuild/digests/dormd160.cc
@@ -0,0 +1,53 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * 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
+ */
+
+#include <paludis/digests/rmd160.hh>
+#include <iostream>
+#include <fstream>
+#include <cstdlib>
+
+int
+main(int argc, char * argv[])
+{
+ if (argc >= 3)
+ {
+ std::cerr << "usage: " << argv[0] << " [filename]" << std::endl;
+ return EXIT_FAILURE;
+ }
+
+ if (argc == 2)
+ {
+ std::ifstream f(argv[1]);
+ if (! f)
+ {
+ std::cerr << argv[0] << ": could not open '" << argv[1] << "'" << std::endl;
+ return EXIT_FAILURE;
+ }
+ paludis::RMD160 sum(f);
+ std::cout << sum.hexsum() << std::endl;
+ }
+ else
+ {
+ paludis::RMD160 sum(std::cin);
+ std::cout << sum.hexsum() << std::endl;
+ }
+
+}
+
+
diff --git a/0.4.0/ebuild/digests/dosha256.cc b/0.4.0/ebuild/digests/dosha256.cc
new file mode 100644
index 000000000..fe7fcc763
--- /dev/null
+++ b/0.4.0/ebuild/digests/dosha256.cc
@@ -0,0 +1,52 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * 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
+ */
+
+#include <paludis/digests/sha256.hh>
+#include <iostream>
+#include <cstdlib>
+#include <fstream>
+
+int
+main(int argc, char * argv[])
+{
+ if (argc >= 3)
+ {
+ std::cerr << "usage: " << argv[0] << " [filename]" << std::endl;
+ return EXIT_FAILURE;
+ }
+
+ if (argc == 2)
+ {
+ std::ifstream f(argv[1]);
+ if (! f)
+ {
+ std::cerr << argv[0] << ": could not open '" << argv[1] << "'" << std::endl;
+ return EXIT_FAILURE;
+ }
+ paludis::SHA256 sum(f);
+ std::cout << sum.hexsum() << std::endl;
+ }
+ else
+ {
+ paludis::SHA256 sum(std::cin);
+ std::cout << sum.hexsum() << std::endl;
+ }
+
+}
+
diff --git a/0.4.0/ebuild/ebuild.bash b/0.4.0/ebuild/ebuild.bash
new file mode 100755
index 000000000..2a2cea543
--- /dev/null
+++ b/0.4.0/ebuild/ebuild.bash
@@ -0,0 +1,272 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+unalias -a
+unset GZIP BZIP BZIP2 CDPATH GREP_OPTIONS GREP_COLOR GLOBIGNORE
+eval unset LANG ${!LC_*}
+
+export SANDBOX_PREDICT="${SANDBOX_PREDICT+${SANDBOX_PREDICT}:}"
+export SANDBOX_PREDICT="${SANDBOX_PREDICT}/proc/self/maps:/dev/console:/dev/random"
+export SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}"
+export SANDBOX_WRITE="${SANDBOX_WRITE}/dev/shm:/dev/stdout:/dev/stderr:/dev/null:/dev/tty"
+export SANDBOX_WRITE="${SANDBOX_WRITE}:${PALUDIS_TMPDIR}:/var/cache"
+export SANDBOX_WRITE="${SANDBOX_WRITE}:/proc/self/attr:/selinux/context"
+export SANDBOX_ON="1"
+
+shopt -s expand_aliases
+
+EBUILD_KILL_PID=$$
+alias die='diefunc "$FUNCNAME" "$LINENO"'
+alias assert='_pipestatus="${PIPESTATUS[*]}"; [[ -z "${_pipestatus//[ 0]/}" ]] || diefunc "$FUNCNAME" "$LINENO" "$_pipestatus"'
+trap 'echo "die trap: exiting with error." 1>&2 ; exit 250' 15
+
+export EBUILD_PROGRAM_NAME="$0"
+
+diefunc()
+{
+ local func="$1" line="$2"
+ shift 2
+ echo 1>&2
+ echo "!!! ERROR in ${CATEGORY:-?}/${PF:-?}:" 1>&2
+ echo "!!! In ${func:-?} at line ${line:-?}" 1>&2
+ echo "!!! ${*:-(no message provided)}" 1>&2
+ echo 1>&2
+
+ echo "!!! Call stack:" 1>&2
+ for (( n = 1 ; n < ${#FUNCNAME[@]} ; ++n )) ; do
+ funcname=${FUNCNAME[${n}]}
+ sourcefile=$(basename ${BASH_SOURCE[${n}]})
+ lineno=${BASH_LINENO[$(( n - 1 ))]}
+ echo "!!! * ${funcname} (${sourcefile}:${lineno})" 1>&2
+ done
+ echo 1>&2
+
+ kill ${EBUILD_KILL_PID}
+ exit 249
+}
+
+if [[ -n "${PALUDIS_EBUILD_DIR_FALLBACK}" ]] ; then
+ export PATH="${PALUDIS_EBUILD_DIR_FALLBACK}/utils:${PATH}"
+fi
+export PATH="${PALUDIS_EBUILD_DIR}/utils:${PATH}"
+EBUILD_MODULES_DIR=$(canonicalise $(dirname $0 ) )
+[[ -d ${EBUILD_MODULES_DIR} ]] || die "${EBUILD_MODULES_DIR} is not a directory"
+export PALUDIS_EBUILD_MODULES_DIR="${EBUILD_MODULES_DIR}"
+
+ebuild_load_module()
+{
+ source "${EBUILD_MODULES_DIR}/${1}.bash" || die "Error loading module ${1}"
+}
+
+ebuild_load_module echo_functions
+ebuild_load_module kernel_functions
+ebuild_load_module sandbox
+ebuild_load_module portage_stubs
+ebuild_load_module list_functions
+ebuild_load_module multilib_functions
+ebuild_load_module install_functions
+ebuild_load_module build_functions
+ebuild_load_module eclass_functions
+
+ebuild_source_profile()
+{
+ if [[ -f ${1}/parent ]] ; then
+ while read line; do
+ ebuild_source_profile $(canonicalise ${1}/${line} )
+ done <${1}/parent
+ fi
+
+ if [[ -f ${1}/make.defaults ]] ; then
+ eval "$(sed -e 's/^\([a-zA-Z0-9\-_]\+=\)/export \1/' ${1}/make.defaults )" || die "Couldn't source ${1}/make.defaults"
+ fi
+
+ if [[ -f ${1}/bashrc ]] ; then
+ source ${1}/bashrc || die "Couldn't source ${1}/bashrc"
+ fi
+}
+
+save_vars="USE USE_EXPAND"
+
+for var in ${save_vars} ; do
+ eval "export save_var_${var}='${!var}'"
+done
+
+if [[ -n "${PALUDIS_PROFILE_DIRS}" ]] ; then
+ for var in ${PALUDIS_PROFILE_DIRS} ; do
+ ebuild_source_profile $(canonicalise "${var}")
+ done
+elif [[ -n "${PALUDIS_PROFILE_DIR}" ]] ; then
+ ebuild_source_profile $(canonicalise "${PALUDIS_PROFILE_DIR}")
+fi
+
+unset ${save_vars}
+
+for f in ${PALUDIS_BASHRC_FILES} ; do
+ if [[ -f ${f} ]] ; then
+ ebuild_notice "debug" "Loading bashrc file ${f}"
+ source ${f}
+ else
+ ebuild_notice "debug" "Skipping bashrc file ${f}"
+ fi
+done
+
+for var in ${save_vars}; do
+ if [[ -n ${!var} ]]; then
+ die "${var} should not be set in bashrc. Aborting."
+ fi
+done
+
+for var in ${save_vars} ; do
+ eval "export ${var}=\${save_var_${var}}"
+done
+
+ebuild_load_ebuild()
+{
+ if [[ -n "${PALUDIS_LOAD_ENVIRONMENT}" ]] ; then
+ bunzip2 < "${PALUDIS_LOAD_ENVIRONMENT}" > ${PALUDIS_TMPDIR}/environment-${CATEGORY}-${PF} \
+ || die "Can't extract ${PALUDIS_LOAD_ENVIRONMENT}"
+
+ sed -i \
+ -e '/^diefunc ()/,/^}/d' \
+ -e '/^perform_hook ()/,/^}/d' \
+ -e '/^ROOTPATH=/d' \
+ -e '/^PATH=/d' \
+ -e '/^T=/d' \
+ -e '/^PALUDIS_TMPDIR=/d' \
+ -e '/^PALUDIS_EBUILD_LOG_LEVEL=/d' \
+ -e '/^PORTDIR=/d' \
+ -e '/^FILESDIR=/d' \
+ -e '/^ECLASSDIR=/d' \
+ -e '/^DISTDIR=/d' \
+ -e '/^PALUDIS_EBUILD_DIR=/d' \
+ -e '/^PALUDIS_COMMAND=/d' \
+ -e '/^ROOT=/d' \
+ "${PALUDIS_TMPDIR}/environment-${CATEGORY}-${PF}"
+
+ source "${PALUDIS_TMPDIR}/environment-${CATEGORY}-${PF}" &>/dev/null \
+ || die "Can't load saved environment"
+
+ rm "${PALUDIS_TMPDIR}/environment-${CATEGORY}-${PF}"
+ fi
+
+ export EBUILD="${1}"
+ if [[ "${CATEGORY}" == "virtual" ]] ; then
+ if [[ -f "${1}" ]] ; then
+ source ${1} || die "Error sourcing ebuild '${1}'"
+ elif [[ -e "${1}" ]] ; then
+ die "'${1}' exists but is not a regular file"
+ fi
+ else
+ [[ -f "${1}" ]] || die "Ebuild '${1}' is not a file"
+ source ${1} || die "Error sourcing ebuild '${1}'"
+ fi
+ [[ ${RDEPEND-unset} == "unset" ]] && RDEPEND="${DEPEND}"
+
+ IUSE="${IUSE} ${E_IUSE}"
+ DEPEND="${DEPEND} ${E_DEPEND}"
+ RDEPEND="${RDEPEND} ${E_RDEPEND}"
+ PDEPEND="${PDEPEND} ${E_PDEPEND}"
+ KEYWORDS="${KEYWORDS} ${E_KEYWORDS}"
+ [[ ${EAPI-unset} == "unset" ]] && EAPI="0"
+}
+
+perform_hook()
+{
+ export HOOK=${1}
+ ebuild_notice "debug" "Starting hook '${HOOK}'"
+
+ local old_sandbox_on="${SANDBOX_ON}"
+ export SANDBOX_ON="0"
+
+ local hook_dir
+ for hook_dir in ${PALUDIS_HOOK_DIRS} ; do
+ [[ -d "${hook_dir}/${HOOK}" ]] || continue
+ local hook_file
+ for hook_file in "${hook_dir}/${HOOK}/"*.bash ; do
+ [[ -e "${hook_file}" ]] || continue
+ ebuild_notice "debug" "Starting hook script '${hook_file}' for '${HOOK}'"
+ if ! bash "${hook_file}" ; then
+ ebuild_notice "warning" "Hook '${hook_file}' returned failure"
+ else
+ ebuild_notice "warning" "Hook '${hook_file}' returned success"
+ fi
+ done
+ done
+
+ export SANDBOX_ON="${old_sandbox_on}"
+}
+
+ebuild_main()
+{
+ local action ebuild="$1"
+ shift
+
+ for action in $@ ; do
+ case ${action} in
+ metadata|variable|init|fetch|merge|unmerge|tidyup|strip)
+ ebuild_load_module builtin_${action}
+ ;;
+
+ unpack|compile|install|test)
+ ebuild_load_module src_${action}
+ ;;
+
+ setup|config|nofetch|preinst|postinst|prerm|postrm)
+ ebuild_load_module pkg_${action}
+ ;;
+
+ *)
+ ebuild_load_module usage_error
+ ebuild_f_usage_error "Unknown action '${action}'"
+ exit 1
+ ;;
+ esac
+ done
+
+ if [[ $1 == metadata ]] || [[ $1 == variable ]] ; then
+ perform_hook ebuild_${action}_pre
+ if [[ $1 != variable ]] || [[ -n "${ebuild}" ]] ; then
+ for f in cut tr date ; do
+ eval "export ebuild_real_${f}=\"$(which $f )\""
+ eval "${f}() { ebuild_notice qa 'global scope ${f}' ; $(which $f ) \"\$@\" ; }"
+ done
+ PATH="" ebuild_load_ebuild "${ebuild}"
+ fi
+ ebuild_f_${1} || die "${1} failed"
+ perform_hook ebuild_${action}_post
+ else
+ ebuild_load_ebuild "${ebuild}"
+ for action in $@ ; do
+ export EBUILD_PHASE="${action}"
+ perform_hook ebuild_${action}_pre
+ ebuild_f_${action} || die "${action} failed"
+ if [[ ${action} == "init" ]] ; then
+ ebuild_load_ebuild "${ebuild}"
+ fi
+ perform_hook ebuild_${action}_post
+ done
+ fi
+}
+
+ebuild_main $@
+
diff --git a/0.4.0/ebuild/echo_functions.bash.in b/0.4.0/ebuild/echo_functions.bash.in
new file mode 100644
index 000000000..4c9978cff
--- /dev/null
+++ b/0.4.0/ebuild/echo_functions.bash.in
@@ -0,0 +1,187 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+@GENERATED_FILE@
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+[[ -z ${PALUDIS_COLOURS} ]] && PALUDIS_COLOURS=@COLOURSCHEME@
+
+COLOUR_GREEN=$'\e[32;01m'
+COLOUR_YELLOW=$'\e[33;01m'
+COLOUR_RED=$'\e[31;01m'
+COLOUR_BLUE=$'\e[34;01m'
+COLOUR_PINK=$'\e[35;01m'
+
+if [[ ${PALUDIS_COLOURS} == pink ]]; then
+ COLOUR_GOOD=${COLOUR_PINK}
+ COLOUR_WARN=${COLOUR_YELLOW}
+ COLOUR_BAD=${COLOUR_RED}
+ COLOUR_BRACKET=${COLOUR_PINK}
+else
+ COLOUR_GOOD=${COLOUR_GREEN}
+ COLOUR_WARN=${COLOUR_YELLOW}
+ COLOUR_BAD=${COLOUR_RED}
+ COLOUR_BRACKET=${COLOUR_BLUE}
+fi
+
+COLOUR_NORMAL=$'\e[0m'
+PALUDIS_ENDCOL=$'\e[A\e['$(( ${COLUMNS:-80} - 7 ))'G'
+
+einfon()
+{
+ echo -ne " ${COLOUR_GOOD}*${COLOUR_NORMAL} $*"
+ PALUDIS_LAST_E_CMD=einfon
+}
+
+einfo()
+{
+ einfon "$*\n"
+ PALUDIS_LAST_E_CMD=einfo
+}
+
+elog()
+{
+ einfo "$@"
+}
+
+ewarn()
+{
+ echo -e " ${COLOUR_WARN}*${COLOUR_NORMAL} $*"
+ PALUDIS_LAST_E_CMD=ewarn
+}
+
+eerror()
+{
+ echo -e " ${COLOUR_BAD}*${COLOUR_NORMAL} $*"
+ PALUDIS_LAST_E_CMD=eerror
+}
+
+ebegin()
+{
+ einfo "$* ..."
+ PALUDIS_LAST_E_CMD=ebegin
+ PALUDIS_LAST_E_LEN=$(( 4 + ${#msg} ))
+}
+
+_eend()
+{
+ local retval=${1:-0} efunc=${2:-eerror} msg
+ shift 2
+
+ if [[ ${retval} == 0 ]]; then
+ msg="${COLOUR_BRACKET}[ ${COLOUR_GOOD}ok${COLOUR_BRACKET} ]${COLOUR_NORMAL}"
+ else
+ if [[ -n "$*" ]]; then
+ ${efunc} $*
+ fi
+ msg="${COLOUR_BRACKET}[ ${COLOUR_BAD}!!${COLOUR_BRACKET} ]${COLOUR_NORMAL}"
+ fi
+
+# printf "%$(( ${COLUMNS:-80} - PALUDIS_LAST_E_LEN - 6))s%b\n" '' "${msg}"
+ echo -e "${PALUDIS_ENDCOL} ${msg}"
+
+ return ${retval}
+}
+
+eend()
+{
+ local retval=${1:-0}
+ shift
+ _eend ${retval} eerror "$*"
+ PALUDIS_LAST_E_CMD=eend
+ return ${retval}
+}
+
+ewend()
+{
+ local retval=${1:-0}
+ shift
+ _eend ${retval} ewarn "$*"
+ PALUDIS_LAST_E_CMD=ewend
+ return ${retval}
+}
+
+use_with()
+{
+ if useq "${1}" ; then
+ echo "--with-${2:-${1}}${3+=${3}}"
+ else
+ echo "--without-${2:-${1}}"
+ fi
+}
+
+use_enable()
+{
+ if useq "${1}" ; then
+ echo "--enable-${2:-${1}}${3+=${3}}"
+ else
+ echo "--disable-${2:-${1}}"
+ fi
+}
+
+ebuild_notice_level()
+{
+ case "$1" in
+ debug)
+ echo "1";
+ ;;
+
+ qa)
+ echo "2";
+ ;;
+
+ warning)
+ echo "3";
+ ;;
+
+ silent)
+ echo "4";
+ ;;
+
+ *)
+ echo "[WARNING.EBUILD] Bad value '$1' for qa level" 1>&2
+ echo "2";
+ ;;
+ esac
+}
+
+ebuild_notice()
+{
+ local level="$1"
+ shift
+
+ local level_num=$(ebuild_notice_level "${level}" )
+ local min_level_num=$(ebuild_notice_level "${PALUDIS_EBUILD_LOG_LEVEL}" )
+
+ if [[ "${level_num}" -ge "${min_level_num}" ]] ; then
+ local upper_level=$(echo ${level} | ${ebuild_real_tr:-tr} '[:lower:]' '[:upper:]' )
+ echo -n "${EBUILD_PROGRAM_NAME:-ebuild.bash}@$(${ebuild_real_date:-date} +%s ): " 1>&2
+ echo "[${upper_level}.EBUILD] $* (from ${EBUILD:-?})" 1>&2
+ fi
+ true
+}
+
+ebuild_section()
+{
+ echo ">>> $*"
+}
+
diff --git a/0.4.0/ebuild/echo_functions_TEST.bash b/0.4.0/ebuild/echo_functions_TEST.bash
new file mode 100644
index 000000000..4c8591817
--- /dev/null
+++ b/0.4.0/ebuild/echo_functions_TEST.bash
@@ -0,0 +1,45 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# 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
+
+use_with_TEST()
+{
+ export USE="foo"
+ test_equality "$(use_with foo )" "--with-foo"
+ test_equality "$(use_with foo bar )" "--with-bar"
+ test_equality "$(use_with foo bar baz )" "--with-bar=baz"
+
+ export USE="oink"
+ test_equality "$(use_with foo )" "--without-foo"
+ test_equality "$(use_with foo bar )" "--without-bar"
+ test_equality "$(use_with foo bar baz )" "--without-bar"
+}
+
+
+use_enable_TEST()
+{
+ export USE="foo"
+ test_equality "$(use_enable foo )" "--enable-foo"
+ test_equality "$(use_enable foo bar )" "--enable-bar"
+ test_equality "$(use_enable foo bar baz )" "--enable-bar=baz"
+
+ export USE="oink"
+ test_equality "$(use_enable foo )" "--disable-foo"
+ test_equality "$(use_enable foo bar )" "--disable-bar"
+ test_equality "$(use_enable foo bar baz )" "--disable-bar"
+}
+
diff --git a/0.4.0/ebuild/eclass_functions.bash b/0.4.0/ebuild/eclass_functions.bash
new file mode 100644
index 000000000..1c742e661
--- /dev/null
+++ b/0.4.0/ebuild/eclass_functions.bash
@@ -0,0 +1,84 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+EXPORT_FUNCTIONS()
+{
+ [[ -z "${ECLASS}" ]] && die "EXPORT_FUNCTIONS called but ECLASS undefined"
+
+ local e
+ for e in "$@" ; do
+ case "$e" in
+ pkg_setup|pkg_prerm|pkg_postrm|pkg_preinst|pkg_postinst)
+ eval "${e}() { ${ECLASS}_${e} \"\$@\" ; }"
+ ;;
+
+ src_unpack|src_compile|src_install|src_test)
+ eval "${e}() { ${ECLASS}_${e} \"\$@\" ; }"
+ ;;
+
+ *)
+ eval "${e}() { ${ECLASS}_${e} \"\$@\" ; }"
+ ebuild_notice "qa" "$e should not be in EXPORT_FUNCTIONS for ${ECLASS}"
+ ;;
+ esac
+ done
+}
+
+inherit()
+{
+ [[ -n "${PALUDIS_SKIP_INHERIT}" ]] && return
+
+ local e ee location=
+ for e in "$@" ; do
+ for ee in ${ECLASSDIRS:-${ECLASSDIR}} ; do
+ [[ -f "${ee}/${e}.eclass" ]] && location="${ee}/${e}.eclass"
+ done
+ local old_ECLASS="${ECLASS}"
+ export ECLASS="${e}"
+
+ local current_IUSE="${IUSE}" current_DEPEND="${DEPEND}"
+ local current_RDEPEND="${RDEPEND}" current_PDEPEND="${PDEPEND}"
+ local current_KEYWORDS="${KEYWORDS}"
+
+ unset IUSE DEPEND RDEPEND PDEPEND KEYWORDS
+
+ [[ -z "${location}" ]] && die "Error finding eclass ${e}"
+ source "${location}" || die "Error sourcing eclass ${e}"
+ hasq "${ECLASS}" ${INHERITED} || export INHERITED="${INHERITED} ${ECLASS}"
+
+ E_IUSE="${E_IUSE} ${IUSE}"
+ E_PDEPEND="${E_PDEPEND} ${PDEPEND}"
+ E_RDEPEND="${E_RDEPEND} ${RDEPEND}"
+ E_DEPEND="${E_DEPEND} ${DEPEND}"
+ E_KEYWORDS="${KEYWORDS:+${KEYWORDS} }${E_KEYWORDS}"
+
+ IUSE="${current_IUSE}"
+ DEPEND="${current_DEPEND}"
+ RDEPEND="${current_RDEPEND}"
+ PDEPEND="${current_PDEPEND}"
+ KEYWORDS="${current_KEYWORDS}"
+
+ export ECLASS="${old_ECLASS}"
+ done
+}
+
diff --git a/0.4.0/ebuild/fetchers/Makefile.am b/0.4.0/ebuild/fetchers/Makefile.am
new file mode 100644
index 000000000..4b57221b7
--- /dev/null
+++ b/0.4.0/ebuild/fetchers/Makefile.am
@@ -0,0 +1,27 @@
+MAINTAINERCLEANFILES = Makefile.in
+CLEANFILES = *~ dohttp dohttps doftp
+SUBDIRS = .
+
+libexecprogdir = $(libexecdir)/paludis/fetchers/
+
+libexecprog_SCRIPTS = \
+ dohttp \
+ dohttps \
+ doftp \
+ dofile
+
+TESTS_ENVIRONMENT = env \
+ PALUDIS_EBUILD_DIR="$(srcdir)/ebuild/" \
+ TEST_SCRIPT_DIR="$(srcdir)/" \
+ bash $(top_srcdir)/test/run_test.sh
+
+TESTS =
+EXTRA_DIST = $(libexecprog_SCRIPTS) dowget.in
+
+check_SCRIPTS =
+check_PROGRAMS = $(TESTS)
+
+AM_CXXFLAGS = -I$(top_srcdir)
+
+dohttp dohttps doftp : dowget.in
+ cat $< > $@
diff --git a/0.4.0/ebuild/fetchers/dofile b/0.4.0/ebuild/fetchers/dofile
new file mode 100755
index 000000000..fd3e54bf5
--- /dev/null
+++ b/0.4.0/ebuild/fetchers/dofile
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+shopt -s extglob
+echo cp "/${1##file:+(/)}" "${2}" 1>&2
+cp "/${1##file:+(/)}" "${2}"
+
diff --git a/0.4.0/ebuild/fetchers/dowget.in b/0.4.0/ebuild/fetchers/dowget.in
new file mode 100755
index 000000000..a6d800722
--- /dev/null
+++ b/0.4.0/ebuild/fetchers/dowget.in
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+echo ${WGET_WRAPPER} ${LOCAL_WGET:-wget} ${EXTRA_WGET} -T 30 -t 1 -O "${2}" "${1}" 1>&2
+if ${WGET_WRAPPER} ${LOCAL_WGET:-wget} ${EXTRA_WGET} -T 30 -t 1 -O "${2}" "${1}" ; then
+ exit 0
+else
+ rm -f "${2}"
+ exit 1
+fi
+
diff --git a/0.4.0/ebuild/install_functions.bash b/0.4.0/ebuild/install_functions.bash
new file mode 100644
index 000000000..3bab4077e
--- /dev/null
+++ b/0.4.0/ebuild/install_functions.bash
@@ -0,0 +1,110 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+umask 022
+export DESTTREE="/usr"
+export INSDESTTREE=""
+export EXEDESTTREE=""
+export DOCDESTTREE=""
+export INSOPTIONS="-m0644"
+export EXEOPTIONS="-m0755"
+export LIBOPTIONS="-m0644"
+export DIROPTIONS="-m0755"
+export MOPREFIX="${PN}"
+
+keepdir()
+{
+ dodir "$@"
+ if [[ "${1}" == "-R" ]] || [[ "${1}" == "-r" ]] ; then
+ shift
+ find "$@" -type d -printf "${D}/%p/.keep\0" | xargs -0 touch
+ assert "Failed to create .keep files"
+ else
+ local f
+ for f in "$@" ; do
+ touch "${D}/${f}/.keep" || die "Couldn't touch .keep in ${f}"
+ done
+ fi
+}
+
+into()
+{
+ if [[ "${1}" == "/" ]] ; then
+ export DESTTREE=
+ else
+ export DESTTREE="${1}"
+ [[ -d "${D}${DESTTREE}" ]] || install -d "${D}${DESTTREE}"
+ fi
+}
+
+insinto()
+{
+ if [[ "${1}" == "/" ]] ; then
+ export INSDESTTREE=
+ else
+ export INSDESTTREE="${1}"
+ [[ -d "${D}${INSDESTTREE}" ]] || install -d "${D}${INSDESTTREE}"
+ fi
+}
+
+exeinto()
+{
+ if [[ "${1}" == "/" ]] ; then
+ export EXEDESTTREE=
+ else
+ export EXEDESTTREE="${1}"
+ [[ -d "${D}${EXEDESTTREE}" ]] || install -d "${D}${EXEDESTTREE}"
+ fi
+}
+
+docinto()
+{
+ if [[ "${1}" == "/" ]] ; then
+ export DOCDESTTREE=
+ else
+ export DOCDESTTREE="${1}"
+ [[ -d "${D}usr/share/doc/${PF}/${DOCDESTTREE}" ]] || \
+ install -d "${D}usr/share/doc/${PF}/${DOCDESTTREE}"
+ fi
+}
+
+insopts()
+{
+ export INSOPTIONS="$@"
+}
+
+diropts()
+{
+ export DIROPTIONS="$@"
+}
+
+exeopts()
+{
+ export EXEOPTIONS="$@"
+}
+
+libopts()
+{
+ export LIBOPTIONS="$@"
+}
+
diff --git a/0.4.0/ebuild/kernel_functions.bash b/0.4.0/ebuild/kernel_functions.bash
new file mode 100644
index 000000000..554df653e
--- /dev/null
+++ b/0.4.0/ebuild/kernel_functions.bash
@@ -0,0 +1,60 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon functions.sh from Baselayout, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+KV_major()
+{
+ [[ -z $1 ]] && return 1
+ local KV=$@
+ echo ${KV%%.*}
+}
+
+KV_minor()
+{
+ [[ -z $1 ]] && return 1
+ local KV=$@
+ KV=${KV#*.}
+ echo ${KV%%.*}
+}
+
+KV_micro()
+{
+ [[ -z $1 ]] && return 1
+ local KV=$@
+ KV=${KV#*.*.}
+ echo ${KV%%[^[:digit:]]*}
+}
+
+KV_to_int()
+{
+ [[ -z $1 ]] && return 1
+
+ local major=$(KV_major "$1")
+ local minor=$(KV_minor "$1")
+ local micro=$(KV_micro "$1")
+ echo $(( major * 65536 + minor * 256 + micro ))
+}
+
+get_KV()
+{
+ echo $(KV_to_int "$(uname -r)")
+}
diff --git a/0.4.0/ebuild/kernel_functions_TEST.bash b/0.4.0/ebuild/kernel_functions_TEST.bash
new file mode 100644
index 000000000..de3a74f2c
--- /dev/null
+++ b/0.4.0/ebuild/kernel_functions_TEST.bash
@@ -0,0 +1,42 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+KV_major_TEST()
+{
+ test_equality "$(KV_major 2.4.6)" "2"
+}
+
+KV_minor_TEST()
+{
+ test_equality "$(KV_minor 2.6.16)" "6"
+ test_equality "$(KV_minor 2.6.7-gentoo-r1)" "6"
+ test_equality "$(KV_minor 2.4.18-rc1)" "4"
+}
+
+KV_micro_TEST()
+{
+ test_equality "$(KV_micro 2.6.0)" "0"
+ test_equality "$(KV_micro 2.5.63-mm8)" "63"
+ test_equality "$(KV_micro 2.2.0-foo1)" "0"
+}
+
+KV_to_int_TEST()
+{
+ test_equality "$(KV_to_int 2.6.16)" "132624"
+}
diff --git a/0.4.0/ebuild/list_functions.bash b/0.4.0/ebuild/list_functions.bash
new file mode 100644
index 000000000..53557cb67
--- /dev/null
+++ b/0.4.0/ebuild/list_functions.bash
@@ -0,0 +1,71 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+use()
+{
+ useq "${1}"
+}
+
+usev()
+{
+ if useq "${1}" ; then
+ echo "${1#!}"
+ return 0
+ else
+ return 1
+ fi
+}
+
+useq()
+{
+ if [[ "${1:0:1}" == "!" ]] ; then
+ ! hasq "${1#!}" "${USE}"
+ else
+ hasq "${1}" "${USE}"
+ fi
+}
+
+has()
+{
+ hasq "${@}"
+}
+
+hasv()
+{
+ if hasq "${@}" ; then
+ echo "${1}"
+ return 0
+ else
+ return 1
+ fi
+}
+
+hasq()
+{
+ local x= want="$1"
+ shift
+ for x in $@ ; do
+ [[ "${x}" == "${want}" ]] && return 0
+ done
+ return 1
+}
diff --git a/0.4.0/ebuild/list_functions_TEST.bash b/0.4.0/ebuild/list_functions_TEST.bash
new file mode 100644
index 000000000..3bbbc709b
--- /dev/null
+++ b/0.4.0/ebuild/list_functions_TEST.bash
@@ -0,0 +1,74 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# 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
+
+use_TEST()
+{
+ export USE="foo bar"
+
+ use foo ; test_return_code
+ use bar ; test_return_code
+ ! use baz ; test_return_code
+ ! use foofoo ; test_return_code
+ ! use fo ; test_return_code
+
+ ! use !foo ; test_return_code
+ ! use !bar ; test_return_code
+ use !baz ; test_return_code
+ use !foofoo ; test_return_code
+ use !fo ; test_return_code
+}
+
+usev_TEST()
+{
+ export USE="foo bar"
+ usev foo 1>/dev/null ; test_return_code
+ test_equality "$(usev foo)" "foo"
+
+ usev bar 1>/dev/null ; test_return_code
+ test_equality "$(usev bar)" "bar"
+
+ ! usev baz 1>/dev/null ; test_return_code
+ test_equality "$(usev baz)" ""
+
+ ! usev !foo 1>/dev/null ; test_return_code
+ test_equality "$(usev !foo)" ""
+
+ ! usev !bar 1>/dev/null ; test_return_code
+ test_equality "$(usev !bar)" ""
+
+ ! usev baz 1>/dev/null ; test_return_code
+ test_equality "$(usev !baz)" "baz"
+}
+
+useq_TEST()
+{
+ export USE="foo bar"
+
+ useq foo ; test_return_code
+ useq bar ; test_return_code
+ ! useq baz ; test_return_code
+ ! useq foofoo ; test_return_code
+ ! useq fo ; test_return_code
+
+ ! useq !foo ; test_return_code
+ ! useq !bar ; test_return_code
+ useq !baz ; test_return_code
+ useq !foofoo ; test_return_code
+ useq !fo ; test_return_code
+}
+
diff --git a/0.4.0/ebuild/multilib_functions.bash b/0.4.0/ebuild/multilib_functions.bash
new file mode 100644
index 000000000..181339609
--- /dev/null
+++ b/0.4.0/ebuild/multilib_functions.bash
@@ -0,0 +1,67 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+# Default values. Those used on a non-multilib profile.
+export MULTILIB_ABIS=${MULTILIB_ABIS:-"default"}
+export DEFAULT_ABI=${DEFAULT_ABI:-"default"}
+export CFLAGS_default
+export LDFLAGS_default
+export CHOST_default=${CHOST_default:-${CHOST}}
+export CTARGET_default=${CTARGET_default:-${CTARGET:-${CHOST_default}}}
+export LIBDIR_default=${CONF_LIBDIR:-"lib"}
+export CDEFINE_default
+
+
+ebuild_get_libdir() {
+ local CONF_LIBDIR
+ if [[ -n "${CONF_LIBDIR_OVERRIDE}" ]]; then
+ echo ${CONF_LIBDIR_OVERRIDE}
+ else
+ ebuild_get_abi_LIBDIR
+ fi
+}
+
+ebuild_get_abi_var() {
+ local flag=$1
+ local abi
+ if [[ $# -gt 1 ]]; then
+ abi=${2}
+ elif [[ -n "${ABI}" ]]; then
+ abi=${ABI}
+ elif [[ -n "${DEFAULT_ABI}" ]]; then
+ abi=${DEFAULT_ABI}
+ else
+ abi="default"
+ fi
+
+ local var="${flag}_${abi}"
+ echo ${!var}
+}
+
+ebuild_get_abi_CFLAGS() { ebuild_get_abi_var CFLAGS "$@"; }
+ebuild_get_abi_LDFLAGS() { ebuild_get_abi_var LDFLAGS "$@"; }
+ebuild_get_abi_CHOST() { ebuild_get_abi_var CHOST "$@"; }
+ebuild_get_abi_CTARGET() { ebuild_get_abi_var CTARGET "$@"; }
+ebuild_get_abi_FAKE_TARGETS() { ebuild_get_abi_var FAKE_TARGETS "$@"; }
+ebuild_get_abi_CDEFINE() { ebuild_get_abi_var CDEFINE "$@"; }
+ebuild_get_abi_LIBDIR() { ebuild_get_abi_var LIBDIR "$@"; }
diff --git a/0.4.0/ebuild/pkg_config.bash b/0.4.0/ebuild/pkg_config.bash
new file mode 100644
index 000000000..a141d7a31
--- /dev/null
+++ b/0.4.0/ebuild/pkg_config.bash
@@ -0,0 +1,28 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+pkg_config()
+{
+ eerror "No configuration function is defined"
+}
+
diff --git a/0.4.0/ebuild/pkg_nofetch.bash b/0.4.0/ebuild/pkg_nofetch.bash
new file mode 100644
index 000000000..fb509db33
--- /dev/null
+++ b/0.4.0/ebuild/pkg_nofetch.bash
@@ -0,0 +1,62 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+pkg_nofetch()
+{
+ [[ -z "${A}" ]] && return
+
+ local f g=
+ for f in ${A} ; do
+ [[ -f "${DISTDIR}/${A}" ]] && continue
+ if [[ -z "${g}" ]] ; then
+ echo "The following files could not be fetched automatically for ${PN}:"
+ g=no
+ fi
+ echo "* ${f}"
+ done
+}
+
+ebuild_f_nofetch()
+{
+ local old_sandbox_write="${SANDBOX_WRITE}"
+ SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${DISTDIR}"
+ if hasq "nofetch" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping pkg_nofetch (SKIP_FUNCTIONS)"
+ else
+ local a f=
+ for a in ${A} ; do
+ [[ -f "${DISTDIR}/${a}" ]] && continue
+ f=yes
+ done
+
+ if [[ -z "${f}" ]] ; then
+ ebuild_section "Skipping pkg_nofetch (fully fetched already)"
+ else
+ ebuild_section "Starting pkg_nofetch"
+ pkg_nofetch
+ ebuild_section "Done pkg_nofetch"
+ die "Manual fetching is required"
+ fi
+ fi
+ SANDBOX_WRITE="${old_sandbox_write}"
+}
diff --git a/0.4.0/ebuild/pkg_postinst.bash b/0.4.0/ebuild/pkg_postinst.bash
new file mode 100644
index 000000000..ac28a4b0d
--- /dev/null
+++ b/0.4.0/ebuild/pkg_postinst.bash
@@ -0,0 +1,46 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+pkg_postinst()
+{
+ :
+}
+
+ebuild_f_postinst()
+{
+ local old_sandbox_write="${SANDBOX_WRITE}"
+ SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${ROOT%/}/"
+
+ if hasq "postinst" ${RESTRICT} ; then
+ ebuild_section "Skipping pkg_postinst (RESTRICT)"
+ elif hasq "postinst" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping pkg_postinst (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting pkg_postinst"
+ pkg_postinst
+ ebuild_section "Done pkg_postinst"
+ fi
+
+ SANDBOX_WRITE="${old_sandbox_write}"
+}
+
diff --git a/0.4.0/ebuild/pkg_postrm.bash b/0.4.0/ebuild/pkg_postrm.bash
new file mode 100644
index 000000000..ac8d76a40
--- /dev/null
+++ b/0.4.0/ebuild/pkg_postrm.bash
@@ -0,0 +1,47 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+pkg_postrm()
+{
+ :
+}
+
+ebuild_f_postrm()
+{
+ local old_sandbox_write="${SANDBOX_WRITE}"
+ SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${ROOT%/}/"
+
+ if hasq "postrm" ${RESTRICT} ; then
+ ebuild_section "Skipping pkg_postrm (RESTRICT)"
+ elif hasq "postrm" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping pkg_postrm (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting pkg_postrm"
+ pkg_postrm
+ ebuild_section "Done pkg_postrm"
+ fi
+
+ SANDBOX_WRITE="${old_sandbox_write}"
+}
+
+
diff --git a/0.4.0/ebuild/pkg_preinst.bash b/0.4.0/ebuild/pkg_preinst.bash
new file mode 100644
index 000000000..943e7bdc0
--- /dev/null
+++ b/0.4.0/ebuild/pkg_preinst.bash
@@ -0,0 +1,46 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+pkg_preinst()
+{
+ :
+}
+
+ebuild_f_preinst()
+{
+ local old_sandbox_write="${SANDBOX_WRITE}"
+ SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${ROOT%/}/"
+
+ if hasq "preinst" ${RESTRICT} ; then
+ ebuild_section "Skipping pkg_preinst (RESTRICT)"
+ elif hasq "preinst" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping pkg_preinst (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting pkg_preinst"
+ pkg_preinst
+ ebuild_section "Done pkg_preinst"
+ fi
+
+ SANDBOX_WRITE="${old_sandbox_write}"
+}
+
diff --git a/0.4.0/ebuild/pkg_prerm.bash b/0.4.0/ebuild/pkg_prerm.bash
new file mode 100644
index 000000000..cc353f1d5
--- /dev/null
+++ b/0.4.0/ebuild/pkg_prerm.bash
@@ -0,0 +1,46 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+pkg_prerm()
+{
+ :
+}
+
+ebuild_f_prerm()
+{
+ local old_sandbox_write="${SANDBOX_WRITE}"
+ SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${ROOT%/}/"
+
+ if hasq "prerm" ${RESTRICT} ; then
+ ebuild_section "Skipping pkg_prerm (RESTRICT)"
+ elif hasq "prerm" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping pkg_prerm (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting pkg_prerm"
+ pkg_prerm
+ ebuild_section "Done pkg_prerm"
+ fi
+
+ SANDBOX_WRITE="${old_sandbox_write}"
+}
+
diff --git a/0.4.0/ebuild/pkg_setup.bash b/0.4.0/ebuild/pkg_setup.bash
new file mode 100644
index 000000000..75cf2f638
--- /dev/null
+++ b/0.4.0/ebuild/pkg_setup.bash
@@ -0,0 +1,46 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+pkg_setup()
+{
+ :
+}
+
+ebuild_f_setup()
+{
+ local old_sandbox_write="${SANDBOX_WRITE}"
+ SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${ROOT%/}/"
+
+ if hasq "setup" ${RESTRICT} ; then
+ ebuild_section "Skipping pkg_setup (RESTRICT)"
+ elif hasq "setup" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping pkg_setup (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting pkg_setup"
+ pkg_setup
+ ebuild_section "Done pkg_setup"
+ fi
+
+ SANDBOX_WRITE="${old_sandbox_write}"
+}
+
diff --git a/0.4.0/ebuild/portage_stubs.bash b/0.4.0/ebuild/portage_stubs.bash
new file mode 100644
index 000000000..30a14114e
--- /dev/null
+++ b/0.4.0/ebuild/portage_stubs.bash
@@ -0,0 +1,78 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+has_version()
+{
+ ${PALUDIS_COMMAND} --has-version "$@"
+}
+
+portageq()
+{
+ # \todo Make this suck less...
+ if [[ "$1" == "has_version" ]] ; then
+ if [[ "$(canonicalise $2 )" != "$(canonicalise $ROOT )" ]] ; then
+ eerror "Error emulating 'portageq $@':"
+ die "portageq has_version emulation only works on current ROOT"
+ else
+ shift ; shift
+ has_version "$@"
+ fi
+ elif [[ "$1" == "best_version" ]] ; then
+ if [[ "$(canonicalise $2 )" != "$(canonicalise $ROOT )" ]] ; then
+ eerror "Error emulating 'portageq $@':"
+ die "portageq best_version emulation only works on current ROOT"
+ else
+ shift ; shift
+ best_version "$@"
+ fi
+ else
+ eerror "Error emulating 'portageq $@':"
+ die "portageq emulation for $1 not implemented"
+ fi
+}
+
+best_version()
+{
+ ${PALUDIS_COMMAND} --best-version "$@"
+}
+
+check_KV()
+{
+ die "check_KV not implenented"
+}
+
+debug-print()
+{
+ :
+}
+
+debug-print-function()
+{
+ :
+}
+
+debug-print-section()
+{
+ :
+}
+
diff --git a/0.4.0/ebuild/run_test.bash b/0.4.0/ebuild/run_test.bash
new file mode 100644
index 000000000..b5587b9d1
--- /dev/null
+++ b/0.4.0/ebuild/run_test.bash
@@ -0,0 +1,47 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+shopt -s expand_aliases
+shopt -s extglob
+set +o posix
+
+export TEST_STATUS=
+export PALUDIS_IN_TEST_FRAMEWORK="yes"
+
+test_return_code()
+{
+ local r="$?"
+ if [[ "0" == "${r}" ]] ; then
+ echo -n "."
+ else
+ echo -n "!{retcode: ${r}}"
+ export local_test_status="fail"
+ export TEST_STATUS="fail"
+ fi
+}
+
+test_equality()
+{
+ if [[ "${1}" == "${2}" ]] ; then
+ echo -n "."
+ else
+ echo -n "!{'${1}' not equal to '${2}'}"
+ export local_test_status="fail"
+ export TEST_STATUS="fail"
+ fi
+}
+
+echo "Test program ${1}:"
+source "$(dirname ${1} )/ebuild.bash" || exit 200
+source "${1}" || exit 200
+
+for testname in $(set | grep '_TEST *() *$' ) ; do
+ [[ ${testname/()} != ${testname} ]] && continue
+ echo -n "* ${testname%_TEST}: "
+ export local_test_status=""
+ ${testname}
+ [[ -z "$local_test_status" ]] && echo " OK" || echo " FAIL"
+done
+
+[[ -z "$TEST_STATUS" ]]
+
diff --git a/0.4.0/ebuild/sandbox.bash b/0.4.0/ebuild/sandbox.bash
new file mode 100644
index 000000000..d54325c5b
--- /dev/null
+++ b/0.4.0/ebuild/sandbox.bash
@@ -0,0 +1,43 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+addread()
+{
+ export SANDBOX_READ="${SANDBOX_READ+${SANDBOX_READ}:}${1}"
+}
+
+addwrite()
+{
+ export SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${1}"
+}
+
+adddeny()
+{
+ export SANDBOX_DENY="${SANDBOX_DENY+${SANDBOX_DENY}:}${1}"
+}
+
+addpredict()
+{
+ export SANDBOX_PREDICT="${SANDBOX_PREDICT+${SANDBOX_PREDICT}:}${1}"
+}
+
diff --git a/0.4.0/ebuild/src_compile.bash b/0.4.0/ebuild/src_compile.bash
new file mode 100644
index 000000000..8bf66a5bc
--- /dev/null
+++ b/0.4.0/ebuild/src_compile.bash
@@ -0,0 +1,47 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+src_compile()
+{
+ [[ -x ./configure ]] && econf
+ if [[ -f Makefile ]] || [[ -f makefile ]] || [[ -f GNUmakefile ]] ; then
+ emake || die "emake failed"
+ fi
+}
+
+ebuild_f_compile()
+{
+ mkdir -p ${S}
+ cd ${S} || die "cd to \${S} (\"${S}\") failed"
+
+ if hasq "compile" ${RESTRICT} ; then
+ ebuild_section "Skipping src_compile (RESTRICT)"
+ elif hasq "compile" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping src_compile (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting src_compile"
+ src_compile
+ ebuild_section "Done src_compile"
+ fi
+}
+
diff --git a/0.4.0/ebuild/src_install.bash b/0.4.0/ebuild/src_install.bash
new file mode 100644
index 000000000..42fe02996
--- /dev/null
+++ b/0.4.0/ebuild/src_install.bash
@@ -0,0 +1,43 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+src_install()
+{
+ :
+}
+
+ebuild_f_install()
+{
+ cd ${S} || die "cd to \${S} (\"${S}\") failed"
+
+ if hasq "install" ${RESTRICT} ; then
+ ebuild_section "Skipping src_install (RESTRICT)"
+ elif hasq "install" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping src_install (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting src_install"
+ src_install
+ ebuild_section "Done src_install"
+ fi
+}
+
diff --git a/0.4.0/ebuild/src_test.bash b/0.4.0/ebuild/src_test.bash
new file mode 100644
index 000000000..a34013c30
--- /dev/null
+++ b/0.4.0/ebuild/src_test.bash
@@ -0,0 +1,59 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+src_test()
+{
+ if [[ -f Makefile ]] || [[ -f GNUmakefile ]] || [[ -f makefile ]] ; then
+ echo "Makefile found, looking for potential test targets"
+ if make -j1 -n check ; then
+ echo "Found check target"
+ emake -j1 check || die "make check failed"
+ elif make -j1 -n test ; then
+ echo "Found test target"
+ emake -j1 test || die "make test failed"
+ else
+ echo "No check or test target, skipping tests"
+ fi
+ else
+ echo "No Makefile, skipping tests"
+ fi
+}
+
+ebuild_f_test()
+{
+ local old_sandbox_predict="${SANDBOX_PREDICT}"
+ SANDBOX_PREDICT="${SANDBOX_PREDICT+${SANDBOX_PREDICT}:}/"
+
+ if hasq "test" ${RESTRICT} ; then
+ ebuild_section "Skipping src_test (RESTRICT)"
+ elif hasq "test" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping src_test (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting src_test"
+ src_test
+ ebuild_section "Done src_test"
+ fi
+
+ SANDBOX_PREDICT="${old_sandbox_predict}"
+}
+
diff --git a/0.4.0/ebuild/src_unpack.bash b/0.4.0/ebuild/src_unpack.bash
new file mode 100644
index 000000000..a309c6054
--- /dev/null
+++ b/0.4.0/ebuild/src_unpack.bash
@@ -0,0 +1,43 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+src_unpack()
+{
+ [[ -n "${A}" ]] && unpack ${A}
+}
+
+ebuild_f_unpack()
+{
+ cd ${WORKDIR} || die "cd to \${WORKDIR} (\"${WORKDIR}\") failed"
+
+ if hasq "unpack" ${RESTRICT} ; then
+ ebuild_section "Skipping src_unpack (RESTRICT)"
+ elif hasq "unpack" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping src_unpack (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting src_unpack"
+ src_unpack
+ ebuild_section "Done src_unpack"
+ fi
+}
+
diff --git a/0.4.0/ebuild/usage_error.bash b/0.4.0/ebuild/usage_error.bash
new file mode 100644
index 000000000..165d8a91c
--- /dev/null
+++ b/0.4.0/ebuild/usage_error.bash
@@ -0,0 +1,32 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+ebuild_f_usage_error()
+{
+ if [[ -z ${1} ]] ; then
+ die "Usage error"
+ else
+ die "Usage error: ${1}"
+ fi
+}
+
diff --git a/0.4.0/ebuild/utils/Makefile.am b/0.4.0/ebuild/utils/Makefile.am
new file mode 100644
index 000000000..063e944f1
--- /dev/null
+++ b/0.4.0/ebuild/utils/Makefile.am
@@ -0,0 +1,124 @@
+MAINTAINERCLEANFILES = Makefile.in
+CLEANFILES = *~ newlib.so newlib.a dolib.so dolib.a sed
+
+libexecprogdir = $(libexecdir)/paludis/utils
+
+if NEED_SED_WRAPPER
+libexecprog_SCRIPTS_extra = sed
+endif
+
+libexecprog_SCRIPTS = \
+ canonicalise \
+ dobin \
+ doconfd \
+ dodir \
+ dodoc \
+ doenvd \
+ doexe \
+ dohard \
+ dohtml \
+ doinfo \
+ doinitd \
+ doins \
+ dolib \
+ dolib.a \
+ dolib.so \
+ doman \
+ domo \
+ donewins \
+ dosbin \
+ dosed \
+ dosym \
+ dounpack \
+ emake \
+ fowners \
+ fperms \
+ getmtime \
+ newbin \
+ newconfd \
+ newdoc \
+ newenvd \
+ newexe \
+ newinitd \
+ newins \
+ newlib.a \
+ newlib.so \
+ newman \
+ newsbin \
+ prepall \
+ prepallstrip \
+ prepstrip \
+ prepallman \
+ prepman \
+ prepallinfo \
+ prepinfo \
+ $(libexecprog_SCRIPTS_extra)
+
+libexecprog_PROGRAMS = merge unmerge
+AM_CXXFLAGS = -I$(top_srcdir)
+
+merge_SOURCES = merge.cc merge_common.cc merge_common.hh
+merge_LDADD = \
+ $(top_builddir)/paludis/util/libpaludisutil.a \
+ $(top_builddir)/paludis/digests/libpaludisdigests.a \
+ $(top_builddir)/paludis/selinux/libpaludisselinux.a \
+ $(DYNAMIC_LD_LIBS)
+
+unmerge_SOURCES = unmerge.cc merge_common.cc merge_common.hh
+unmerge_LDADD = \
+ $(top_builddir)/paludis/util/libpaludisutil.a \
+ $(top_builddir)/paludis/digests/libpaludisdigests.a
+
+TESTS_ENVIRONMENT = env \
+ PALUDIS_EBUILD_DIR="`$(top_srcdir)/ebuild/utils/canonicalise $(top_srcdir)/ebuild/`" \
+ TOP_BUILD_DIR="`$(top_srcdir)/ebuild/utils/canonicalise $(top_builddir)/`" \
+ PALUDIS_EBUILD_LOG_LEVEL="silent" \
+ TEST_SCRIPT_DIR="$(srcdir)/" \
+ bash $(top_srcdir)/ebuild/utils/run_test.bash
+
+TESTS = merge_TEST.bash dobin_TEST.bash unmerge_TEST.bash
+check_SCRIPTS = $(TESTS) \
+ merge_TEST_setup.sh merge_TEST_cleanup.sh \
+ unmerge_TEST_setup.sh unmerge_TEST_cleanup.sh
+
+EXTRA_DIST = $(libexecprog_SCRIPTS) $(check_SCRIPTS) run_test.bash \
+ newlib.so.in newlib.a.in dolib.so.in dolib.a.in prep.in
+
+newlib.a : newlib.a.in
+ cat $< > $@
+
+newlib.so : newlib.so.in
+ cat $< > $@
+
+dolib.so : dolib.so.in
+ cat $< > $@
+
+dolib.a : dolib.a.in
+ cat $< > $@
+
+sed : sed.in
+ cat $< > $@
+
+prepall: prep.in
+ cat $< >$@
+
+prepallstrip: prep.in
+ cat $< >$@
+
+prepstrip: prep.in
+ cat $< >$@
+
+prepallman: prep.in
+ cat $< >$@
+
+prepman: prep.in
+ cat $< >$@
+
+prepallinfo: prep.in
+ cat $< >$@
+
+prepinfo: prep.in
+ cat $< >$@
+
+check_PROGRAMS =
+
diff --git a/0.4.0/ebuild/utils/canonicalise b/0.4.0/ebuild/utils/canonicalise
new file mode 100755
index 000000000..d070f3450
--- /dev/null
+++ b/0.4.0/ebuild/utils/canonicalise
@@ -0,0 +1,6 @@
+#!/bin/bash
+case $(uname -s) in
+ FreeBSD) realpath $@ ;;
+ *) readlink -f $@ ;;
+esac
+
diff --git a/0.4.0/ebuild/utils/dobin b/0.4.0/ebuild/utils/dobin
new file mode 100755
index 000000000..506f50f0f
--- /dev/null
+++ b/0.4.0/ebuild/utils/dobin
@@ -0,0 +1,48 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon dobin from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+if [[ ! -d ${D} ]]; then
+ echo "${0}: \${D} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -lt 1 ]]; then
+ echo "${0}: at least one argument needed" >&2
+ exit 1
+fi
+
+if [[ ! -d "${D}${DESTTREE}/bin" ]]; then
+ install -d "${D}${DESTTREE}/bin" || exit 3
+fi
+
+ret=0
+for x in "$@" ; do
+ if [[ -x "${x}" ]]; then
+ install "${x}" "${D}${DESTTREE}/bin" || ret=2
+ else
+ echo ">>> ${0}: making ${x} executable..."
+ install -m0755 -o root -g 0 "${x}" "${D}${DESTTREE}/bin" || ret=2
+ fi
+done
+
+exit ${ret}
diff --git a/0.4.0/ebuild/utils/dobin_TEST.bash b/0.4.0/ebuild/utils/dobin_TEST.bash
new file mode 100644
index 000000000..b9d0d9c43
--- /dev/null
+++ b/0.4.0/ebuild/utils/dobin_TEST.bash
@@ -0,0 +1,70 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# 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
+
+source ${PALUDIS_EBUILD_DIR}/install_functions.bash
+
+dobin_TEST()
+{
+ mkdir -p dobin_TEST_dir/src dobin_TEST_dir/dst ; test_return_code
+
+ echo "one contents" > dobin_TEST_dir/src/one ; test_return_code
+ chmod +x dobin_TEST_dir/src/one ; test_return_code
+
+ echo "two contents" > dobin_TEST_dir/src/two ; test_return_code
+ chmod +x dobin_TEST_dir/src/two ; test_return_code
+
+ echo "three contents" > dobin_TEST_dir/src/three ; test_return_code
+ chmod +x dobin_TEST_dir/src/three ; test_return_code
+
+ export D=dobin_TEST_dir/dst
+ ${PALUDIS_EBUILD_DIR}/utils/dobin dobin_TEST_dir/src/one &>/dev/null ; test_return_code
+ ${PALUDIS_EBUILD_DIR}/utils/dobin dobin_TEST_dir/src/two dobin_TEST_dir/src/three &>/dev/null ; test_return_code
+
+ [[ -f dobin_TEST_dir/dst/usr/bin/one ]] ; test_return_code
+ [[ -f dobin_TEST_dir/dst/usr/bin/two ]] ; test_return_code
+ [[ -f dobin_TEST_dir/dst/usr/bin/three ]] ; test_return_code
+
+ test_equality "$(< dobin_TEST_dir/dst/usr/bin/one)" "one contents"
+ test_equality "$(< dobin_TEST_dir/dst/usr/bin/two)" "two contents"
+ test_equality "$(< dobin_TEST_dir/dst/usr/bin/three)" "three contents"
+
+ rm -fr dobin_TEST_dir
+}
+
+dobin_fail_TEST()
+{
+ mkdir -p dobin_TEST_dir/src dobin_TEST_dir/dst ; test_return_code
+ echo "one contents" > dobin_TEST_dir/src/one ; test_return_code
+ echo "two contents" > dobin_TEST_dir/src/two ; test_return_code
+ echo "three contents" > dobin_TEST_dir/src/three ; test_return_code
+
+ export D=dobin_TEST_dir/dst
+ ! ${PALUDIS_EBUILD_DIR}/utils/dobin dobin_TEST_dir/src/four &>/dev/null ; test_return_code
+ ! ${PALUDIS_EBUILD_DIR}/utils/dobin dobin_TEST_dir/src/one dobin_TEST_dir/src/seven &>/dev/null ; test_return_code
+ ! ${PALUDIS_EBUILD_DIR}/utils/dobin dobin_TEST_dir/src/eight dobin_TEST_dir/src/one &>/dev/null ; test_return_code
+
+ [[ -f dobin_TEST_dir/dst/usr/bin/one ]] ; test_return_code
+ ! [[ -f dobin_TEST_dir/dst/usr/bin/four ]] ; test_return_code
+ ! [[ -f dobin_TEST_dir/dst/usr/bin/five ]] ; test_return_code
+ ! [[ -f dobin_TEST_dir/dst/usr/bin/six ]] ; test_return_code
+
+ test_equality "$(< dobin_TEST_dir/dst/usr/bin/one)" "one contents"
+
+ rm -fr dobin_TEST_dir
+}
+
diff --git a/0.4.0/ebuild/utils/doconfd b/0.4.0/ebuild/utils/doconfd
new file mode 100644
index 000000000..37c453cc9
--- /dev/null
+++ b/0.4.0/ebuild/utils/doconfd
@@ -0,0 +1,32 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon doconfd from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+export PATH="${PALUDIS_EBUILD_DIR:+${PALUDIS_EBUILD_DIR}/utils:}${PATH}"
+
+if [ ${#} -lt 1 ]; then
+ echo "${0}: at least one argument needed" >&2
+ exit 1
+fi
+
+INSDESTTREE=/etc/conf.d/
+doins "$@" || exit 2
diff --git a/0.4.0/ebuild/utils/dodir b/0.4.0/ebuild/utils/dodir
new file mode 100644
index 000000000..52b7c2090
--- /dev/null
+++ b/0.4.0/ebuild/utils/dodir
@@ -0,0 +1,34 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon dodir from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+if [[ ! -d ${D} ]]; then
+ echo "${0}: \${D} not valid; aborting" >&2
+ exit 247
+fi
+
+ret=0
+for x in "$@"; do
+ install -d ${DIROPTIONS} "${D}${x}" || ret=2
+done
+
+exit ${ret}
diff --git a/0.4.0/ebuild/utils/dodoc b/0.4.0/ebuild/utils/dodoc
new file mode 100644
index 000000000..bfff299dd
--- /dev/null
+++ b/0.4.0/ebuild/utils/dodoc
@@ -0,0 +1,55 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon dodoc from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+if [[ ! -d ${D} ]]; then
+ echo "${0}: \${D} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ $# -lt 1 ]]; then
+ echo "${0}: at least one argument needed" >&2
+ exit 1
+fi
+
+if [[ -z ${PALUDIS_COMPRESS} ]]; then
+ PALUDIS_COMPRESS="gzip -f -9"
+fi
+
+dir="${D}usr/share/doc/${PF}/${DOCDESTTREE}"
+if [[ ! -d "${dir}" ]]; then
+ install -d "${dir}" || exit 3
+fi
+
+ret=0
+
+for x in "$@"; do
+ if [[ -s "${x}" ]]; then
+ install -m0644 "${x}" "${dir}"
+ ${PALUDIS_COMPRESS} "${dir}/${x##*/}"
+ elif [[ ! -e "${x}" ]]; then
+ echo "${0}: ${x} does not exist" >&2
+ ret=2
+ fi
+done
+
+exit ${ret}
diff --git a/0.4.0/ebuild/utils/doenvd b/0.4.0/ebuild/utils/doenvd
new file mode 100644
index 000000000..7299776f9
--- /dev/null
+++ b/0.4.0/ebuild/utils/doenvd
@@ -0,0 +1,32 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon doenvd from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+export PATH="${PALUDIS_EBUILD_DIR:+${PALUDIS_EBUILD_DIR}/utils:}${PATH}"
+
+if [[ ${#} -lt 1 ]]; then
+ echo "${0}: at least one argument needed" >&2
+ exit 1
+fi
+
+export INSDESTTREE=/etc/env.d/
+doins "$@"
diff --git a/0.4.0/ebuild/utils/doexe b/0.4.0/ebuild/utils/doexe
new file mode 100644
index 000000000..a67166b09
--- /dev/null
+++ b/0.4.0/ebuild/utils/doexe
@@ -0,0 +1,58 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon doexe from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+if [[ ! -d ${D} ]]; then
+ echo "${0}: \${D} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ! -d ${T} ]]; then
+ echo "${0}: \${T} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -lt 1 ]]; then
+ echo "${0}: at least one argument needed"
+ exit 1
+fi
+
+if [[ ! -d "${D}${EXEDESTTREE}" ]]; then
+ install -d "${D}${EXEDESTTREE}" || exit 3
+fi
+
+ret=0
+
+for x in "$@"; do
+ if [[ -L ${x} ]]; then
+ cp "${x}" "${T}"
+ mysrc="${T}/$(/usr/bin/basename "${x}")"
+ elif [[ -d ${x} ]]; then
+ echo "${0}: skipping directory ${x}" >&2
+ continue
+ else
+ mysrc="${x}"
+ fi
+ install ${EXEOPTIONS} "${mysrc}" "${D}${EXEDESTTREE}" || ret=2
+done
+
+exit ${ret}
diff --git a/0.4.0/ebuild/utils/dohard b/0.4.0/ebuild/utils/dohard
new file mode 100644
index 000000000..b0758e5ae
--- /dev/null
+++ b/0.4.0/ebuild/utils/dohard
@@ -0,0 +1,34 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon dohard from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+if [[ ! -d ${D} ]]; then
+ echo "${0}: \${D} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -ne 2 ]]; then
+ echo "${0}: exactly two arguments needed" >&2
+ exit 1
+fi
+
+ln -f "${D}${1}" "${D}${2}"
diff --git a/0.4.0/ebuild/utils/dohtml b/0.4.0/ebuild/utils/dohtml
new file mode 100644
index 000000000..66d16109c
--- /dev/null
+++ b/0.4.0/ebuild/utils/dohtml
@@ -0,0 +1,115 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon dohtml from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+source ${PALUDIS_EBUILD_DIR}/list_functions.bash
+
+if [[ ! -d ${D} ]]; then
+ echo "${0}: \${D} not valid; aborting" >&2
+ exit 247
+fi
+
+allowed_exts="png gif html htm jpg css jps"
+disallowed_dirs=""
+recurse=0
+args=( )
+
+split_names() {
+ list=$1
+ if [[ ${list} == *,* ]]; then
+ echo -n "${list%%,*} "
+ split_names ${list#*,}
+ else
+ echo ${list}
+ fi
+}
+
+parse_args() {
+ while [[ ${#} -gt 0 ]]; do
+ case $1 in
+ -r)
+ recurse=1 ;;
+ -V)
+ verbose=1 ;;
+ -A)
+ allowed_exts="${allowed_exts} $(split_names $2)"
+ shift
+ ;;
+ -a)
+ allowed_exts="$(split_names $2)"
+ shift
+ ;;
+ -x)
+ disallowed_dirs="$(split_names $2)"
+ shift
+ ;;
+ *)
+ args=( "${args[@]}" "$1" ) ;;
+ esac
+ shift
+ done
+}
+
+install_file() {
+ bn=${1}
+ dn=${2}
+ prefix=${3}
+ local ret=0
+
+ path=${bn}
+ [[ -n ${prefix} ]] && path="${prefix}/${path}"
+ [[ -n ${dn} ]] && path="${dn}/${path}"
+
+ [[ -z ${DOCDESTTREE} ]] && DOCDESTTREE="html"
+
+ dir="${D}usr/share/doc/${PF}/${DOCDESTTREE}/${prefix}"
+
+ if [[ -f ${path} ]]; then
+ ext="${path##*.}"
+ if [[ -n ${ext} ]] && has $ext $allowed_exts; then
+ [[ ! -d ${dir} ]] && install -d "${dir}"
+ echo "install -m0644 ${path} ${dir}"
+ install -m0644 "${path}" "${dir}/${bn}"
+ fi
+ elif [[ $recurse == 1 && -d ${path} ]] &&
+ ! has "${bn}" ${disallowed_dirs}; then
+ for f in ${path}/*; do
+ pfx=${bn}
+ [[ -n ${prefix} ]] && pfx="${prefix}/${pfx}"
+ install_file "$(basename "${f}")" "${dn}" "${pfx}"
+ (( ret += $? ))
+ done
+ else
+ (( ++ret ))
+ fi
+ return ${ret}
+}
+
+parse_args "$@"
+
+retval=0
+for i in "${args[@]}"; do
+ install_file "$(basename "${i}")" "$(dirname "${i}")"
+ (( retval += $? ))
+done
+
+exit $retval
diff --git a/0.4.0/ebuild/utils/doinfo b/0.4.0/ebuild/utils/doinfo
new file mode 100644
index 000000000..746812c9c
--- /dev/null
+++ b/0.4.0/ebuild/utils/doinfo
@@ -0,0 +1,55 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon doinfo from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+if [[ ! -d ${D} ]]; then
+ echo "${0}: \${D} not valid; aborting" >&2
+ exit 1
+fi
+
+if [[ ${#} -lt 1 ]]; then
+ echo "${0}: at least one argument needed" >&2
+ exit 1
+fi
+
+if [[ ! -d "${D}usr/share/info" ]]; then
+ install -d "${D}usr/share/info" || exit 3
+fi
+
+if [[ -z ${PALUDIS_COMPRESS} ]]; then
+ PALUDIS_COMPRESS="gzip -f -9"
+fi
+
+ret=0
+
+for x in "$@"; do
+ if [[ -e "${x}" ]]; then
+ install -m0644 "${x}" "${D}usr/share/info"
+ ${PALUDIS_COMPRESS} "${D}usr/share/info/$(basename "${x}")"
+ else
+ echo "${0}: ${x} does not exist"
+ ret=2
+ fi
+done
+
+exit ${ret}
+
diff --git a/0.4.0/ebuild/utils/doinitd b/0.4.0/ebuild/utils/doinitd
new file mode 100644
index 000000000..8fc7080da
--- /dev/null
+++ b/0.4.0/ebuild/utils/doinitd
@@ -0,0 +1,32 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon doinitd from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+export PATH="${PALUDIS_EBUILD_DIR:+${PALUDIS_EBUILD_DIR}/utils:}${PATH}"
+
+if [[ ${#} -lt 1 ]]; then
+ echo "${0}: at least one argument needed" >&2
+ exit 1
+fi
+
+EXEDESTTREE=/etc/init.d
+doexe "$@"
diff --git a/0.4.0/ebuild/utils/doins b/0.4.0/ebuild/utils/doins
new file mode 100644
index 000000000..2d70f5acf
--- /dev/null
+++ b/0.4.0/ebuild/utils/doins
@@ -0,0 +1,89 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon doins from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+export PATH="${PALUDIS_EBUILD_DIR:+${PALUDIS_EBUILD_DIR}/utils:}${PATH}"
+
+if [[ ! -d ${D} ]]; then
+ echo "${0}: \${D} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ! -d ${T} ]]; then
+ echo "${0}: \${T} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -lt 1 ]]; then
+ echo "${0}: at least one argument needed" >&2
+ exit 1
+fi
+
+if [[ ${1} == "-r" ]]; then
+ DOINSRECUR=y
+ shift
+else
+ DOINSRECUR=n
+fi
+
+if [[ -z "${INSDEPTH}" ]]; then
+ declare -i INSDEPTH=0
+fi
+
+if [[ ${INSDESTTREE} == ${D}* ]]; then
+ echo "-------------------------------------------------------" >&2
+ echo "You should not use \${D} with helpers." >&2
+ echo " --> ${INSDESTTREE}" >&2
+ echo "-------------------------------------------------------" >&2
+ exit 248
+fi
+
+if [[ ! -d "${D}${INSDESTTREE}" ]]; then
+ dodir "${INSDESTTREE}"
+fi
+
+ret=0
+
+for x in "$@"; do
+ if [[ -L ${x} ]]; then
+ cp "${x}" "${T}"
+ mysrc="${T}/$(basename "${x}")"
+ elif [[ -d ${x} ]]; then
+ if [[ ${DOINSRECUR} == "n" ]]; then
+ continue
+ fi
+
+ mydir="${INSDESTTREE}/$(basename "${x}")"
+ find "${x}" -mindepth 1 -maxdepth 1 -exec \
+ env \
+ INSDESTTREE="${mydir}" \
+ INSDEPTH=$((INSDEPTH+1)) \
+ ${0} -r {} \;
+ continue
+ else
+ mysrc="${x}"
+ fi
+
+ install ${INSOPTIONS} "${mysrc}" "${D}${INSDESTTREE}" || ret=2
+done
+
+exit ${ret}
diff --git a/0.4.0/ebuild/utils/dolib b/0.4.0/ebuild/utils/dolib
new file mode 100644
index 000000000..c35b20245
--- /dev/null
+++ b/0.4.0/ebuild/utils/dolib
@@ -0,0 +1,62 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon dolib from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+if [[ ! -d ${D} ]]; then
+ echo "${0}: \${D} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ! -d ${PALUDIS_EBUILD_MODULES_DIR} ]]; then
+ echo "${0}: \${PALUDIS_EBUILD_MODULES_DIR} not valid; aborting" >&2
+ exit 1
+fi
+
+source "${PALUDIS_EBUILD_MODULES_DIR}/multilib_functions.bash"
+
+libdir="${D}${DESTTREE}/$(ebuild_get_libdir)"
+
+if [[ ${#} -lt 1 ]]; then
+ echo "${0}: at least one argument needed"
+ exit 1
+fi
+
+if [[ ! -d ${libdir} ]]; then
+ install -d "${libdir}" || exit 3
+fi
+
+ret=0
+
+for x in "$@"; do
+ if [[ -e ${x} ]]; then
+ if [[ ! -L ${x} ]]; then
+ install ${LIBOPTIONS} "${x}" "${libdir}" || ret=2
+ else
+ ln -s "$(readlink "${x}")" "${libdir}/$(basename "${x}")" || ret=2
+ fi
+ else
+ echo "${0}: ${x} does not exist"
+ ret=2
+ fi
+done
+
+exit ${ret}
diff --git a/0.4.0/ebuild/utils/dolib.a.in b/0.4.0/ebuild/utils/dolib.a.in
new file mode 100644
index 000000000..e766554dd
--- /dev/null
+++ b/0.4.0/ebuild/utils/dolib.a.in
@@ -0,0 +1,27 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon dolib.a from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+export PATH="${PALUDIS_EBUILD_DIR:+${PALUDIS_EBUILD_DIR}/utils:}${PATH}"
+
+LIBOPTIONS="-m0644" dolib "$@"
+
diff --git a/0.4.0/ebuild/utils/dolib.so.in b/0.4.0/ebuild/utils/dolib.so.in
new file mode 100644
index 000000000..d4dcb4a46
--- /dev/null
+++ b/0.4.0/ebuild/utils/dolib.so.in
@@ -0,0 +1,26 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon dolib.so from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+export PATH="${PALUDIS_EBUILD_DIR:+${PALUDIS_EBUILD_DIR}/utils:}${PATH}"
+
+LIBOPTIONS="-m0755" dolib "$@"
diff --git a/0.4.0/ebuild/utils/doman b/0.4.0/ebuild/utils/doman
new file mode 100644
index 000000000..db13a1821
--- /dev/null
+++ b/0.4.0/ebuild/utils/doman
@@ -0,0 +1,84 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon doman from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+if [[ ! -d ${D} ]]; then
+ echo "${0}: \${D} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -lt 1 ]]; then
+ echo "${0}: at least one argument needed" >&2
+ exit 1
+fi
+
+if [[ -z ${PALUDIS_COMPRESS} ]]; then
+ PALUDIS_COMPRESS="gzip -f -9"
+fi
+
+BASE="/usr/share"
+i18n=""
+
+for x in "$@"; do
+ if [[ ${x:0:6} == "-i18n=" ]]; then
+ i18n="${x:6}/"
+ continue
+ fi
+ if [[ ${x} == .keep ]]; then
+ continue
+ fi
+
+ suffix=${x##*.}
+
+ if [[ ${suffix} == "gz" ]]; then
+ compressed="gz"
+ realname=${x%.*}
+ suffix=${realname##*.}
+ else
+ realname=${x}
+ compressed=""
+ fi
+
+ mandir="${i18n}man${suffix:0:1}"
+
+ if [[ ${mandir} =~ 'man[0-9n](|f|p|pm)$' ]]; then
+ if [[ -s ${x} ]]; then
+ if [[ ! -d "${D}${BASE}/man/${mandir}" ]]; then
+ install -d "${D}${BASE}/man/${mandir}"
+ fi
+
+ install -m0644 "${x}" "${D}${BASE}/man/${mandir}" || ret=2
+
+ if [[ -z ${compressed} ]]; then
+ ${PALUDIS_COMPRESS} "${D}${BASE}/man/${mandir}/$(basename "${x}")"
+ fi
+ else
+ echo "${0}: ${x} does not exist" >&2
+ ret=2
+ fi
+ else
+ echo "${0}: '${x}' is probably not a man page; skipping" >&2
+ ret=2
+ fi
+done
+
+exit ${ret}
diff --git a/0.4.0/ebuild/utils/domo b/0.4.0/ebuild/utils/domo
new file mode 100644
index 000000000..b7a0dd413
--- /dev/null
+++ b/0.4.0/ebuild/utils/domo
@@ -0,0 +1,54 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon domo from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+if [[ ! -d ${D} ]]; then
+ echo "${0}: \${D} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -lt 1 ]]; then
+ echo "${0}: at least one argument needed" >&2
+ exit 1
+fi
+
+if [[ ! -d "${D}${DESTTREE}/share/locale" ]]; then
+ install -d "${D}${DESTTREE}/share/locale" || exit 3
+fi
+
+ret=0
+
+for x in "$@"; do
+ if [[ -e ${x} ]]; then
+ mytiny="$(basename "${x}")"
+ mydir="${D}${DESTTREE}/share/local/${mytiny%.*}/LC_MESSAGES"
+ if [[ ! -d ${mydir} ]]; then
+ install -d "${mydir}"
+ fi
+ install -m0644 "${x}" "${mydir}/${MOPREFIX}.mo" || ret=2
+ else
+ echo "${0}: ${x} does not exist" >&2
+ ret=2
+ fi
+done
+
+exit ${ret}
diff --git a/0.4.0/ebuild/utils/donewins b/0.4.0/ebuild/utils/donewins
new file mode 100644
index 000000000..90f037799
--- /dev/null
+++ b/0.4.0/ebuild/utils/donewins
@@ -0,0 +1,40 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon donewins from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+export PATH="${PALUDIS_EBUILD_DIR:+${PALUDIS_EBUILD_DIR}/utils:}${PATH}"
+
+if [[ ! -d ${T} ]]; then
+ echo "${0}: \${T} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -ne 2 ]]; then
+ echo "${0}: exactly two arguments needed." >&2
+ exit 1
+fi
+
+ebuild_notice "qa" "${0} is retarded. Don't use it; use newins instead."
+
+rm -rf "${T}/${2}"
+cp "${1}" "${T}/${2}"
+doins "${T}/${2}"
diff --git a/0.4.0/ebuild/utils/dosbin b/0.4.0/ebuild/utils/dosbin
new file mode 100644
index 000000000..25c625801
--- /dev/null
+++ b/0.4.0/ebuild/utils/dosbin
@@ -0,0 +1,45 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon dosbin from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+if [[ ! -d ${D} ]]; then
+ echo "${0}: \${D} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -lt 1 ]]; then
+ echo "${0}: at least one argument needed" >&2
+ exit 1
+fi
+
+if [[ ! -d "${D}${DESTTREE}/sbin" ]]; then
+ install -d "${D}${DESTTREE}/sbin" || exit 3
+fi
+
+for x in "$@"; do
+ if [[ -x ${x} ]]; then
+ install -m0755 "${x}" "${D}${DESTTREE}/sbin" || exit 2
+ else
+ echo ">>> dosbin: making ${x} executable..."
+ install -m0755 -o root -g 0 "${x}" "${D}${DESTTREE}/sbin" || exit 2
+ fi
+done
diff --git a/0.4.0/ebuild/utils/dosed b/0.4.0/ebuild/utils/dosed
new file mode 100644
index 000000000..ca9dc0429
--- /dev/null
+++ b/0.4.0/ebuild/utils/dosed
@@ -0,0 +1,52 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon dosed from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+if [[ ! -d ${D} ]]; then
+ echo "${0}: \${D} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -lt 1 ]]; then
+ echo "${0}: at least one argument needed" >&2
+ exit 1
+fi
+
+mysed="s:${D}::g"
+
+ret=0
+
+for x in "$@"; do
+ y="${D}${x}"
+ if [[ -e ${y} ]]; then
+ if [[ -f "${y}" ]]; then
+ sed -i -e "${mysed}" "${y}" || ret=2
+ else
+ echo "${0}: ${y} is not a regular file"
+ ret=2
+ fi
+ else
+ mysed="${x}"
+ fi
+done
+
+exit ${ret}
diff --git a/0.4.0/ebuild/utils/dosym b/0.4.0/ebuild/utils/dosym
new file mode 100644
index 000000000..b4a43be9c
--- /dev/null
+++ b/0.4.0/ebuild/utils/dosym
@@ -0,0 +1,42 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon dosym from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+export PATH="${PALUDIS_EBUILD_DIR:+${PALUDIS_EBUILD_DIR}/utils:}${PATH}"
+source ${PALUDIS_EBUILD_DIR}/echo_functions.bash
+
+if [[ ! -d ${D} ]]; then
+ echo "${0}: \${D} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -ne 2 ]]; then
+ echo "${0}: exactly two arguments needed" >&2
+ exit 1
+fi
+
+if [[ ! -d $(dirname $2) ]]; then
+ ebuild_notice "qa" "$0: target directory $2 does not exist; creating. Please fix the ebuild to create it explicitly."
+ dodir $(dirname $2)
+fi
+
+ln -snf "${1}" "${D}${2}"
diff --git a/0.4.0/ebuild/utils/dounpack b/0.4.0/ebuild/utils/dounpack
new file mode 100755
index 000000000..65463d221
--- /dev/null
+++ b/0.4.0/ebuild/utils/dounpack
@@ -0,0 +1,97 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+die()
+{
+ echo "dounpack: error: $@" 1>&2
+ exit 123
+}
+
+unpack_one()
+{
+ [[ -z "$1" ]] && die "Bad argument for unpack_one"
+ [[ -e "$1" ]] || die "${1} doesn't exist"
+
+ case "${x}" in
+ *.tar)
+ echo tar xf "${1}" 1>&2
+ tar xf "${1}" || die "Couldn't unpack ${1}"
+ ;;
+
+ *.tar.gz|*.tgz|*.tar.Z)
+ echo tar zxf "${1}" 1>&2
+ tar zxf "${1}" || die "Couldn't unpack ${1}"
+ ;;
+
+ *.tar.bz2|*.tbz2)
+ echo tar jxf "${1}" 1>&2
+ tar jxf "${1}" || die "Couldn't unpack ${1}"
+ ;;
+
+ *.zip|*.ZIP|*.jar)
+ echo unzip -qo "${1}" 1>&2
+ unzip -qo "${1}" || die "Couldn't unpack ${1}"
+ ;;
+
+ *.gz|*.Z|*.z)
+ echo gzip -dc "${1}" > ${WORKDIR}/$(basename "${1%.*}" ) 1>&2
+ gzip -dc "${1}" > ${WORKDIR}/$(basename "${1%.*}" ) || die "Couldn't unpack ${1}"
+ ;;
+
+ *.bz2)
+ echo bzip2 -dc "${1}" > ${WORKDIR}/$(basename "${1%.*}" ) 1>&2
+ bzip2 -dc "${1}" > ${WORKDIR}/$(basename "${1%.*}" ) || die "Couldn't unpack ${1}"
+ ;;
+
+ *.rar|*.RAR)
+ echo unrar x -idq "${1}" 1>&2
+ unrar x -idq "${1}" || die "Couldn't unpack ${1}"
+ ;;
+
+ *.LHa|*.LHA|*.lha|*.lzh)
+ echo lha xqf "${1}" 1>&2
+ lha xqf "${1}" || die "Couldn't unpack ${1}"
+ ;;
+
+ *.a|*.deb)
+ echo ar x "${1}" 1&>2
+ ar x "${1}" 1>&2
+ ;;
+
+ *)
+ echo "Skipping unpack for ${1}"
+ ;;
+ esac
+
+}
+
+[[ -z "$@" ]] && die "No arguments given to unpack"
+
+for x in "$@" ; do
+ x=$(echo $x )
+ echo ">>> Unpacking ${x} to ${PWD}"
+ [[ "${x:0:2}" == "./" ]] || x="${DISTDIR}/${x}"
+ unpack_one "${x}"
+done
+
+
diff --git a/0.4.0/ebuild/utils/emake b/0.4.0/ebuild/utils/emake
new file mode 100755
index 000000000..642d06054
--- /dev/null
+++ b/0.4.0/ebuild/utils/emake
@@ -0,0 +1,22 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+echo ${EMAKE_WRAPPER} ${MAKE:-make} ${MAKEOPTS} ${EXTRA_EMAKE} "$@" 1>&2
+${EMAKE_WRAPPER} ${MAKE:-make} ${MAKEOPTS} ${EXTRA_EMAKE} "$@"
+
diff --git a/0.4.0/ebuild/utils/fowners b/0.4.0/ebuild/utils/fowners
new file mode 100644
index 000000000..4eb208c6e
--- /dev/null
+++ b/0.4.0/ebuild/utils/fowners
@@ -0,0 +1,24 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon fowners from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+chown "${@/#\//${D}/}"
diff --git a/0.4.0/ebuild/utils/fperms b/0.4.0/ebuild/utils/fperms
new file mode 100644
index 000000000..04c5db7eb
--- /dev/null
+++ b/0.4.0/ebuild/utils/fperms
@@ -0,0 +1,24 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon fperms from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+chmod "${@/#\//${D}/}"
diff --git a/0.4.0/ebuild/utils/getmtime b/0.4.0/ebuild/utils/getmtime
new file mode 100755
index 000000000..81a78e45f
--- /dev/null
+++ b/0.4.0/ebuild/utils/getmtime
@@ -0,0 +1,5 @@
+#!/bin/bash
+case $(uname -s) in
+ FreeBSD) stat -f '%m' $@ ;;
+ *) stat -c '%Y' $@ ;;
+esac
diff --git a/0.4.0/ebuild/utils/merge.cc b/0.4.0/ebuild/utils/merge.cc
new file mode 100644
index 000000000..23cb64a55
--- /dev/null
+++ b/0.4.0/ebuild/utils/merge.cc
@@ -0,0 +1,481 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * 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
+ */
+
+#include "merge_common.hh"
+
+#include <paludis/digests/md5.hh>
+#include <paludis/util/dir_iterator.hh>
+#include <paludis/util/fs_entry.hh>
+#include <paludis/util/log.hh>
+#include <paludis/util/pstream.hh>
+#include <paludis/util/stringify.hh>
+#include <paludis/util/strip.hh>
+#include <paludis/util/system.hh>
+#include <paludis/util/tokeniser.hh>
+#include <paludis/selinux/security_context.hh>
+
+#include <algorithm>
+#include <fstream>
+#include <iomanip>
+#include <iostream>
+#include <iterator>
+#include <string>
+#include <vector>
+
+#include <cstdlib>
+#include <errno.h>
+#include <fcntl.h>
+#include <fnmatch.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include "config.h"
+
+using namespace paludis;
+using namespace merge;
+
+using std::cout;
+using std::cerr;
+using std::endl;
+using std::ifstream;
+using std::ofstream;
+using std::istreambuf_iterator;
+using std::ostreambuf_iterator;
+
+namespace
+{
+ int exit_status;
+
+ FSEntry
+ make_config_protect_name(const FSEntry & name, const FSEntry & file_to_install)
+ {
+ int n(0);
+
+ ifstream our_md5_file(stringify(file_to_install).c_str());
+ if (! our_md5_file)
+ throw Failure("Could not get md5 for '" + stringify(file_to_install) + "'");
+ MD5 our_md5(our_md5_file);
+
+ FSEntry result(name);
+ while (true)
+ {
+ if (! result.exists())
+ return result;
+ else if (result.is_regular_file())
+ {
+ ifstream other_md5_file(stringify(result).c_str());
+ if (! other_md5_file)
+ throw Failure("Could not get md5 for '" + stringify(result) + "'");
+ MD5 other_md5(other_md5_file);
+
+ if (our_md5.hexsum() == other_md5.hexsum())
+ return result;
+ }
+
+ std::stringstream s;
+ s << std::setw(4) << std::setfill('0') << std::right << n++;
+ result = FSEntry(stringify(name.dirname() / ("._cfg" + s.str() + "_"
+ + name.basename())));
+ }
+ }
+
+ /**
+ * Output stream buffer class that's opened via an FD, so that we can avoid race
+ * conditions that would be present on the non-Unix-specific standard file
+ * stream classes.
+ *
+ * See \ref TCppSL Ch. 13.13 for what we're doing here. The buffer code is
+ * based upon the "io/outbuf2.hpp" example in section 13.13.3.
+ */
+ class FDOutputStreamBuf :
+ public std::streambuf
+ {
+ protected:
+ int fd;
+
+ virtual int_type
+ overflow(int_type c)
+ {
+ if (c != EOF)
+ {
+ char z = c;
+ if (1 != write(fd, &z, 1))
+ return EOF;
+ }
+ return c;
+ }
+
+ virtual std::streamsize
+ xsputn(const char * s, std::streamsize num)
+ {
+ return write(fd, s, num);
+ }
+
+ public:
+ FDOutputStreamBuf(const int f) :
+ fd(f)
+ {
+ }
+ };
+
+ /**
+ * Member from base initialisation for FDOutputStream.
+ */
+ class FDOutputStreamBase
+ {
+ protected:
+ FDOutputStreamBuf buf;
+
+ public:
+ FDOutputStreamBase(const int fd) :
+ buf(fd)
+ {
+ }
+ };
+ /**
+ * Output stream buffer class that's opened via an FD, so that we can avoid race
+ * conditions that would be present on the non-Unix-specific standard file
+ * stream classes.
+ */
+ class FDOutputStream :
+ protected FDOutputStreamBase,
+ public std::ostream
+ {
+ public:
+ FDOutputStream(const int fd) :
+ FDOutputStreamBase(fd),
+ std::ostream(&buf)
+ {
+ }
+ };
+
+ /**
+ * RAII holder for a file descriptor.
+ */
+ class FDHolder
+ {
+ private:
+ const int _fd;
+
+ public:
+ FDHolder(const int fd) :
+ _fd(fd)
+ {
+ }
+
+ ~FDHolder()
+ {
+ if (-1 != _fd)
+ {
+ ::fsync(_fd);
+ ::close(_fd);
+ }
+ }
+
+ operator int () const
+ {
+ return _fd;
+ }
+ };
+
+ void
+ do_dir(const FSEntry & root, const FSEntry & src_dir,
+ const FSEntry & dst_dir, ofstream * const contents)
+ {
+ Context context("Installing directory in root '" + stringify(root) + "' from '"
+ + stringify(src_dir) + "' to '" + stringify(dst_dir) + "':");
+
+ std::string root_str(stringify(root)), dst_dir_str(stringify(dst_dir.dirname()));
+ if (root_str == "/")
+ root_str.clear();
+ if (0 != dst_dir_str.compare(0, root_str.length(), root_str))
+ throw Failure("do_dir confused: '" + root_str + "' '" + dst_dir_str + "'");
+
+ cout << ">>> " << std::setw(5) << std::left << "[dir]" << " " <<
+ dst_dir_str.substr(root_str.length()) << "/" << dst_dir.basename() << endl;
+
+ if (dst_dir.is_directory())
+ /* nothing */;
+ else if (dst_dir.is_symbolic_link() && dst_dir.realpath().is_directory())
+ Log::get_instance()->message(ll_qa, lc_no_context, "Expected '" + stringify(dst_dir) +
+ "' to be a directory or non-existent, but found a symlink to a directory");
+ else if (dst_dir.exists())
+ throw Failure("Expected '" + stringify(dst_dir) +
+ "' to be a directory or non-existent, but found a file");
+ else
+ {
+ mode_t mode(src_dir.permissions());
+
+#ifdef HAVE_SELINUX
+ CountedPtr<FSCreateCon, count_policy::ExternalCountTag> createcon(0);
+ if (MatchPathCon::get_instance()->good())
+ {
+ FSCreateCon *p = new FSCreateCon(MatchPathCon::get_instance()->match(dst_dir_str.substr(root_str.length()),
+ mode));
+ createcon.assign(p);
+ }
+#endif
+
+ FSEntry(dst_dir).mkdir(mode);
+ FSEntry(stringify(dst_dir)).chown(src_dir.owner(), src_dir.group());
+ /* the chmod is needed to pick up fancy set*id bits */
+ FSEntry(stringify(dst_dir)).chmod(src_dir.permissions());
+ }
+
+ *contents << "dir " << dst_dir_str.substr(root_str.length()) << "/" <<
+ dst_dir.basename() << endl;
+ }
+
+ void
+ do_obj(const FSEntry & root, const FSEntry & src,
+ const FSEntry & dst, ofstream * const contents)
+ {
+ Context context("Installing object in root '" + stringify(root) + "' from '"
+ + stringify(src) + "' to '" + stringify(dst) + "':");
+
+ std::string root_str(stringify(root)), dst_dir_str(stringify(dst.dirname()));
+ if (root_str == "/")
+ root_str.clear();
+ if (0 != dst_dir_str.compare(0, root_str.length(), root_str))
+ throw Failure("do_obj confused: '" + root_str + "' '" + dst_dir_str + "'");
+
+ cout << ">>> " << std::setw(5) << std::left << "[obj]" << " " <<
+ dst_dir_str.substr(root_str.length()) << "/" << dst.basename();
+
+ if (dst.is_directory())
+ throw Failure("Cannot overwrite directory '" + stringify(dst) + "' with a file");
+ else
+ {
+ FSEntry real_dst(dst);
+
+ ifstream input_file(stringify(src).c_str());
+ if (! input_file)
+ throw Failure("Cannot read '" + stringify(src) + "'");
+
+ if (dst.exists())
+ {
+ if (is_config_protected(root, dst))
+ {
+ real_dst = make_config_protect_name(dst, src);
+ if (dst != real_dst)
+ cout << " -> " << real_dst << endl;
+ else
+ cout << endl;
+ }
+ else
+ {
+ FSEntry(dst).unlink();
+ cout << endl;
+ }
+ }
+ else
+ cout << endl;
+
+ /* FDHolder must be destroyed before we do the md5 thing, or the
+ * disk write may not have synced. */
+ {
+#ifdef HAVE_SELINUX
+ CountedPtr<FSCreateCon, count_policy::ExternalCountTag> createcon(0);
+ if (MatchPathCon::get_instance()->good())
+ createcon.assign(new
+ FSCreateCon(MatchPathCon::get_instance()->match(dst_dir_str.substr(root_str.length()) + "/"
+ + dst.basename(), src.permissions())));
+#endif
+ FDHolder fd(::open(stringify(real_dst).c_str(), O_WRONLY | O_CREAT, src.permissions()));
+ if (-1 == fd)
+ throw Failure("Cannot open '" + stringify(real_dst) + "' for write");
+
+ if (0 != ::fchown(fd, src.owner(), src.group()))
+ throw Failure("Cannot fchown '" + stringify(real_dst) + "': " +
+ stringify(::strerror(errno)));
+
+ /* the chmod is needed for set*id bits, which are dropped by
+ * umask in the ::open */
+ if (0 != ::fchmod(fd, src.permissions()))
+ throw Failure("Cannot fchmod '" + stringify(real_dst) + "': " +
+ stringify(::strerror(errno)));
+
+ FDOutputStream output_file(fd);
+ if (! output_file)
+ throw Failure("Cannot write '" + stringify(dst) + "'");
+
+ std::copy((istreambuf_iterator<char>(input_file)), istreambuf_iterator<char>(),
+ ostreambuf_iterator<char>(output_file));
+ }
+
+ ifstream dst_file(stringify(dst).c_str());
+ if (! dst_file)
+ throw Failure("Could not get md5 for '" + stringify(dst_file) + "'");
+ MD5 md5(dst_file);
+
+ *contents << "obj " << dst_dir_str.substr(root_str.length()) << "/" <<
+ dst.basename() << " " << md5.hexsum() << " " <<
+ FSEntry(stringify(dst)).mtime() << endl;
+ }
+ }
+
+ void
+ do_sym(const FSEntry & root, const FSEntry & src,
+ const FSEntry & dst, ofstream * const contents)
+ {
+ Context context("Installing symlink in root '" + stringify(root) + "' from '"
+ + stringify(src) + "' to '" + stringify(dst) + "':");
+
+ std::string root_str(stringify(root)), dst_dir_str(stringify(dst.dirname()));
+ if (root_str == "/")
+ root_str.clear();
+ if (0 != dst_dir_str.compare(0, root_str.length(), root_str))
+ throw Failure("do_sym confused: '" + root_str + "' '" + dst_dir_str + "'");
+
+ cout << ">>> " << std::setw(5) << std::left << "[sym]" << " " <<
+ dst_dir_str.substr(root_str.length()) << "/" << dst.basename() << endl;
+
+ if (dst.exists())
+ {
+ if (dst.is_directory())
+ throw Failure("Can't overwrite directory '" + stringify(dst) +
+ "' with symlink to '" + src.readlink() + "'");
+ else
+ FSEntry(dst).unlink();
+ }
+
+#ifdef HAVE_SELINUX
+ // permissions() on a symlink does weird things, but matchpathcon only cares about the file type,
+ // so just pass S_IFLNK.
+ CountedPtr<FSCreateCon, count_policy::ExternalCountTag> createcon(0);
+ if (MatchPathCon::get_instance()->good())
+ createcon.assign(new
+ FSCreateCon(MatchPathCon::get_instance()->match(dst_dir_str.substr(root_str.length()) + "/"
+ + dst.basename(), S_IFLNK)));
+#endif
+
+ if (0 != ::symlink(src.readlink().c_str(), stringify(dst).c_str()))
+ {
+ Log::get_instance()->message(ll_warning, lc_no_context, "Couldn't create symlink '"
+ + src.readlink() + "' at '" + stringify(dst) + "'");
+ exit_status |= 2;
+ }
+
+ *contents << "sym " << dst_dir_str.substr(root_str.length()) << "/" <<
+ dst.basename() << " -> " << dst.readlink() << " " <<
+ FSEntry(stringify(dst)).mtime() << endl;
+ }
+
+ void
+ merge_this(const FSEntry & root, const FSEntry & src_dir, const FSEntry & dst_dir,
+ ofstream * const contents)
+ {
+ Context context("Merging under root '" + stringify(root) + "' from '"
+ + stringify(src_dir) + "' to '" + stringify(dst_dir) + "':");
+
+ if (! root.is_directory())
+ throw Failure("merge_this called with bad root '" + stringify(root) + "'");
+ if (! src_dir.is_directory())
+ throw Failure("merge_this called with bad src_dir '" + stringify(src_dir) + "'");
+ if (! dst_dir.is_directory())
+ throw Failure("merge_this called with bad dst_dir '" + stringify(dst_dir) + "'");
+
+ for (DirIterator d(src_dir, false), d_end ; d != d_end ; ++d)
+ {
+ if (d->is_regular_file())
+ do_obj(root, src_dir / d->basename(), dst_dir / d->basename(), contents);
+ else if (d->is_symbolic_link())
+ do_sym(root, src_dir / d->basename(), dst_dir / d->basename(), contents);
+ else if (d->is_directory())
+ {
+ do_dir(root, src_dir / d->basename(), dst_dir / d->basename(), contents);
+ merge_this(root, (src_dir / d->basename()).realpath(), (dst_dir / d->basename()).realpath(), contents);
+ }
+ else
+ throw Failure("Don't know how to merge '" + stringify(*d) + "'");
+ }
+ }
+}
+
+int
+main(int argc, char * argv[])
+{
+ Context context("In main program:");
+
+#ifdef HAVE_SELINUX
+ // If the MatchPathCon initialisation fails, don't attempt to match contexts when merging.
+ if (! MatchPathCon::get_instance()->good())
+ Log::get_instance()->message(ll_warning, lc_no_context,
+ "matchpathcon_init failed; not setting security contexts");
+#endif
+
+ exit_status = 0;
+ try
+ {
+ if (argc != 4)
+ throw Failure("Usage: " + stringify(argv[0]) + " src dst contents");
+
+ Log::get_instance()->set_program_name(argv[0]);
+ std::string log_level(getenv_with_default("PALUDIS_EBUILD_LOG_LEVEL", "qa"));
+
+ if (log_level == "debug")
+ Log::get_instance()->set_log_level(ll_debug);
+ else if (log_level == "qa")
+ Log::get_instance()->set_log_level(ll_qa);
+ else if (log_level == "warning")
+ Log::get_instance()->set_log_level(ll_warning);
+ else if (log_level == "silent")
+ Log::get_instance()->set_log_level(ll_silent);
+ else
+ throw Failure("bad value for log level");
+
+ Log::get_instance()->message(ll_debug, lc_no_context,
+ "CONFIG_PROTECT is " + getenv_with_default("CONFIG_PROTECT", "(unset)"));
+ Log::get_instance()->message(ll_debug, lc_no_context,
+ "CONFIG_PROTECT_MASK is " + getenv_with_default("CONFIG_PROTECT_MASK", "(unset)"));
+
+ FSEntry src(argv[1]), dst(argv[2]), contents(argv[3]);
+
+ if (! ((src = src.realpath())).is_directory())
+ throw Failure(stringify(argv[1]) + ": not a directory");
+ if (! ((dst = dst.realpath())).is_directory())
+ throw Failure(stringify(argv[2]) + ": not a directory");
+
+ ofstream contents_file(stringify(contents).c_str());
+ if (! contents_file)
+ throw Failure(stringify(contents) + ": not writeable");
+
+ ::umask(0000);
+ merge_this(dst, src, dst, &contents_file);
+ return exit_status;
+ }
+ catch (const Failure & f)
+ {
+ cerr << argv[0] << ": fatal error: " << f.message << endl;
+ return EXIT_FAILURE;
+ }
+ catch (const Exception & e)
+ {
+ cerr << argv[0] << ": fatal error:" << endl
+ << " * " << e.backtrace("\n * ") << e.message()
+ << " (" << e.what() << ")" << endl;
+ return EXIT_FAILURE;
+ }
+ catch (const std::exception & e)
+ {
+ cerr << argv[0] << ": fatal error: " << e.what() << endl;
+ return EXIT_FAILURE;
+ }
+}
+
diff --git a/0.4.0/ebuild/utils/merge_TEST.bash b/0.4.0/ebuild/utils/merge_TEST.bash
new file mode 100644
index 000000000..ac1cb4db1
--- /dev/null
+++ b/0.4.0/ebuild/utils/merge_TEST.bash
@@ -0,0 +1,130 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# 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
+
+merge_empty_TEST()
+{
+ ${TOP_BUILD_DIR}/ebuild/utils/merge "merge_TEST_dir/empty_src" \
+ "merge_TEST_dir/empty_dst" \
+ "merge_TEST_dir/empty_contents" 1>/dev/null
+ test_return_code
+}
+
+merge_files_TEST()
+{
+ ${TOP_BUILD_DIR}/ebuild/utils/merge "merge_TEST_dir/files_src" \
+ "merge_TEST_dir/files_dst" \
+ "merge_TEST_dir/files_contents" 1>/dev/null
+ test_return_code
+
+ [[ -f "merge_TEST_dir/files_dst/one" ]] ; test_return_code
+ test_equality "$(< merge_TEST_dir/files_dst/one)" "contents of one"
+
+ [[ -f "merge_TEST_dir/files_dst/two" ]] ; test_return_code
+ test_equality "$(< merge_TEST_dir/files_dst/two)" "contents of two"
+}
+
+merge_dirs_TEST()
+{
+ ${TOP_BUILD_DIR}/ebuild/utils/merge "merge_TEST_dir/dirs_src" \
+ "merge_TEST_dir/dirs_dst" \
+ "merge_TEST_dir/dirs_contents" 1>/dev/null
+ test_return_code
+
+ [[ -d "merge_TEST_dir/dirs_dst/dir_one" ]] ; test_return_code
+ [[ -d "merge_TEST_dir/dirs_dst/dir_two" ]] ; test_return_code
+ [[ -d "merge_TEST_dir/dirs_dst/dir_two/dir_three" ]] ; test_return_code
+
+ [[ -f "merge_TEST_dir/dirs_dst/dir_one/one" ]] ; test_return_code
+ test_equality "$(< merge_TEST_dir/dirs_dst/dir_one/one)" "contents of one"
+
+ [[ -f "merge_TEST_dir/dirs_dst/dir_two/two" ]] ; test_return_code
+ test_equality "$(< merge_TEST_dir/dirs_dst/dir_two/two)" "contents of two"
+
+ [[ -f "merge_TEST_dir/dirs_dst/dir_two/dir_three/three" ]] ; test_return_code
+ test_equality "$(< merge_TEST_dir/dirs_dst/dir_two/dir_three/three)" "contents of three"
+}
+
+merge_dirs_over_TEST()
+{
+ ${TOP_BUILD_DIR}/ebuild/utils/merge "merge_TEST_dir/dirs_over_src" \
+ "merge_TEST_dir/dirs_over_dst" \
+ "merge_TEST_dir/dirs_over_contents" 1>/dev/null
+ test_return_code
+
+ [[ -d "merge_TEST_dir/dirs_over_dst/dir_one/" ]] ; test_return_code
+ [[ -d "merge_TEST_dir/dirs_over_dst/dir_two/" ]] ; test_return_code
+ [[ -d "merge_TEST_dir/dirs_over_dst/dir_two/dir_three/" ]] ; test_return_code
+
+ [[ -f "merge_TEST_dir/dirs_over_dst/dir_one/one" ]] ; test_return_code
+ test_equality "$(< merge_TEST_dir/dirs_over_dst/dir_one/one)" "contents of one"
+
+ [[ -f "merge_TEST_dir/dirs_over_dst/dir_two/two" ]] ; test_return_code
+ test_equality "$(< merge_TEST_dir/dirs_over_dst/dir_two/two)" "contents of two"
+
+ [[ -f "merge_TEST_dir/dirs_over_dst/dir_two/dir_three/three" ]] ; test_return_code
+ test_equality "$(< merge_TEST_dir/dirs_over_dst/dir_two/dir_three/three)" "contents of three"
+}
+
+merge_links_TEST()
+{
+ ${TOP_BUILD_DIR}/ebuild/utils/merge "merge_TEST_dir/links_src" \
+ "merge_TEST_dir/links_dst" \
+ "merge_TEST_dir/links_contents" 1>/dev/null
+ test_return_code
+
+ [[ -f "merge_TEST_dir/links_dst/one" ]] ; test_return_code
+ test_equality "$(< merge_TEST_dir/links_dst/one)" "contents of one"
+
+ [[ -f "merge_TEST_dir/links_dst/two" ]] ; test_return_code
+ test_equality "$(< merge_TEST_dir/links_dst/two)" "contents of two"
+
+ [[ -f "merge_TEST_dir/links_dst/link_to_two" ]] ; test_return_code
+ [[ -L "merge_TEST_dir/links_dst/link_to_two" ]] ; test_return_code
+ test_equality "$(< merge_TEST_dir/links_dst/link_to_two)" "contents of two"
+}
+
+merge_links_over_TEST()
+{
+ ${TOP_BUILD_DIR}/ebuild/utils/merge "merge_TEST_dir/links_over_src" \
+ "merge_TEST_dir/links_over_dst" \
+ "merge_TEST_dir/links_over_contents" 1>/dev/null
+ test_return_code
+
+ [[ -f "merge_TEST_dir/links_over_dst/one" ]] ; test_return_code
+ test_equality "$(< merge_TEST_dir/links_over_dst/one)" "contents of one"
+
+ [[ -f "merge_TEST_dir/links_over_dst/two" ]] ; test_return_code
+ test_equality "$(< merge_TEST_dir/links_over_dst/two)" "contents of two"
+
+ [[ -f "merge_TEST_dir/links_over_dst/link_to_two" ]] ; test_return_code
+ [[ -L "merge_TEST_dir/links_over_dst/link_to_two" ]] ; test_return_code
+ test_equality "$(< merge_TEST_dir/links_over_dst/link_to_two)" "contents of two"
+
+ [[ -f "merge_TEST_dir/links_over_dst/link_to_three" ]] ; test_return_code
+ [[ -L "merge_TEST_dir/links_over_dst/link_to_three" ]] ; test_return_code
+ test_equality "$(< merge_TEST_dir/links_over_dst/link_to_three)" "contents of three"
+}
+merge_links_over_dir_TEST()
+{
+ ! ${TOP_BUILD_DIR}/ebuild/utils/merge "merge_TEST_dir/links_over_dir_src" \
+ "merge_TEST_dir/links_over_dir_dst" \
+ "merge_TEST_dir/links_over_dir_contents" &>/dev/null
+ test_return_code
+}
+
+
diff --git a/0.4.0/ebuild/utils/merge_TEST_cleanup.sh b/0.4.0/ebuild/utils/merge_TEST_cleanup.sh
new file mode 100755
index 000000000..4b40b8f65
--- /dev/null
+++ b/0.4.0/ebuild/utils/merge_TEST_cleanup.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# vim: set ft=sh sw=4 sts=4 et :
+
+if [ -d merge_TEST_dir ] ; then
+ rm -fr merge_TEST_dir
+else
+ true
+fi
+
+
diff --git a/0.4.0/ebuild/utils/merge_TEST_setup.sh b/0.4.0/ebuild/utils/merge_TEST_setup.sh
new file mode 100755
index 000000000..33b23e7bf
--- /dev/null
+++ b/0.4.0/ebuild/utils/merge_TEST_setup.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+# vim: set ft=sh sw=4 sts=4 et :
+
+mkdir -p merge_TEST_dir/{empty_src,empty_dst} || exit 2
+
+mkdir -p merge_TEST_dir/{files_src,files_dst} || exit 2
+echo "contents of one" > merge_TEST_dir/files_src/one
+echo "contents of two" > merge_TEST_dir/files_src/two
+
+mkdir -p merge_TEST_dir/{dirs_src/{dir_one,dir_two/dir_three},dirs_dst} || exit 3
+echo "contents of one" > merge_TEST_dir/dirs_src/dir_one/one
+echo "contents of two" > merge_TEST_dir/dirs_src/dir_two/two
+echo "contents of three" > merge_TEST_dir/dirs_src/dir_two/dir_three/three
+
+mkdir -p merge_TEST_dir/{dirs_over_src/{dir_one,dir_two/dir_three},dirs_over_dst} || exit 4
+mkdir -p merge_TEST_dir/dirs_over_dst/{one,real}
+ln -s real merge_TEST_dir/dirs_over_dst/two
+echo "contents of one" > merge_TEST_dir/dirs_over_src/dir_one/one
+echo "contents of two" > merge_TEST_dir/dirs_over_src/dir_two/two
+echo "contents of three" > merge_TEST_dir/dirs_over_src/dir_two/dir_three/three
+
+mkdir -p merge_TEST_dir/{links_src,links_dst} || exit 5
+echo "contents of one" > merge_TEST_dir/links_src/one
+echo "contents of two" > merge_TEST_dir/links_src/two
+ln -s two merge_TEST_dir/links_src/link_to_two
+
+mkdir -p merge_TEST_dir/{links_over_src,links_over_dst} || exit 5
+echo "contents of one" > merge_TEST_dir/links_over_src/one
+echo "contents of two" > merge_TEST_dir/links_over_src/two
+echo "contents of three" > merge_TEST_dir/links_over_src/three
+ln -s two merge_TEST_dir/links_over_src/link_to_two
+ln -s three merge_TEST_dir/links_over_src/link_to_three
+echo "existing file" > merge_TEST_dir/link_to_two
+ln -s ../ merge_TEST_dir/links_over_dst/link_to_three
+
+mkdir -p merge_TEST_dir/{links_over_dir_src,links_over_dir_dst} || exit 5
+echo "contents of one" > merge_TEST_dir/links_over_dir_src/one
+echo "contents of two" > merge_TEST_dir/links_over_dir_src/two
+echo "contents of three" > merge_TEST_dir/links_over_dir_src/three
+ln -s two merge_TEST_dir/links_over_dir_src/link_to_two
+ln -s three merge_TEST_dir/links_over_dir_src/link_to_three
+mkdir merge_TEST_dir/links_over_dir_dst/link_to_two
+echo "existing file" > merge_TEST_dir/links_over_dir_dst/link_to_three
+
diff --git a/0.4.0/ebuild/utils/merge_common.cc b/0.4.0/ebuild/utils/merge_common.cc
new file mode 100644
index 000000000..abb42a2d4
--- /dev/null
+++ b/0.4.0/ebuild/utils/merge_common.cc
@@ -0,0 +1,83 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * 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
+ */
+
+#include "merge_common.hh"
+
+#include <paludis/util/dir_iterator.hh>
+#include <paludis/util/fs_entry.hh>
+#include <paludis/util/log.hh>
+#include <paludis/util/pstream.hh>
+#include <paludis/util/stringify.hh>
+#include <paludis/util/strip.hh>
+#include <paludis/util/system.hh>
+#include <paludis/util/tokeniser.hh>
+
+#include <algorithm>
+#include <fstream>
+#include <iomanip>
+#include <iostream>
+#include <iterator>
+#include <string>
+#include <vector>
+
+#include <cstdlib>
+#include <errno.h>
+#include <fcntl.h>
+#include <fnmatch.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+using namespace paludis;
+
+std::vector<std::string>
+merge::get_config_var(const std::string & var)
+{
+ std::vector<std::string> result;
+ WhitespaceTokeniser::get_instance()->tokenise(getenv_with_default(var, ""),
+ std::back_inserter(result));
+ return result;
+}
+
+bool
+merge::is_config_protected(const FSEntry & root, const FSEntry & file)
+{
+ static std::vector<std::string> cfg_pro(get_config_var("CONFIG_PROTECT")),
+ cfg_pro_mask(get_config_var("CONFIG_PROTECT_MASK"));
+
+ std::string file_str(stringify(file)), root_str(stringify(root));
+ if (0 != file_str.compare(0, root_str.length(), root_str))
+ throw Failure("is_config_protected confused: '" + root_str + "' '" + file_str + "'");
+ file_str.erase(0, root_str.length());
+ if (file_str.empty())
+ file_str = "/";
+
+ bool result(false);
+ for (std::vector<std::string>::const_iterator c(cfg_pro.begin()),
+ c_end(cfg_pro.end()) ; c != c_end && ! result ; ++c)
+ if (0 == fnmatch((*c + "/*").c_str(), file_str.c_str(), 0))
+ result = true;
+
+ for (std::vector<std::string>::const_iterator c(cfg_pro_mask.begin()),
+ c_end(cfg_pro_mask.end()) ; c != c_end && result ; ++c)
+ if (0 == fnmatch((*c + "/*").c_str(), file_str.c_str(), 0))
+ result = false;
+
+ return result;
+}
+
diff --git a/0.4.0/ebuild/utils/merge_common.hh b/0.4.0/ebuild/utils/merge_common.hh
new file mode 100644
index 000000000..5e0e247c8
--- /dev/null
+++ b/0.4.0/ebuild/utils/merge_common.hh
@@ -0,0 +1,50 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * 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_EBUILD_UTILS_MERGE_COMMON_HH
+#define PALUDIS_GUARD_EBUILD_UTILS_MERGE_COMMON_HH 1
+
+#include <string>
+#include <vector>
+
+namespace paludis
+{
+ class FSEntry;
+}
+
+namespace merge
+{
+ struct Failure
+ {
+ std::string message;
+
+ Failure(const std::string & m) :
+ message(m)
+ {
+ };
+ };
+
+ std::vector<std::string>
+ get_config_var(const std::string & var);
+
+ bool
+ is_config_protected(const paludis::FSEntry & root, const paludis::FSEntry & file);
+}
+
+#endif
diff --git a/0.4.0/ebuild/utils/newbin b/0.4.0/ebuild/utils/newbin
new file mode 100644
index 000000000..21792c697
--- /dev/null
+++ b/0.4.0/ebuild/utils/newbin
@@ -0,0 +1,38 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon newbin from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+export PATH="${PALUDIS_EBUILD_DIR:+${PALUDIS_EBUILD_DIR}/utils:}${PATH}"
+
+if [[ ! -d ${T} ]]; then
+ echo "${0}: \${T} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -ne 2 ]]; then
+ echo "${0}: exactly two arguments needed" >&2
+ exit 1
+fi
+
+rm -rf "${T}/${2}"
+cp "${1}" "${T}/${2}"
+dobin "${T}/${2}"
diff --git a/0.4.0/ebuild/utils/newconfd b/0.4.0/ebuild/utils/newconfd
new file mode 100644
index 000000000..77838656c
--- /dev/null
+++ b/0.4.0/ebuild/utils/newconfd
@@ -0,0 +1,38 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon newconfd from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+export PATH="${PALUDIS_EBUILD_DIR:+${PALUDIS_EBUILD_DIR}/utils:}${PATH}"
+
+if [[ ! -d ${T} ]]; then
+ echo "${0}: \${T} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -ne 2 ]]; then
+ echo "${0}: exactly two arguments needed" >&2
+ exit 1
+fi
+
+rm -rf "${T}/${2}"
+cp "${1}" "${T}/${2}"
+doconfd "${T}/${2}"
diff --git a/0.4.0/ebuild/utils/newdoc b/0.4.0/ebuild/utils/newdoc
new file mode 100644
index 000000000..b4cb50700
--- /dev/null
+++ b/0.4.0/ebuild/utils/newdoc
@@ -0,0 +1,38 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon newdoc from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+export PATH="${PALUDIS_EBUILD_DIR:+${PALUDIS_EBUILD_DIR}/utils:}${PATH}"
+
+if [[ ! -d ${T} ]]; then
+ echo "${0}: \${T} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -ne 2 ]]; then
+ echo "${0}: exactly two arguments needed" >&2
+ exit 1
+fi
+
+rm -rf "${T}/${2}"
+cp "${1}" "${T}/${2}"
+dodoc "${T}/${2}"
diff --git a/0.4.0/ebuild/utils/newenvd b/0.4.0/ebuild/utils/newenvd
new file mode 100644
index 000000000..76f0a7f5e
--- /dev/null
+++ b/0.4.0/ebuild/utils/newenvd
@@ -0,0 +1,38 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon newenvd from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+export PATH="${PALUDIS_EBUILD_DIR:+${PALUDIS_EBUILD_DIR}/utils:}${PATH}"
+
+if [[ ! -d ${T} ]]; then
+ echo "${0}: \${T} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -ne 2 ]]; then
+ echo "${0}: exactly two arguments needed" >&2
+ exit 1
+fi
+
+rm -rf "${T}/${2}"
+cp "${1}" "${T}/${2}"
+doenvd "${T}/${2}"
diff --git a/0.4.0/ebuild/utils/newexe b/0.4.0/ebuild/utils/newexe
new file mode 100644
index 000000000..9a5cb35df
--- /dev/null
+++ b/0.4.0/ebuild/utils/newexe
@@ -0,0 +1,38 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon newexe from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+export PATH="${PALUDIS_EBUILD_DIR:+${PALUDIS_EBUILD_DIR}/utils:}${PATH}"
+
+if [[ ! -d ${T} ]]; then
+ echo "${0}: \${T} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -ne 2 ]]; then
+ echo "${0}: exactly two arguments needed" >&2
+ exit 1
+fi
+
+rm -rf "${T}/${2}"
+cp "${1}" "${T}/${2}"
+doexe "${T}/${2}"
diff --git a/0.4.0/ebuild/utils/newinitd b/0.4.0/ebuild/utils/newinitd
new file mode 100644
index 000000000..01ca12b2d
--- /dev/null
+++ b/0.4.0/ebuild/utils/newinitd
@@ -0,0 +1,38 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon newinitd from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+export PATH="${PALUDIS_EBUILD_DIR:+${PALUDIS_EBUILD_DIR}/utils:}${PATH}"
+
+if [[ ! -d ${T} ]]; then
+ echo "${0}: \${T} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -ne 2 ]]; then
+ echo "${0}: exactly two arguments needed" >&2
+ exit 1
+fi
+
+rm -rf "${T}/${2}"
+cp "${1}" "${T}/${2}"
+doinitd "${T}/${2}"
diff --git a/0.4.0/ebuild/utils/newins b/0.4.0/ebuild/utils/newins
new file mode 100644
index 000000000..2b692adb6
--- /dev/null
+++ b/0.4.0/ebuild/utils/newins
@@ -0,0 +1,38 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon newins from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+export PATH="${PALUDIS_EBUILD_DIR:+${PALUDIS_EBUILD_DIR}/utils:}${PATH}"
+
+if [[ ! -d ${T} ]]; then
+ echo "${0}: \${T} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -ne 2 ]]; then
+ echo "${0}: exactly two arguments needed" >&2
+ exit 1
+fi
+
+rm -rf "${T}/${2}"
+cp "${1}" "${T}/${2}"
+doins "${T}/${2}"
diff --git a/0.4.0/ebuild/utils/newlib.a.in b/0.4.0/ebuild/utils/newlib.a.in
new file mode 100644
index 000000000..415a0571c
--- /dev/null
+++ b/0.4.0/ebuild/utils/newlib.a.in
@@ -0,0 +1,38 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon newlib.a from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+export PATH="${PALUDIS_EBUILD_DIR:+${PALUDIS_EBUILD_DIR}/utils:}${PATH}"
+
+if [[ ! -d ${T} ]]; then
+ echo "${0}: \${T} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -ne 2 ]]; then
+ echo "${0}: exactly two arguments needed" >&2
+ exit 1
+fi
+
+rm -rf "${T}/${2}"
+cp "${1}" "${T}/${2}"
+dolib.a "${T}/${2}"
diff --git a/0.4.0/ebuild/utils/newlib.so.in b/0.4.0/ebuild/utils/newlib.so.in
new file mode 100644
index 000000000..0701351d8
--- /dev/null
+++ b/0.4.0/ebuild/utils/newlib.so.in
@@ -0,0 +1,38 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon newlib.so from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+export PATH="${PALUDIS_EBUILD_DIR:+${PALUDIS_EBUILD_DIR}/utils:}${PATH}"
+
+if [[ ! -d ${T} ]]; then
+ echo "${0}: \${T} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -ne 2 ]]; then
+ echo "${0}: exactly two arguments needed" >&2
+ exit 1
+fi
+
+rm -rf "${T}/${2}"
+cp "${1}" "${T}/${2}"
+dolib.so "${T}/${2}"
diff --git a/0.4.0/ebuild/utils/newman b/0.4.0/ebuild/utils/newman
new file mode 100644
index 000000000..0dab5fc16
--- /dev/null
+++ b/0.4.0/ebuild/utils/newman
@@ -0,0 +1,38 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon newman from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+export PATH="${PALUDIS_EBUILD_DIR:+${PALUDIS_EBUILD_DIR}/utils:}${PATH}"
+
+if [[ ! -d ${T} ]]; then
+ echo "${0}: \${T} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -ne 2 ]]; then
+ echo "${0}: exactly two arguments needed" >&2
+ exit 1
+fi
+
+rm -rf "${T}/${2}"
+cp "${1}" "${T}/${2}"
+doman "${T}/${2}"
diff --git a/0.4.0/ebuild/utils/newsbin b/0.4.0/ebuild/utils/newsbin
new file mode 100644
index 000000000..da94577f7
--- /dev/null
+++ b/0.4.0/ebuild/utils/newsbin
@@ -0,0 +1,38 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# Based in part upon newsbin from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+export PATH="${PALUDIS_EBUILD_DIR:+${PALUDIS_EBUILD_DIR}/utils:}${PATH}"
+
+if [[ ! -d ${T} ]]; then
+ echo "${0}: \${T} not valid; aborting" >&2
+ exit 247
+fi
+
+if [[ ${#} -ne 2 ]]; then
+ echo "${0}: exactly two arguments needed" >&2
+ exit 1
+fi
+
+rm -rf "${T}/${2}"
+cp "${1}" "${T}/${2}"
+dosbin "${T}/${2}"
diff --git a/0.4.0/ebuild/utils/prep.in b/0.4.0/ebuild/utils/prep.in
new file mode 100644
index 000000000..fcb64959d
--- /dev/null
+++ b/0.4.0/ebuild/utils/prep.in
@@ -0,0 +1,21 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+ebuild_notice "qa" "Ebuilds shouldn't be calling $0 manually."
+
diff --git a/0.4.0/ebuild/utils/run_test.bash b/0.4.0/ebuild/utils/run_test.bash
new file mode 100644
index 000000000..1f9db4e38
--- /dev/null
+++ b/0.4.0/ebuild/utils/run_test.bash
@@ -0,0 +1,62 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+shopt -s expand_aliases
+shopt -s extglob
+set +o posix
+
+export TEST_STATUS=
+export PALUDIS_IN_TEST_FRAMEWORK="yes"
+
+test_return_code()
+{
+ local r="$?"
+ if [[ "0" == "${r}" ]] ; then
+ echo -n "."
+ else
+ echo -n "!{retcode: ${r}}"
+ export local_test_status="fail"
+ export TEST_STATUS="fail"
+ fi
+}
+
+test_equality()
+{
+ if [[ "${1}" == "${2}" ]] ; then
+ echo -n "."
+ else
+ echo -n "!{'${1}' not equal to '${2}'}"
+ export local_test_status="fail"
+ export TEST_STATUS="fail"
+ fi
+}
+
+if test -f "$TEST_SCRIPT_DIR""${1%.bash}"_"setup.sh" ; then
+ echo ">>> setup for test ${1%.bash}"
+ if ! "$TEST_SCRIPT_DIR""${1%.bash}"_"setup.sh" ; then
+ echo ">>> exiting with error for test ${1%.bash}"
+ exit 255
+ fi
+fi
+
+echo "Test program ${1%.bash}:"
+source "${1}" || exit 200
+
+for testname in $(set | grep '_TEST *() *$' ) ; do
+ [[ ${testname/()} != ${testname} ]] && continue
+ echo -n "* ${testname%_TEST}: "
+ export local_test_status=""
+ ${testname}
+ [[ -z "$local_test_status" ]] && echo " OK" || echo " FAIL"
+done
+
+if test -f "$TEST_SCRIPT_DIR""${1%.bash}"_"cleanup.sh" ; then
+ echo ">>> cleanup for test ${1%.bash}"
+ if ! "$TEST_SCRIPT_DIR""${1%.bash}"_"cleanup.sh" ; then
+ echo ">>> exiting with error for test ${1%.bash}"
+ exit 255
+ fi
+fi
+
+[[ -z "$TEST_STATUS" ]]
+
diff --git a/0.4.0/ebuild/utils/sed.in b/0.4.0/ebuild/utils/sed.in
new file mode 100755
index 000000000..8be311a90
--- /dev/null
+++ b/0.4.0/ebuild/utils/sed.in
@@ -0,0 +1,2 @@
+#!/bin/bash
+gsed $@
diff --git a/0.4.0/ebuild/utils/unmerge.cc b/0.4.0/ebuild/utils/unmerge.cc
new file mode 100644
index 000000000..fe455a019
--- /dev/null
+++ b/0.4.0/ebuild/utils/unmerge.cc
@@ -0,0 +1,235 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * 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
+ */
+
+#include "merge_common.hh"
+
+#include <paludis/digests/md5.hh>
+
+#include <paludis/util/dir_iterator.hh>
+#include <paludis/util/fs_entry.hh>
+#include <paludis/util/log.hh>
+#include <paludis/util/pstream.hh>
+#include <paludis/util/stringify.hh>
+#include <paludis/util/strip.hh>
+#include <paludis/util/system.hh>
+#include <paludis/util/tokeniser.hh>
+
+#include <algorithm>
+#include <fstream>
+#include <iomanip>
+#include <iostream>
+#include <iterator>
+#include <string>
+#include <deque>
+#include <vector>
+
+#include <cstdlib>
+#include <errno.h>
+#include <fcntl.h>
+#include <fnmatch.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+using namespace paludis;
+using namespace merge;
+
+using std::cout;
+using std::cerr;
+using std::endl;
+using std::ifstream;
+
+namespace
+{
+ int exit_status;
+
+ template <typename Iter_>
+ void unmerge_contents(const FSEntry & root, const Iter_ begin, const Iter_ end)
+ {
+ using std::istreambuf_iterator;
+
+ for (Iter_ cur(begin) ; cur != end ; ++cur)
+ {
+ std::vector<std::string> tokens;
+ WhitespaceTokeniser::get_instance()->tokenise(*cur, std::back_inserter(tokens));
+ if (tokens.empty())
+ continue;
+
+ if ("obj" == tokens.at(0))
+ {
+ if (tokens.size() != 4)
+ {
+ Log::get_instance()->message(ll_warning, lc_no_context,
+ "Malformed VDB entry '" + *cur + "'");
+ exit_status |= 4;
+ }
+ else if (! (root / tokens.at(1)).is_regular_file())
+ cout << "--- [!type] " << tokens.at(1) << endl;
+ else if (stringify((root / tokens.at(1)).mtime()) != tokens.at(3))
+ cout << "--- [!time] " << tokens.at(1) << endl;
+ else
+ {
+ ifstream md5_file(stringify(root / tokens.at(1)).c_str());
+ if (! md5_file)
+ {
+ Log::get_instance()->message(ll_warning, lc_no_context,
+ "Couldn't get md5 for '" + stringify(root / tokens.at(1)) + "'");
+ cout << "--- [!md5?] " << tokens.at(1) << endl;
+ }
+ else if (MD5(md5_file).hexsum() != tokens.at(2))
+ cout << "--- [!md5 ] " << tokens.at(1) << endl;
+ else if (is_config_protected(root, root / tokens.at(1)))
+ cout << "--- [cfgpr] " << tokens.at(1) << endl;
+ else
+ {
+ cout << "<<< " << tokens.at(1) << endl;
+ (root / tokens.at(1)).unlink();
+ }
+ }
+ }
+ else if ("sym" == tokens.at(0))
+ {
+ if (tokens.size() != 5)
+ {
+ Log::get_instance()->message(ll_warning, lc_no_context,
+ "Malformed VDB entry '" + *cur + "'");
+ exit_status |= 4;
+ }
+ else if (! (root / tokens.at(1)).is_symbolic_link())
+ cout << "--- [!type] " << tokens.at(1) << endl;
+ else if (stringify((root / tokens.at(1)).mtime()) != tokens.at(4))
+ cout << "--- [!time] " << tokens.at(1) << endl;
+ else if ((root / tokens.at(1)).readlink() != tokens.at(3))
+ cout << "--- [!dest] " << tokens.at(1) << endl;
+ else
+ {
+ cout << "<<< " << tokens.at(1) << endl;
+ (root / tokens.at(1)).unlink();
+ }
+ }
+ else if ("misc" == tokens.at(0))
+ {
+
+ }
+ else if ("dir" == tokens.at(0))
+ /* nothing */ ;
+ else
+ {
+ Log::get_instance()->message(ll_warning, lc_no_context,
+ "Skipping unknown VDB entry '" + *cur + "'");
+ exit_status |= 2;
+ }
+ }
+ }
+
+ template <typename Iter_>
+ void unmerge_directories(const FSEntry & root, const Iter_ begin, const Iter_ end)
+ {
+ using std::istreambuf_iterator;
+
+ for (Iter_ cur(begin) ; cur != end ; ++cur)
+ {
+ std::vector<std::string> tokens;
+ WhitespaceTokeniser::get_instance()->tokenise(*cur, std::back_inserter(tokens));
+ if (tokens.empty())
+ continue;
+
+ if ("dir" == tokens.at(0))
+ {
+ if (tokens.size() != 2)
+ {
+ Log::get_instance()->message(ll_warning, lc_no_context,
+ "Malformed VDB entry '" + *cur + "'");
+ exit_status |= 8;
+ }
+ else if (! (root / tokens.at(1)).is_directory())
+ cout << "--- [!type] " << tokens.at(1) << endl;
+ else if (DirIterator((root / tokens.at(1)), false) != DirIterator())
+ cout << "--- [!empt] " << tokens.at(1) << endl;
+ else
+ {
+ cout << "<<< " << tokens.at(1) << endl;
+ (root / tokens.at(1)).rmdir();
+ }
+ }
+ }
+ }
+}
+
+int
+main(int argc, char * argv[])
+{
+ Context context("In main program:");
+ exit_status = 0;
+ try
+ {
+ if (argc != 3)
+ throw Failure("Usage: " + stringify(argv[0]) + " root contents");
+
+ Log::get_instance()->set_program_name(argv[0]);
+ std::string log_level(getenv_with_default("PALUDIS_EBUILD_LOG_LEVEL", "qa"));
+
+ if (log_level == "debug")
+ Log::get_instance()->set_log_level(ll_debug);
+ else if (log_level == "qa")
+ Log::get_instance()->set_log_level(ll_qa);
+ else if (log_level == "warning")
+ Log::get_instance()->set_log_level(ll_warning);
+ else if (log_level == "silent")
+ Log::get_instance()->set_log_level(ll_silent);
+ else
+ throw Failure("bad value for log level");
+
+ FSEntry root(argv[1]), contents(argv[2]);
+
+ if (! ((root = root.realpath())).is_directory())
+ throw Failure(stringify(argv[1]) + ": not a directory");
+
+ ifstream contents_file(stringify(contents).c_str());
+ if (! contents_file)
+ throw Failure(stringify(contents) + ": not readable");
+
+ std::deque<std::string> lines;
+ std::string line;
+ while (std::getline(contents_file, line))
+ lines.push_back(line);
+
+ unmerge_contents(root, lines.begin(), lines.end());
+ unmerge_directories(root, lines.rbegin(), lines.rend());
+ return exit_status;
+ }
+ catch (const Failure & f)
+ {
+ cerr << argv[0] << ": fatal error: " << f.message << endl;
+ return EXIT_FAILURE;
+ }
+ catch (const Exception & e)
+ {
+ cerr << argv[0] << ": fatal error:" << endl
+ << " * " << e.backtrace("\n * ") << e.message()
+ << " (" << e.what() << ")" << endl;
+ return EXIT_FAILURE;
+ }
+ catch (const std::exception & e)
+ {
+ cerr << argv[0] << ": fatal error: " << e.what() << endl;
+ return EXIT_FAILURE;
+ }
+}
+
+
diff --git a/0.4.0/ebuild/utils/unmerge_TEST.bash b/0.4.0/ebuild/utils/unmerge_TEST.bash
new file mode 100644
index 000000000..4a168da94
--- /dev/null
+++ b/0.4.0/ebuild/utils/unmerge_TEST.bash
@@ -0,0 +1,66 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# 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
+
+unmerge_empty_TEST()
+{
+ ${TOP_BUILD_DIR}/ebuild/utils/merge "unmerge_TEST_dir/empty_src" \
+ "unmerge_TEST_dir/empty_dst" \
+ "unmerge_TEST_dir/empty_contents" 1>/dev/null
+ test_return_code
+
+ ${TOP_BUILD_DIR}/ebuild/utils/unmerge "unmerge_TEST_dir/empty_dst" \
+ "unmerge_TEST_dir/empty_contents" 1>/dev/null
+ test_return_code
+
+ ok=
+ for a in unmerge_TEST_dir/empty_dst/* ; do
+ [[ -e "$a" ]] || continue
+ test_equality "$a" ""
+ ok=no
+ done
+ test_equality "$ok" ""
+}
+
+unmerge_files_TEST()
+{
+ ${TOP_BUILD_DIR}/ebuild/utils/merge "unmerge_TEST_dir/files_src" \
+ "unmerge_TEST_dir/files_dst" \
+ "unmerge_TEST_dir/files_contents" 1>/dev/null
+ test_return_code
+
+ ok=
+ for a in unmerge_TEST_dir/files_dst/* ; do
+ [[ -e "$a" ]] || continue
+ ok=yes
+ break
+ done
+ test_equality "$ok" "yes"
+
+ ${TOP_BUILD_DIR}/ebuild/utils/unmerge "unmerge_TEST_dir/files_dst" \
+ "unmerge_TEST_dir/files_contents" 1>/dev/null
+ test_return_code
+
+ ok=
+ for a in unmerge_TEST_dir/files_dst/* ; do
+ [[ -e "$a" ]] || continue
+ test_equality "$a" ""
+ ok=no
+ done
+ test_equality "$ok" ""
+}
+
diff --git a/0.4.0/ebuild/utils/unmerge_TEST_cleanup.sh b/0.4.0/ebuild/utils/unmerge_TEST_cleanup.sh
new file mode 100755
index 000000000..e0f01b607
--- /dev/null
+++ b/0.4.0/ebuild/utils/unmerge_TEST_cleanup.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+# vim: set ft=sh sw=4 sts=4 et :
+
+if [ -d unmerge_TEST_dir ] ; then
+ rm -fr unmerge_TEST_dir
+else
+ true
+fi
+
+
+
diff --git a/0.4.0/ebuild/utils/unmerge_TEST_setup.sh b/0.4.0/ebuild/utils/unmerge_TEST_setup.sh
new file mode 100755
index 000000000..158e2ae9d
--- /dev/null
+++ b/0.4.0/ebuild/utils/unmerge_TEST_setup.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+# vim: set ft=sh sw=4 sts=4 et :
+
+mkdir -p unmerge_TEST_dir/{empty_src,empty_dst} || exit 2
+
+mkdir -p unmerge_TEST_dir/{files_src,files_dst} || exit 3
+echo "file one" > unmerge_TEST_dir/files_src/one
+echo "file two" > unmerge_TEST_dir/files_src/two
diff --git a/0.4.0/eselect/Makefile.am b/0.4.0/eselect/Makefile.am
new file mode 100644
index 000000000..0130e12ce
--- /dev/null
+++ b/0.4.0/eselect/Makefile.am
@@ -0,0 +1,22 @@
+MAINTAINERCLEANFILES = Makefile.in
+CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda .keep
+SUBDIRS = .
+
+installeselectdir = $(datadir)/eselect/modules/
+
+installeselect_SCRIPTS = \
+ news.eselect
+
+TESTS_ENVIRONMENT = env \
+ PALUDIS_EBUILD_DIR="$(srcdir)/ebuild/" \
+ TEST_SCRIPT_DIR="$(srcdir)/" \
+ bash $(top_srcdir)/ebuild/run_test.bash
+
+TESTS =
+EXTRA_DIST = \
+ $(installeselect_SCRIPTS) \
+ $(TESTS)
+
+check_SCRIPTS = $(TESTS)
+check_PROGRAMS =
+
diff --git a/0.4.0/eselect/news.eselect b/0.4.0/eselect/news.eselect
new file mode 100644
index 000000000..5d57a2e16
--- /dev/null
+++ b/0.4.0/eselect/news.eselect
@@ -0,0 +1,225 @@
+# Copyright 2006 Ciaran McCreesh
+# Distributed under the terms of the GNU General Public License v2
+# $Id: $
+
+DESCRIPTION="Read GLEP 42 news items"
+MAINTAINER="ciaran.mccreesh@blueyonder.co.uk"
+SVN_DATE='$Date: $'
+VERSION=$(svn_date_to_version "${SVN_DATE}" )
+
+paludis_command() {
+ echo ${PALUDIS_COMMAND:-paludis}
+}
+
+get_repositories() {
+ $(paludis_command ) --list-repositories | \
+ sed -n -e 's/^\* *//p'
+}
+
+get_unread() {
+ local repo repos
+ repos=( $(get_repositories ) )
+ for repo in ${repos[@]} ; do
+ [[ -f "${ROOT}/var/lib/paludis/news/news-${repo}.unread" ]] || continue
+ sed -e '/^#/d' -e "/./s,$,::${repo}," < \
+ ${ROOT}/var/lib/paludis/news/news-${repo}.unread
+ done
+}
+
+get_read() {
+ local repo repos
+ repos=( $(get_repositories ) )
+ for repo in ${repos[@]} ; do
+ [[ -f "${ROOT}/var/lib/paludis/news/news-${repo}.read" ]] || continue
+ sed -e '/^#/d' -e "/./s,$,::${repo}," < \
+ ${ROOT}/var/lib/paludis/news/news-${repo}.read
+ done
+}
+
+mark_read() {
+ local name=${1%::*} repo=${1##*::}
+
+ touch "${ROOT}"/var/lib/paludis/news/news-${repo}.read || \
+ die -q "Couldn't touch read file for ${1}"
+
+ if ! grep -q "^${name}\$" < "${ROOT}"/var/lib/paludis/news/news-${repo}.read ; then
+ echo "${name}" >> "${ROOT}"/var/lib/paludis/news/news-${repo}.read || \
+ die -q "Couldn't mark ${1} as read"
+ fi
+
+ sed -i -e "/^${name}\$/d" "${ROOT}"/var/lib/paludis/news/news-${repo}.unread || \
+ die -q "Couldn't remove ${1} from unread list"
+}
+
+mark_unread() {
+ local name=${1%::*} repo=${1##*::}
+
+ touch "${ROOT}"/var/lib/paludis/news/news-${repo}.unread || \
+ die -q "Couldn't touch unread file for ${1}"
+
+ if ! grep -q "^${name}\$" < "${ROOT}"/var/lib/paludis/news/news-${repo}.unread ; then
+ echo "${name}" >> "${ROOT}"/var/lib/paludis/news/news-${repo}.unread || \
+ die -q "Couldn't mark ${1} as unread"
+ fi
+
+ sed -i -e "/^${name}\$/d" "${ROOT}"/var/lib/paludis/news/news-${repo}.read || \
+ die -q "Couldn't remove ${1} from read list"
+}
+
+purge_read() {
+ local repo
+ for repo in $(get_repositories ) ; do
+ : > "${ROOT}"/var/lib/paludis/news/news-${repo}.read || \
+ die -q "Couldn't purge ${repo} read list"
+ done
+}
+
+get_dir_name() {
+ local name=${1%::*} repo=${1##*::}
+ $(paludis_command ) --list-repositories --repository ${repo} | \
+ sed -n -e "s~^ *newsdir: *\(.*\)~\1/${name}/~p"
+}
+
+get_headers() {
+ local dir=${1}
+ dir=${dir}/$(basename ${1%/} ).en.txt
+ sed -e '/^$/,$d' < ${dir}
+}
+
+get_body() {
+ local dir=${1}
+ dir=${dir}/$(basename ${1%/} ).en.txt
+ sed -e '1,/^$/d' < ${dir}
+}
+
+get_title() {
+ local f=$(get_dir_name ${1} )
+ if [[ -d ${f} ]] ; then
+ get_headers ${f} | sed -n -e 's/^Title:\s*//p'
+ else
+ echo "(no title available)"
+ fi
+}
+
+### list action ###
+
+describe_list() {
+ echo "List news items"
+}
+
+do_list() {
+ targets=( $(get_unread ) )
+ write_list_start "Unread news items:"
+ if [[ -n ${targets[@]} ]] ; then
+ local target
+ for target in ${targets[@]} ; do
+ write_kv_list_entry "${target%::*}" "$(get_title ${target} )"
+ done
+ else
+ write_kv_list_entry "(none found)" ""
+ fi
+
+ targets=( $(get_read ) )
+ write_list_start "Read news items:"
+ if [[ -n ${targets[@]} ]] ; then
+ local target
+ for target in ${targets[@]} ; do
+ write_kv_list_entry "${target%::*}" "$(get_title ${target} )"
+ done
+ else
+ write_kv_list_entry "(none found)" ""
+ fi
+}
+
+### read action ###
+
+describe_read() {
+ echo "Read a news item"
+}
+
+describe_read_parameters() {
+ echo "<target>"
+}
+
+describe_read_options() {
+ echo "target : News item ID (from 'list' action)"
+}
+
+do_read() {
+ [[ -z ${1} ]] && die -q "You didn't tell me what you want to read"
+
+ local i item= items
+ items=( $(get_unread ) )
+ for i in ${items[@]} ; do
+ [[ -n "${item}" ]] && break
+ [[ "${i%::*}" == "${1}" ]] || continue
+ item=${i}
+ done
+
+ items=( $(get_read ) )
+ for i in ${items[@]} ; do
+ [[ -n "${item}" ]] && break
+ [[ "${i%::*}" == "${1}" ]] || continue
+ item=${i}
+ done
+
+ [[ -z "${item}" ]] && die -q "Can't find news item '${1}'"
+
+ write_list_start "${item%::*}"
+ local f=$(get_dir_name ${item} ) line
+ get_headers ${f} | \
+ while read line ; do
+ local k=${line%%:*}
+ case ${k} in
+ Title|Author|Posted|Revision|Translator)
+ write_kv_list_entry "${k}" "${line#*:}"
+ ;;
+ esac
+ done
+ echo
+ get_body ${f}
+
+ mark_read "${item}"
+}
+
+### unread action ###
+
+describe_unread() {
+ echo "Unread a news item"
+}
+
+describe_unread_parameters() {
+ echo "<target>"
+}
+
+describe_unread_options() {
+ echo "target : News item ID (from 'list' action)"
+}
+
+do_unread() {
+ [[ -z ${1} ]] && die -q "You didn't tell me what you want to unread"
+
+ local i item= items
+ items=( $(get_read ) )
+ for i in ${items[@]} ; do
+ [[ -n "${item}" ]] && break
+ [[ "${i%::*}" == "${1}" ]] || continue
+ item=${i}
+ done
+
+ [[ -z "${item}" ]] && die -q "Can't find read news item '${1}'"
+
+ mark_unread "${item}"
+}
+
+### purge action ###
+
+describe_purge() {
+ echo "Purge read news items"
+}
+
+do_purge() {
+ purge_read
+}
+
+# vim: ts=4 sw=4 noet :
diff --git a/0.4.0/hooks/Makefile.am.m4 b/0.4.0/hooks/Makefile.am.m4
new file mode 100644
index 000000000..56314b35d
--- /dev/null
+++ b/0.4.0/hooks/Makefile.am.m4
@@ -0,0 +1,176 @@
+ifdef(`__gnu__',`',`errprint(`This is not GNU m4...
+')m4exit(1)') include(`misc/generated-file.txt')
+
+dnl vim: set ft=m4 noet :
+
+MAINTAINERCLEANFILES = Makefile.in Makefile.am
+CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda .keep
+SUBDIRS = .
+
+installvarlibpaludisnewsdir = $(localstatedir)/paludis/news
+
+installhookcommonprogdir = $(libexecdir)/paludis/hooks/common
+installhookinstallallpostdir = $(libexecdir)/paludis/hooks/install_all_post
+
+installhookcommonprog_SCRIPTS = \
+ gnu_info_index.bash \
+ eselect_env_update.bash \
+ log.bash \
+ news.bash
+
+installhookinstallallpost_SCRIPTS = \
+ find_config_updates.bash
+
+installvarlibpaludisnews_SCRIPTS = \
+ .keep
+
+TESTS_ENVIRONMENT = env \
+ PALUDIS_EBUILD_DIR="$(srcdir)/ebuild/" \
+ TEST_SCRIPT_DIR="$(srcdir)/" \
+ bash $(top_srcdir)/ebuild/run_test.bash
+
+TESTS =
+EXTRA_DIST = \
+ Makefile.am.m4 \
+ $(installhookcommonprog_SCRIPTS) \
+ $(installhookinstallallpost_SCRIPTS) \
+ $(TESTS)
+
+check_SCRIPTS = $(TESTS)
+check_PROGRAMS =
+
+.keep :
+ touch $@
+
+define(`userhook', `
+installuserhooks$1dir = $(datadir)/paludis/hooks/$1
+installuserhooks$1_SCRIPTS = .keep')
+
+userhook(`install_pre')
+userhook(`install_post')
+userhook(`install_all_pre')
+userhook(`install_all_post')
+userhook(`install_pretend_pre')
+userhook(`install_pretend_post')
+userhook(`uninstall_pre')
+userhook(`uninstall_post')
+userhook(`uninstall_all_pre')
+userhook(`uninstall_all_post')
+userhook(`sync_pre')
+userhook(`sync_post')
+userhook(`sync_all_pre')
+userhook(`sync_all_post')
+userhook(`fetch_all_pre')
+userhook(`fetch_all_post')
+userhook(`fetch_all_all_pre')
+userhook(`fetch_all_all_post')
+userhook(`ebuild_metadata_pre')
+userhook(`ebuild_metadata_post')
+userhook(`ebuild_init_pre')
+userhook(`ebuild_init_post')
+userhook(`ebuild_fetch_pre')
+userhook(`ebuild_fetch_post')
+userhook(`ebuild_merge_pre')
+userhook(`ebuild_merge_post')
+userhook(`ebuild_unmerge_pre')
+userhook(`ebuild_unmerge_post')
+userhook(`ebuild_tidyup_pre')
+userhook(`ebuild_tidyup_post')
+userhook(`ebuild_strip_pre')
+userhook(`ebuild_strip_post')
+userhook(`ebuild_unpack_pre')
+userhook(`ebuild_unpack_post')
+userhook(`ebuild_compile_pre')
+userhook(`ebuild_compile_post')
+userhook(`ebuild_install_pre')
+userhook(`ebuild_install_post')
+userhook(`ebuild_test_pre')
+userhook(`ebuild_test_post')
+userhook(`ebuild_setup_pre')
+userhook(`ebuild_setup_post')
+userhook(`ebuild_config_pre')
+userhook(`ebuild_config_post')
+userhook(`ebuild_nofetch_pre')
+userhook(`ebuild_nofetch_post')
+userhook(`ebuild_preinst_pre')
+userhook(`ebuild_preinst_post')
+userhook(`ebuild_postinst_pre')
+userhook(`ebuild_postinst_post')
+userhook(`ebuild_prerm_pre')
+userhook(`ebuild_prerm_post')
+userhook(`ebuild_postrm_pre')
+userhook(`ebuild_postrm_post')
+
+define(`systemhook', `
+installsystemhooks$1dir = $(libexecdir)/paludis/hooks/$1
+installsystemhooks$1_SCRIPTS = .keep')
+
+systemhook(`install_pre')
+systemhook(`install_post')
+systemhook(`install_all_pre')
+systemhook(`install_all_post')
+systemhook(`install_pretend_pre')
+systemhook(`install_pretend_post')
+systemhook(`uninstall_pre')
+systemhook(`uninstall_post')
+systemhook(`uninstall_all_pre')
+systemhook(`uninstall_all_post')
+systemhook(`sync_pre')
+systemhook(`sync_post')
+systemhook(`sync_all_pre')
+systemhook(`sync_all_post')
+systemhook(`fetch_all_pre')
+systemhook(`fetch_all_post')
+systemhook(`fetch_all_all_pre')
+systemhook(`fetch_all_all_post')
+
+install-data-local :
+ install -d $(DESTDIR)/$(libexecdir)/paludis/hooks/uninstall_all_pre/
+ install -d $(DESTDIR)/$(libexecdir)/paludis/hooks/uninstall_all_post/
+ install -d $(DESTDIR)/$(libexecdir)/paludis/hooks/uninstall_pre/
+ install -d $(DESTDIR)/$(libexecdir)/paludis/hooks/uninstall_post/
+ install -d $(DESTDIR)/$(libexecdir)/paludis/hooks/install_pre/
+ install -d $(DESTDIR)/$(libexecdir)/paludis/hooks/install_post/
+ install -d $(DESTDIR)/$(libexecdir)/paludis/hooks/install_all_pre/
+ install -d $(DESTDIR)/$(libexecdir)/paludis/hooks/install_all_post/
+ install -d $(DESTDIR)/$(libexecdir)/paludis/hooks/install_pretend_pre/
+ install -d $(DESTDIR)/$(libexecdir)/paludis/hooks/install_pretend_post/
+ install -d $(DESTDIR)/$(libexecdir)/paludis/hooks/sync_pre/
+ install -d $(DESTDIR)/$(libexecdir)/paludis/hooks/sync_post/
+ install -d $(DESTDIR)/$(libexecdir)/paludis/hooks/sync_all_pre/
+ install -d $(DESTDIR)/$(libexecdir)/paludis/hooks/sync_all_post/
+ install -d $(DESTDIR)/$(libexecdir)/paludis/hooks/fetch_all_pre/
+ install -d $(DESTDIR)/$(libexecdir)/paludis/hooks/fetch_all_post/
+ install -d $(DESTDIR)/$(libexecdir)/paludis/hooks/fetch_pre/
+ install -d $(DESTDIR)/$(libexecdir)/paludis/hooks/fetch_post/
+ ln -sf ../common/gnu_info_index.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/uninstall_all_post/
+ ln -sf ../common/gnu_info_index.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/install_all_post/
+ ln -sf ../common/eselect_env_update.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/uninstall_all_post/
+ ln -sf ../common/eselect_env_update.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/install_post/
+ ln -sf ../common/log.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/install_all_pre/
+ ln -sf ../common/log.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/install_all_post/
+ ln -sf ../common/log.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/install_pre/
+ ln -sf ../common/log.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/install_post/
+ ln -sf ../common/log.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/fetch_all_pre/
+ ln -sf ../common/log.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/fetch_all_post/
+ ln -sf ../common/log.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/fetch_pre/
+ ln -sf ../common/log.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/fetch_post/
+ ln -sf ../common/log.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/uninstall_all_pre/
+ ln -sf ../common/log.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/uninstall_all_post/
+ ln -sf ../common/log.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/uninstall_pre/
+ ln -sf ../common/log.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/uninstall_post/
+ ln -sf ../common/log.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/sync_pre/
+ ln -sf ../common/log.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/sync_post/
+ ln -sf ../common/news.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/sync_all_post/
+ ln -sf ../common/news.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/install_all_post/
+ ln -sf ../common/news.bash $(DESTDIR)/$(libexecdir)/paludis/hooks/install_pretend_post/
+
+uninstall-local :
+ rm $(DESTDIR)/$(libexecdir)/paludis/hooks/*/gnu_info_index.bash
+ rm $(DESTDIR)/$(libexecdir)/paludis/hooks/*/eselect_env_update.bash
+ rm $(DESTDIR)/$(libexecdir)/paludis/hooks/*/log.bash
+ rm $(DESTDIR)/$(libexecdir)/paludis/hooks/*/news.bash
+
+Makefile.am : Makefile.am.m4
+ $(top_srcdir)/misc/do_m4.bash Makefile.am
+
diff --git a/0.4.0/hooks/eselect_env_update.bash b/0.4.0/hooks/eselect_env_update.bash
new file mode 100755
index 000000000..37f1f69b4
--- /dev/null
+++ b/0.4.0/hooks/eselect_env_update.bash
@@ -0,0 +1,27 @@
+#!/bin/bash
+# vim: set et sw=4 sts=4 :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+export PATH="$(${PALUDIS_EBUILD_DIR}/utils/canonicalise ${PALUDIS_EBUILD_DIR}/utils/ ):${PATH}"
+source ${PALUDIS_EBUILD_DIR}/echo_functions.bash
+
+echo
+einfo "Regenerating environment..."
+eselect env update || exit 1
+einfo "Done regenerating environment"
+
diff --git a/0.4.0/hooks/find_config_updates.bash b/0.4.0/hooks/find_config_updates.bash
new file mode 100755
index 000000000..fb2ff72e0
--- /dev/null
+++ b/0.4.0/hooks/find_config_updates.bash
@@ -0,0 +1,43 @@
+#!/bin/bash
+# vim: set et sw=4 sts=4 :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+export PATH="$(${PALUDIS_EBUILD_DIR}/utils/canonicalise ${PALUDIS_EBUILD_DIR}/utils/ ):${PATH}"
+source ${PALUDIS_EBUILD_DIR}/echo_functions.bash
+
+echo
+einfo "Searching for configuration files requiring action..."
+
+dir_count=0
+for dir in /etc ${CONFIG_PROTECT} ; do
+ [[ -d "${ROOT%/}/${dir}" ]] || continue
+ if [[ -n $(find "${ROOT%/}/${dir}" -iname '._cfg????_*' ) ]] ; then
+ einfo "Found files in ${ROOT%/}/${dir}"
+ dir_count=$((dir_count + 1))
+ fi
+done
+
+if [[ 0 -eq "${dir_count}" ]] ; then
+ einfo "No configuration file updates required"
+ exit 0
+else
+ ewarn "Found files in ${dir_count} directories"
+ ewarn "Your action is required"
+ exit 0
+fi
+
diff --git a/0.4.0/hooks/gnu_info_index.bash b/0.4.0/hooks/gnu_info_index.bash
new file mode 100755
index 000000000..64baaeb7f
--- /dev/null
+++ b/0.4.0/hooks/gnu_info_index.bash
@@ -0,0 +1,83 @@
+#!/bin/bash
+# vim: set et sw=4 sts=4 :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+export PATH="$(${PALUDIS_EBUILD_DIR}/utils/canonicalise ${PALUDIS_EBUILD_DIR}/utils/ ):${PATH}"
+source ${PALUDIS_EBUILD_DIR}/echo_functions.bash
+
+echo
+einfo "Checking whether the GNU info directory needs updating..."
+
+regen_info_dirs=
+for info_path in ${INFOPATH/:/ } ; do
+ info_path="${ROOT%/}/${info_path}"
+ [[ -d "${info_path}" ]] || continue
+ info_time=$(getmtime "${info_path}" )
+
+ if [[ -f "${ROOT}/var/db/pkg/.cache/info_time_cache" ]] ; then
+ info_time_cache=$(getmtime "${ROOT}"/var/db/pkg/.cache/info_time_cache )
+ [[ "${info_time}" -le "${info_time_cache}" ]] && continue
+ fi
+
+ regen_info_dirs="${regen_info_dirs} ${info_path}"
+done
+
+if [[ -z "${regen_info_dirs}" ]] ; then
+ einfo "No updates needed"
+ exit 0
+fi
+
+good_count=0
+bad_count=0
+
+for info_path in ${regen_info_dirs} ; do
+ einfo "Updating directory ${info_path}..."
+
+ [[ -e "${info_path}"/dir ]] && mv -f "${info_path}/"dir{,.old}
+
+ for d in ${regen_info_dirs}/* ; do
+ [[ -f "${d}" ]] || continue
+ [[ "${d}" != "${d%dir}" ]] && continue
+ [[ "${d}" != "${d%dir.old}" ]] && continue
+
+ is_bad=
+ /usr/bin/install-info --quiet --dir-file="${info_path}/dir" "${d}" 2>&1 | \
+ while read line ; do
+ [[ "${line/already exists, for file/}" != "${line}" ]] && continue
+ [[ "${line/warning: no info dir entry in /}" != "${line}" ]] && continue
+ is_bad=probably
+ done
+
+ if [[ -n "${is_bad}" ]] ; then
+ bad_count=$(( bad_count + 1 ))
+ else
+ good_count=$(( good_count + 1 ))
+ fi
+ done
+done
+
+touch "${ROOT}/var/db/pkg/.cache/info_time_cache"
+
+if [[ ${bad_count} -gt 0 ]] ; then
+ ewarn "Processed $(( good_count + bad_count )) info files, with ${bad_count} errors"
+ exit 1
+else
+ einfo "Processed ${good_count} info files"
+ exit 0
+fi
+
diff --git a/0.4.0/hooks/log.bash b/0.4.0/hooks/log.bash
new file mode 100755
index 000000000..d4828ad11
--- /dev/null
+++ b/0.4.0/hooks/log.bash
@@ -0,0 +1,86 @@
+#!/bin/bash
+# vim: set et sw=4 sts=4 :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+mkdir -p "${ROOT}/var/log"
+
+(
+ echo -n "$(date +%s ): "
+
+ case "${HOOK}" in
+ install_pre)
+ echo "starting install of package ${TARGET}"
+ ;;
+
+ install_post)
+ echo "finished install of package ${TARGET}"
+ ;;
+
+ install_all_pre)
+ echo "starting install of targets ${TARGETS}"
+ ;;
+
+ install_all_post)
+ echo "finished install of targets ${TARGETS}"
+ ;;
+
+ uninstall_pre)
+ echo "starting uninstall of package ${TARGET}"
+ ;;
+
+ uninstall_post)
+ echo "finished uninstall of package ${TARGET}"
+ ;;
+
+ uninstall_all_pre)
+ echo "starting uninstall of targets ${TARGETS}"
+ ;;
+
+ uninstall_all_post)
+ echo "finished uninstall of targets ${TARGETS}"
+ ;;
+
+ fetch_pre)
+ echo "starting fetch of package ${TARGET}"
+ ;;
+
+ fetch_post)
+ echo "finished fetch of package ${TARGET}"
+ ;;
+
+ fetch_all_pre)
+ echo "starting fetch of targets ${TARGETS}"
+ ;;
+
+ fetch_all_post)
+ echo "finished fetch of targets ${TARGETS}"
+ ;;
+
+ sync_pre)
+ echo "starting sync of repository ${TARGET}"
+ ;;
+
+ sync_post)
+ echo "finished sync of repository ${TARGET}"
+ ;;
+
+ *)
+ echo "unknown hook ${HOOK}"
+ esac
+) >> ${ROOT}/var/log/paludis.log
+
diff --git a/0.4.0/hooks/news.bash b/0.4.0/hooks/news.bash
new file mode 100755
index 000000000..670f29e2e
--- /dev/null
+++ b/0.4.0/hooks/news.bash
@@ -0,0 +1,51 @@
+#!/bin/bash
+# vim: set et sw=4 sts=4 :
+
+# Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+export PATH="$(${PALUDIS_EBUILD_DIR}/utils/canonicalise ${PALUDIS_EBUILD_DIR}/utils/ ):${PATH}"
+source ${PALUDIS_EBUILD_DIR}/echo_functions.bash
+
+mkdir -p ${ROOT}/var/lib/paludis/news/
+
+done_echo=
+
+if [[ "${HOOK/pretend}" == "${HOOK}" ]] ; then
+ [[ -z "${done_echo}" ]] && echo ; done_echo=yes
+ einfo "Checking for news items..."
+
+ ${PALUDIS_COMMAND} --update-news
+fi
+
+count=0
+for f in "${ROOT}/var/lib/paludis/news/"news-*.unread ; do
+ [[ -f "${f}" ]] || continue
+ if grep --silent . "${f}" ; then
+ count=$(( count + $(grep --count . < "${f}" ) ))
+ fi
+done
+
+if [[ ${count} -gt 0 ]] ; then
+ [[ -z "${done_echo}" ]] && echo ; done_echo=yes
+ ewarn "You have ${count} unread news items"
+elif [[ "${HOOK/pretend}" == "${HOOK}" ]] ; then
+ [[ -z "${done_echo}" ]] && echo ; done_echo=yes
+ einfo "No unread news items found"
+fi
+
+true
+
diff --git a/0.4.0/misc/Makefile.am b/0.4.0/misc/Makefile.am
new file mode 100644
index 000000000..ef81f090c
--- /dev/null
+++ b/0.4.0/misc/Makefile.am
@@ -0,0 +1,4 @@
+CLEANFILES = *~
+MAINTAINERCLEANFILES = Makefile.in svn-version-filter-data.bash
+EXTRA_DIST = generated-file.txt svn-version-filter-data.bash.in do_m4.bash
+
diff --git a/0.4.0/misc/do_m4.bash b/0.4.0/misc/do_m4.bash
new file mode 100755
index 000000000..63a042e54
--- /dev/null
+++ b/0.4.0/misc/do_m4.bash
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+# vim: set sw=4 sts=4 et tw=80 :
+
+if test "xyes" = x"${BASH_VERSION}" ; then
+ echo "This is not bash!"
+ exit 127
+fi
+
+trap 'echo "exiting." ; exit 250' 15
+KILL_PID=$$
+
+get_m4() {
+ type "gm4" &>/dev/null && echo gm4 && return
+ type "m4" &>/dev/null && echo m4 && return
+ echo "Could not find m4" 1>&2
+ kill $KILL_PID
+}
+
+echo ">>> $(get_m4 ) -I. -I.. -I../.. -E ${1}.m4 > ${1}"
+if ! $(get_m4 ) -I. -I.. -I../.. -E ${1}.m4 > ${1} ; then
+ echo "oops!" 1>&2
+ exit 127
+fi
diff --git a/0.4.0/misc/generated-file.txt b/0.4.0/misc/generated-file.txt
new file mode 100644
index 000000000..25c83f24c
--- /dev/null
+++ b/0.4.0/misc/generated-file.txt
@@ -0,0 +1,9 @@
+#if 0
+# vim: set ro :
+
+# *********************************************************
+# THIS IS A GENERATED FILE! DO NOT EDIT THIS FILE DIRECTLY!
+# *********************************************************
+#
+#endif
+
diff --git a/0.4.0/misc/svn-version-filter-data.bash.in b/0.4.0/misc/svn-version-filter-data.bash.in
new file mode 100644
index 000000000..6b4b2492d
--- /dev/null
+++ b/0.4.0/misc/svn-version-filter-data.bash.in
@@ -0,0 +1 @@
+export VERSION=@VERSION@
diff --git a/0.4.0/misc/svn-version-filter.bash b/0.4.0/misc/svn-version-filter.bash
new file mode 100755
index 000000000..38a36b74d
--- /dev/null
+++ b/0.4.0/misc/svn-version-filter.bash
@@ -0,0 +1,30 @@
+#!/usr/bin/env bash
+
+# For Doxygen. See:
+# http://www.stack.nl/~dimitri/doxygen/config.html#cfg_file_version_filter
+
+source ${0/.bash/-data.bash}
+
+case $1 in
+ *.svn*)
+ echo $VERSION
+ ;;
+
+ *)
+ case "$(basename $1 )" in
+ *.cc|*.hh|*.hh.in)
+ if type svn &>/dev/null ; then
+ echo -n "svn "
+ svn stat -v $1 | sed -n 's/^[ A-Z?\*|!]\{1,15\}/r/;s/ \{1,15\}/\/r/;s/ .*//p'
+ else
+ echo $VERSION
+ fi
+ ;;
+
+ *)
+ echo $VERSION
+ ;;
+ esac
+ ;;
+esac
+
diff --git a/0.4.0/paludis/Makefile.am.m4 b/0.4.0/paludis/Makefile.am.m4
new file mode 100644
index 000000000..7117e16be
--- /dev/null
+++ b/0.4.0/paludis/Makefile.am.m4
@@ -0,0 +1,69 @@
+ifdef(`__gnu__',`',`errprint(`This is not GNU m4...
+')m4exit(1)') include(`misc/generated-file.txt')
+
+dnl vim: set ft=m4 noet :
+
+define(`filelist', `')dnl
+define(`testlist', `')dnl
+define(`headerlist', `')dnl
+define(`testscriptlist', `')dnl
+define(`addtest', `define(`testlist', testlist `$1_TEST')dnl
+$1_TEST_SOURCES = $1_TEST.cc
+$1_TEST_LDADD = $(top_builddir)/paludis/util/test_extras.o \
+ $(top_builddir)/test/libtest.a \
+ libpaludis.a \
+ $(top_builddir)/paludis/util/libpaludisutil.a
+$1_TEST_CXXFLAGS = -I$(top_srcdir)
+')dnl
+define(`addtestscript', `define(`testscriptlist', testscriptlist `$1_TEST_setup.sh $1_TEST_cleanup.sh')')dnl
+define(`addhh', `define(`filelist', filelist `$1.hh')define(`headerlist', headerlist `$1.hh')')dnl
+define(`addcc', `define(`filelist', filelist `$1.cc')')dnl
+define(`addimpl', `define(`filelist', filelist `$1-impl.hh')')dnl
+define(`addthis', `dnl
+ifelse(`$2', `hh', `addhh(`$1')', `')dnl
+ifelse(`$2', `cc', `addcc(`$1')', `')dnl
+ifelse(`$2', `impl', `addimpl(`$1')', `')dnl
+ifelse(`$2', `test', `addtest(`$1')', `')dnl
+ifelse(`$2', `testscript', `addtestscript(`$1')', `')')dnl
+define(`add', `addthis(`$1',`$2')addthis(`$1',`$3')addthis(`$1',`$4')dnl
+addthis(`$1',`$5')addthis(`$1',`$6')')dnl
+
+include(`paludis/files.m4')
+
+CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
+MAINTAINERCLEANFILES = Makefile.in Makefile.am about.hh paludis.hh \
+ hashed_containers.hh
+AM_CXXFLAGS = -I$(top_srcdir)
+DEFS= \
+ -DSYSCONFDIR=\"$(sysconfdir)\" \
+ -DLIBEXECDIR=\"$(libexecdir)\" \
+ -DDATADIR=\"$(datadir)\"
+EXTRA_DIST = about.hh.in Makefile.am.m4 paludis.hh.m4 files.m4 \
+ hashed_containers.hh.in testscriptlist
+SUBDIRS = digests util . args qa selinux
+
+libpaludis_a_SOURCES = filelist
+
+TESTS = testlist
+
+TESTS_ENVIRONMENT = env \
+ PALUDIS_EBUILD_DIR="$(top_srcdir)/ebuild/" \
+ PALUDIS_SKIP_CONFIG="yes" \
+ TEST_SCRIPT_DIR="$(srcdir)/" \
+ bash $(top_srcdir)/test/run_test.sh
+
+check_PROGRAMS = $(TESTS)
+check_SCRIPTS = testscriptlist
+lib_LIBRARIES = libpaludis.a
+paludis_includedir = $(includedir)/paludis/
+paludis_include_HEADERS = headerlist
+
+Makefile.am : Makefile.am.m4 files.m4
+ $(top_srcdir)/misc/do_m4.bash Makefile.am
+
+paludis.hh : paludis.hh.m4 files.m4
+ $(top_srcdir)/misc/do_m4.bash paludis.hh
+
+comparison_policy.hh : comparison_policy.hh.m4
+ $(top_srcdir)/misc/do_m4.bash comparison_policy.hh.m4
+
diff --git a/0.4.0/paludis/about.hh.in b/0.4.0/paludis/about.hh.in
new file mode 100644
index 000000000..cd171ec23
--- /dev/null
+++ b/0.4.0/paludis/about.hh.in
@@ -0,0 +1,117 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * 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
+ */
+
+@GENERATED_FILE@
+
+#ifndef PALUDIS_GUARD_PALUDIS_ABOUT_HH
+#define PALUDIS_GUARD_PALUDIS_ABOUT_HH 1
+
+/** \file
+ * Defines constants giving the Paludis version number and information about
+ * how Paludis was built.
+ *
+ * \ingroup grpabout
+ */
+
+/**
+ * The package name (eg Paludis).
+ *
+ * \ingroup grpabout
+ */
+#define PALUDIS_PACKAGE "@PACKAGE@"
+
+/**
+ * The major version (eg 0.4.1 -> 0).
+ *
+ * \ingroup grpabout
+ */
+#define PALUDIS_VERSION_MAJOR @VERSION_MAJOR@
+
+/**
+ * The minor version (eg 0.4.1 -> 4).
+ *
+ * \ingroup grpabout
+ */
+#define PALUDIS_VERSION_MINOR @VERSION_MINOR@
+
+/**
+ * The micro version (eg 0.4.1 -> 1).
+ *
+ * \ingroup grpabout
+ */
+#define PALUDIS_VERSION_MICRO @VERSION_MICRO@
+
+/**
+ * The version, two digits per part (eg 1.3.5 -> 10305).
+ *
+ * \ingroup grpabout
+ */
+#define PALUDIS_VERSION ((100 * 100 * PALUDIS_VERSION_MAJOR) \
+ + (100 * PALUDIS_VERSION_MINOR) + PALUDIS_VERSION_MICRO)
+
+/**
+ * The subversion revision, if applicable (eg "65" or "65M" or "").
+ *
+ * \ingroup grpabout
+ */
+#define PALUDIS_SUBVERSION_REVISION "@SVNVERSION@"
+
+/**
+ * The CXXFLAGS used to build Paludis.
+ *
+ * \ingroup grpabout
+ */
+#define PALUDIS_BUILD_CXXFLAGS "@CXXFLAGS@"
+
+/**
+ * The LDFLAGS used to build Paludis.
+ *
+ * \ingroup grpabout
+ */
+#define PALUDIS_BUILD_LDFLAGS "@LDFLAGS@"
+
+/**
+ * The compiler used to build Paludis.
+ *
+ * \ingroup grpabout
+ */
+#define PALUDIS_BUILD_CXX "@CXX@"
+
+/**
+ * The user who built Paludis.
+ *
+ * \ingroup grpabout
+ */
+#define PALUDIS_BUILD_USER "@BUILDUSER@"
+
+/**
+ * The host on which Paludis was built.
+ *
+ * \ingroup grpabout
+ */
+#define PALUDIS_BUILD_HOST "@BUILDHOST@"
+
+/**
+ * The date when Paludis was built.
+ *
+ * \ingroup grpabout
+ */
+#define PALUDIS_BUILD_DATE "@BUILDDATE@"
+
+#endif
diff --git a/0.4.0/paludis/about_TEST.cc b/0.4.0/paludis/about_TEST.cc
new file mode 100644
index 000000000..512647643
--- /dev/null
+++ b/0.4.0/paludis/about_TEST.cc
@@ -0,0 +1,86 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * 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
+ */
+
+#include <paludis/about.hh>
+#include <test/test_framework.hh>
+#include <test/test_runner.hh>
+
+using namespace test;
+using namespace paludis;
+
+/**
+ * \file
+ * Test cases for about.hh .
+ *
+ * \ingroup grptestcases
+ */
+
+namespace test_cases
+{
+ /**
+ * \test Version tests.
+ *
+ * \ingroup grptestcases
+ */
+ struct VersionTest : TestCase
+ {
+ VersionTest() : TestCase("about test") { }
+
+ void run()
+ {
+ TEST_CHECK(PALUDIS_VERSION_MAJOR >= 0);
+ TEST_CHECK(PALUDIS_VERSION_MAJOR <= 9);
+
+ TEST_CHECK(PALUDIS_VERSION_MINOR >= 0);
+ TEST_CHECK(PALUDIS_VERSION_MINOR <= 99);
+
+ TEST_CHECK(PALUDIS_VERSION_MICRO >= 0);
+ TEST_CHECK(PALUDIS_VERSION_MICRO <= 99);
+
+ TEST_CHECK(PALUDIS_VERSION >= 0);
+ TEST_CHECK(PALUDIS_VERSION <= 99999);
+ TEST_CHECK_EQUAL(PALUDIS_VERSION, 10000 * PALUDIS_VERSION_MAJOR +
+ 100 * PALUDIS_VERSION_MINOR + PALUDIS_VERSION_MICRO);
+
+ TEST_CHECK(std::string(PALUDIS_SUBVERSION_REVISION) != "i am a fish");
+ }
+ } test_case_about;
+
+ /**
+ * \test Build info tests.
+ *
+ * \ingroup grptestcases
+ */
+ struct BuildInfoTest : TestCase
+ {
+ BuildInfoTest() : TestCase("build info test") { }
+
+ void run()
+ {
+ TEST_CHECK(! std::string(PALUDIS_BUILD_CXX).empty());
+ TEST_CHECK(! std::string(PALUDIS_BUILD_CXXFLAGS).empty());
+ TEST_CHECK(std::string(PALUDIS_BUILD_LDFLAGS) != "i am a fish");
+
+ TEST_CHECK(! std::string(PALUDIS_BUILD_USER).empty());
+ TEST_CHECK(! std::string(PALUDIS_BUILD_HOST).empty());
+ TEST_CHECK(! std::string(PALUDIS_BUILD_DATE).empty());
+ }
+ } test_case_build_info;
+}
+
diff --git a/0.4.0/paludis/args/Makefile.am b/0.4.0/paludis/args/Makefile.am
new file mode 100644
index 000000000..ddfdac14f
--- /dev/null
+++ b/0.4.0/paludis/args/Makefile.am
@@ -0,0 +1,46 @@
+CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
+MAINTAINERCLEANFILES = Makefile.in
+AM_CXXFLAGS = -I$(top_srcdir)
+
+TESTS = \
+ args_TEST
+
+paludis_args_includedir = $(includedir)/paludis/args/
+
+paludis_args_include_HEADERS = \
+ args.hh \
+ args_error.hh \
+ args_group.hh \
+ args_handler.hh \
+ args_option.hh \
+ bad_argument.hh \
+ args_visitor.hh \
+ bad_value.hh \
+ missing_value.hh \
+ args_dumper.hh
+
+libpaludisargs_a_SOURCES = $(paludis_args_include_HEADERS) \
+ args.cc \
+ args_error.cc \
+ args_group.cc \
+ args_handler.cc \
+ args_option.cc \
+ bad_argument.cc \
+ args_visitor.cc \
+ bad_value.cc \
+ missing_value.cc \
+ args_dumper.cc
+
+TESTS_ENVIRONMENT = env -u PALUDIS_OPTIONS TEST_SCRIPT_DIR="$(srcdir)/" bash $(top_srcdir)/test/run_test.sh
+lib_LIBRARIES = libpaludisargs.a
+check_PROGRAMS = $(TESTS)
+
+test_ldadd = \
+ $(top_builddir)/test/libtest.a \
+ libpaludisargs.a \
+ $(top_builddir)/paludis/libpaludis.a \
+ $(top_builddir)/paludis/util/libpaludisutil.a
+
+args_TEST_SOURCES = args_TEST.cc
+args_TEST_LDADD = $(test_ldadd)
+
diff --git a/0.4.0/paludis/args/args.cc b/0.4.0/paludis/args/args.cc
new file mode 100644
index 000000000..fac59ce90
--- /dev/null
+++ b/0.4.0/paludis/args/args.cc
@@ -0,0 +1,27 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * 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
+ */
+
+#include "args.hh"
+
+/** \file
+ * Implementation for args.hh .
+ *
+ * \ingroup grplibpaludisargs
+ */
+
diff --git a/0.4.0/paludis/args/args.hh b/0.4.0/paludis/args/args.hh
new file mode 100644
index 000000000..ce54edae0
--- /dev/null
+++ b/0.4.0/paludis/args/args.hh
@@ -0,0 +1,35 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * 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_ARGS_ARGS_HH
+#define PALUDIS_GUARD_ARGS_ARGS_HH 1
+
+/** \file
+ * Master include file for command line argument handling.
+ *
+ * \ingroup grplibpaludisargs
+ */
+
+#include <paludis/args/args_error.hh>
+#include <paludis/args/args_group.hh>
+#include <paludis/args/args_handler.hh>
+#include <paludis/args/args_option.hh>
+#include <paludis/args/bad_argument.hh>
+
+#endif
diff --git a/0.4.0/paludis/args/args_TEST.cc b/0.4.0/paludis/args/args_TEST.cc
new file mode 100644
index 000000000..d94c7dd13
--- /dev/null
+++ b/0.4.0/paludis/args/args_TEST.cc
@@ -0,0 +1,161 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * 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
+ */
+
+#include <paludis/args/args.hh>
+#include <paludis/args/missing_value.hh>
+#include <test/test_framework.hh>
+#include <test/test_runner.hh>
+
+using namespace paludis;
+using namespace paludis::args;
+using namespace test;
+
+/** \file
+ * Test cases for paludis::args things.
+ *
+ * \ingroup grptestcases
+ */
+
+#ifndef DOXYGEN
+
+struct CommandLine : public ArgsHandler
+{
+ ArgsGroup group_one;
+ SwitchArg arg_foo;
+ SwitchArg arg_bar;
+ SwitchArg arg_dummy;
+
+ ArgsGroup group_two;
+ SwitchArg arg_baz;
+ AliasArg arg_other_baz;
+ StringArg arg_something;
+ IntegerArg arg_somenum;
+ EnumArg arg_enum;
+
+ ArgsGroup group_three;
+ EnumArg arg_other_enum;
+ StringSetArg arg_stringset;
+
+ CommandLine();
+ ~CommandLine();
+};
+
+CommandLine::CommandLine() :
+ group_one(this, "Group one"),
+ arg_foo(&group_one, "foo", 'f', "Enable foo"),
+ arg_bar(&group_one, "bar", 'b', "Enable bar"),
+ arg_dummy(&group_one, "dummy", 'd', "Enable something else"),
+
+ group_two(this, "Group two"),
+ arg_baz(&group_two, "baz", 'z', "Enable baz"),
+ arg_other_baz(&arg_baz, "other-baz"),
+ arg_something(&group_two, "something", 's', "Value of something"),
+ arg_somenum(&group_two, "num", 'n', "Some number"),
+ arg_enum(&group_two, "enum", 'e', "One of three", EnumArg::EnumArgOptions("one", "Option one")("two", "option two")("three", "option three"), "two"),
+
+ group_three(this, "Group three"),
+ arg_other_enum(&group_three, "something", '\0', "Blah.", EnumArg::EnumArgOptions("a", "A")("b", "B")("c", "C"), "b"),
+ arg_stringset(&group_three, "stringset", 't', "A StringSet.")
+{
+}
+
+CommandLine::~CommandLine()
+{
+}
+
+#endif
+
+namespace test_cases
+{
+ /**
+ * \test Simple args tests.
+ *
+ * \ingroup grptestcases
+ */
+ struct ArgsTestSimple : TestCase
+ {
+ ArgsTestSimple() : TestCase("simple") { }
+
+ void run()
+ {
+ char * args[] = { "program-name", "--other-baz", "-fsne", "blah", "7", "three", "--", "--dummy",
+ "one", "two" };
+ CommandLine c1;
+ c1.run(10, args);
+ TEST_CHECK(c1.arg_foo.specified());
+ TEST_CHECK(! c1.arg_bar.specified());
+ TEST_CHECK(c1.arg_baz.specified());
+ TEST_CHECK(c1.arg_other_baz.specified());
+ TEST_CHECK(c1.arg_something.specified());
+ TEST_CHECK(c1.arg_something.argument() == "blah");
+ TEST_CHECK(c1.arg_somenum.specified());
+ TEST_CHECK(c1.arg_somenum.argument() == 7);
+ TEST_CHECK(c1.arg_enum.specified());
+ TEST_CHECK(c1.arg_enum.argument() == "three");
+ TEST_CHECK(! c1.arg_dummy.specified());
+ TEST_CHECK(! c1.arg_other_enum.specified());
+ TEST_CHECK(c1.arg_other_enum.argument() == "b");
+
+ TEST_CHECK_EQUAL(std::distance(c1.begin_parameters(), c1.end_parameters()), 3);
+ TEST_CHECK_EQUAL(*c1.begin_parameters(), "--dummy");
+ TEST_CHECK_EQUAL(*++c1.begin_parameters(), "one");
+ TEST_CHECK_EQUAL(*++(++(c1.begin_parameters())), "two");
+ }
+ } test_args_simple;
+
+ /**
+ * \test Missing parameters tests.
+ *
+ * \ingroup grptestcases
+ */
+ struct ArgsTestNoParam : TestCase
+ {
+ ArgsTestNoParam() : TestCase("Missing parameters") { }
+
+ void run()
+ {
+ char *args[] = { "program-name", "-e" };
+ CommandLine c1;
+ TEST_CHECK_THROWS(c1.run(2, args), MissingValue);
+ }
+ } test_args_no_param;
+
+ /**
+ * \test String tests.
+ *
+ * \ingroup grptestcases
+ */
+ struct ArgsTestStringSet : TestCase
+ {
+ ArgsTestStringSet() : TestCase("StringSet") { }
+
+ void run()
+ {
+ char *args[] = { "program-name", "--stringset", "one", "-t", "two", "-t", "three", "fnord" };
+ CommandLine c1;
+ c1.run(8, args);
+ TEST_CHECK(c1.arg_stringset.specified());
+ TEST_CHECK(std::find(c1.arg_stringset.args_begin(), c1.arg_stringset.args_end(), "one") != c1.arg_stringset.args_end());
+ TEST_CHECK(std::find(c1.arg_stringset.args_begin(), c1.arg_stringset.args_end(), "two") != c1.arg_stringset.args_end());
+ TEST_CHECK(std::find(c1.arg_stringset.args_begin(), c1.arg_stringset.args_end(), "three") != c1.arg_stringset.args_end());
+ TEST_CHECK(std::find(c1.arg_stringset.args_begin(), c1.arg_stringset.args_end(), "fnord") == c1.arg_stringset.args_end());
+ }
+ } test_args_string_set;
+}
+
diff --git a/0.4.0/paludis/args/args_dumper.cc b/0.4.0/paludis/args/args_dumper.cc
new file mode 100644
index 000000000..afdc747c0
--- /dev/null
+++ b/0.4.0/paludis/args/args_dumper.cc
@@ -0,0 +1,81 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+ *
+ * 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 as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ * 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
+ */
+
+#include <paludis/args/args_dumper.hh>
+#include <paludis/args/args_option.hh>
+
+#include <sstream>
+
+/** \file
+ * Implementation of ArgsDumper.
+ *
+ * \ingroup grplibpaludisargs
+ */
+
+using namespace paludis;
+using namespace paludis::args;
+
+ArgsDumper::ArgsDumper(std::ostream & os) :
+ _os(os)
+{
+}
+
+void ArgsDumper::visit(const ArgsOption * const a)
+{
+ std::stringstream p;
+ p << " --" << a->long_name();
+ if (a->short_name())
+ p << ", -" << a->short_name();
+ if (p.str().length() < 24)
+ p << std::string(24 - p.str().length(), ' ');
+ else
+ p << std::endl << std::string(24, ' ');
+ _os << p.str();
+ _os << " " << a->description() << std::endl;
+}
+
+#ifndef DOXYGEN
+#define VISIT(type) void ArgsDumper::visit(const type * const a) \
+ { visit(static_cast<const ArgsOption *>(a)); }
+
+VISIT(SwitchArg)
+VISIT(StringArg)
+VISIT(IntegerArg)
+VISIT(AliasArg)
+VISIT(StringSetArg)
+#endif
+
+void ArgsDumper::visit(const EnumArg * const a)
+{
+ visit(static_cast<const ArgsOption *>(a));
+ for (EnumArg::AllowedArgIterator it = a->begin_allowed_args(), it_end = a->end_allowed_args();
+ it != it_end; ++it)
+ {
+ std::stringstream p;
+ p << " " << (*it).first;
+ if (p.str().length() < 26)
+ p << std::string(26 - p.str().length(), ' ');
+ _os << p.str();
+ _os << " " << (*it).second;
+ if ((*it).first == a->default_arg())
+ _os << " (default)";
+ _os << std::endl;
+ }
+}
diff --git a/0.4.0/paludis/args/args_dumper.hh b/0.4.0/paludis/args/args_dumper.hh
new file mode 100644
index 000000000..34ba0a1b3
--- /dev/null
+++ b/0.4.0/paludis/args/args_dumper.hh
@@ -0,0 +1,79 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+ *
+ * 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 as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ * 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_ARGS_ARGS_DUMPER_HH
+#define PALUDIS_GUARD_PALUDIS_ARGS_ARGS_DUMPER_HH 1
+
+#include <ostream>
+#include <paludis/args/args_visitor.hh>
+#include <paludis/util/visitor.hh>
+
+namespace paludis
+{
+ namespace args
+ {
+ class ArgsOption;
+ class SwitchArg;
+ class StringArg;
+ class IntegerArg;
+ class AliasArg;
+ class EnumArg;
+
+ /**
+ * Visitor class. Prints help text appropriate to each command line option.
+ *
+ * \ingroup grplibpaludisargs
+ */
+ class ArgsDumper : public ArgsVisitorTypes::ConstVisitor
+ {
+ private:
+ std::ostream & _os;
+
+ public:
+ /**
+ * Constructor.
+ */
+ ArgsDumper(std::ostream & os);
+
+ /// Visit an ArgsOption.
+ void visit(const ArgsOption * const);
+
+ /// Visit a SwitchArg.
+ void visit(const SwitchArg * const);
+
+ /// Visit a StringArg.
+ void visit(const StringArg * const);
+
+ /// Visit an IntegerArg.
+ void visit(const IntegerArg * const);
+
+ /// Visit an AliasArg.
+ void visit(const AliasArg * const);
+
+ /// Visit an EnumArg.
+ void visit(const EnumArg * const);
+
+ /// Visit a StringSetArg.
+ void visit(const StringSetArg * const);
+ };
+ }
+}
+
+#endif
diff --git a/0.4.0/paludis/args/args_error.cc b/0.4.0/paludis/args/args_error.cc
new file mode 100644
index 000000000..46aaa0d27
--- /dev/null
+++ b/0.4.0/paludis/args/args_error.cc
@@ -0,0 +1,35 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * 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
+ */
+
+#include "args_error.hh"
+
+/** \file
+ * Implementation for ArgsError.
+ *
+ * \ingroup grplibpaludisargs
+ * \ingroup grpexceptions
+ */
+
+using namespace paludis::args;
+
+ArgsError::ArgsError(const std::string & message) throw () :
+ paludis::Exception("Error handling command line: " + message)
+{
+}
+
diff --git a/0.4.0/paludis/args/args_error.hh b/0.4.0/paludis/args/args_error.hh
new file mode 100644
index 000000000..8d8355bfa
--- /dev/null
+++ b/0.4.0/paludis/args/args_error.hh
@@ -0,0 +1,53 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * 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_ARGS_ARGS_ERROR_HH
+#define PALUDIS_GUARD_ARGS_ARGS_ERROR_HH 1
+
+#include <paludis/util/exception.hh>
+#include <string>
+
+/** \file
+ * Declaration for ArgsError.
+ *
+ * \ingroup grplibpaludisargs
+ */
+
+namespace paludis
+{
+ namespace args
+ {
+ /**
+ * Thrown if an invalid command line argument is provided.
+ *
+ * \ingroup grplibpaludisargs
+ * \ingroup grpexceptions
+ */
+ class ArgsError : public paludis::Exception
+ {
+ protected:
+ /**
+ * Constructor.
+ */
+ ArgsError(const std::string & message) throw ();
+ };
+ }
+}
+
+#endif
diff --git a/0.4.0/paludis/args/args_group.cc b/0.4.0/paludis/args/args_group.cc
new file mode 100644
index 000000000..593e3e7e8
--- /dev/null
+++ b/0.4.0/paludis/args/args_group.cc
@@ -0,0 +1,47 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * 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
+ */
+
+#include "args.hh"
+
+/** \file
+ * Implementation for ArgsGroup.
+ *
+ * \ingroup grplibpaludisargs
+ */
+
+using namespace paludis::args;
+
+ArgsGroup::ArgsGroup(ArgsHandler * h, const std::string & name) :
+ _name(name),
+ _handler(h)
+{
+ h->add(this);
+}
+
+void
+ArgsGroup::add(ArgsOption * const value)
+{
+ /// \bug Should check for uniqueness of short and long names.
+ _args_options.push_back(value);
+}
+
+ArgsGroup::~ArgsGroup()
+{
+}
+
diff --git a/0.4.0/paludis/args/args_group.hh b/0.4.0/paludis/args/args_group.hh
new file mode 100644
index 000000000..c4d4aa53f
--- /dev/null
+++ b/0.4.0/paludis/args/args_group.hh
@@ -0,0 +1,98 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * 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_ARGS_ARGS_GROUP_HH
+#define PALUDIS_GUARD_ARGS_ARGS_GROUP_HH 1
+
+#include <list>
+#include <paludis/args/args_option.hh>
+#include <string>
+
+/** \file
+ * Declaration for ArgsGroup.
+ *
+ * \ingroup grplibpaludisargs
+ */
+
+namespace paludis
+{
+
+ namespace args
+ {
+ class ArgsHandler;
+
+ /**
+ * Contains a related group of command line arguments.
+ *
+ * \ingroup grplibpaludisargs
+ */
+ class ArgsGroup
+ {
+ friend class ArgsHandler;
+ friend class ArgsOption;
+
+ private:
+ ArgsGroup(const ArgsGroup &);
+
+ void operator= (const ArgsGroup &);
+
+ const std::string _name;
+
+ std::list<ArgsOption *> _args_options;
+
+ ArgsHandler * _handler;
+
+ protected:
+ /**
+ * Add an ArgsOption instance (called by the ArgsOption
+ * constructor).
+ */
+ void add(ArgsOption * const value);
+
+ public:
+ /**
+ * Constructor.
+ */
+ ArgsGroup(ArgsHandler * h, const std::string & name);
+
+ /**
+ * Destructor.
+ */
+ ~ArgsGroup();
+
+ /**
+ * Fetch our name.
+ */
+ const std::string & name() const
+ {
+ return _name;
+ }
+
+ /**
+ * Fetch our handler.
+ */
+ ArgsHandler * handler() const
+ {
+ return _handler;
+ }
+ };
+ }
+}
+
+#endif
diff --git a/0.4.0/paludis/args/args_handler.cc b/0.4.0/paludis/args/args_handler.cc
new file mode 100644
index 000000000..a68165554
--- /dev/null
+++ b/0.4.0/paludis/args/args_handler.cc
@@ -0,0 +1,129 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * 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
+ */
+
+#include "args.hh"
+#include "args_dumper.hh"
+#include <algorithm>
+#include <paludis/util/system.hh>
+
+/** \file
+ * Implementation for ArgsHandler.
+ *
+ * \ingroup grplibpaludisargs
+ */
+
+using namespace paludis::args;
+
+ArgsHandler::ArgsHandler()
+{
+}
+
+void
+ArgsHandler::add(ArgsGroup * const g)
+{
+ /// \bug Should check for name uniqueness.
+ _groups.push_back(g);
+}
+
+void
+ArgsHandler::run(const int argc, const char * const * const argv)
+{
+ std::list<std::string> args;
+
+ std::string env_options = paludis::getenv_with_default("PALUDIS_OPTIONS", "");
+
+ std::istringstream iss(env_options);
+ std::string option;
+ while(iss.good())
+ {
+ iss >> option;
+ if(!option.empty())
+ args.push_back(option);
+ }
+
+ args.insert(args.end(), &argv[1], &argv[argc]);
+
+ std::list<std::string>::iterator argit = args.begin(), arge = args.end();
+
+ ArgsVisitor visitor(&argit, arge);
+
+ for ( ; argit != arge; ++argit )
+ {
+ std::string arg = *argit;
+
+ if (arg == "--")
+ {
+ ++argit;
+ break;
+ }
+ else if (0 == arg.compare(0, 2, "--"))
+ {
+ arg.erase(0, 2);
+ std::map<std::string, ArgsOption*>::iterator it = _longopts.find(arg);
+ if (it == _longopts.end())
+ throw BadArgument("--" + arg);
+ (*it).second->accept(&visitor);
+ }
+ else if (arg[0] == '-')
+ {
+ arg.erase(0, 1);
+ for (std::string::iterator c = arg.begin(); c != arg.end(); ++c)
+ {
+ std::map<char, ArgsOption*>::iterator it = _shortopts.find(*c);
+ if (it == _shortopts.end())
+ {
+ throw BadArgument(std::string("-") + *c);
+ }
+ (*it).second->accept(&visitor);
+ }
+ }
+ else
+ {
+ _parameters.push_back(arg);
+ }
+ }
+
+ _parameters.insert(_parameters.end(), argit, args.end());
+}
+
+void
+ArgsHandler::dump_to_stream(std::ostream & s) const
+{
+ ArgsDumper dump(s);
+ std::list<ArgsGroup *>::const_iterator g(_groups.begin()), g_end(_groups.end());
+ for ( ; g != g_end ; ++g)
+ {
+ s << (*g)->name() << ":" << std::endl;
+
+ std::for_each((*g)->_args_options.begin(), (*g)->_args_options.end(),
+ accept_visitor(&dump));
+
+ s << std::endl;
+ }
+}
+
+#ifndef DOXYGEN
+std::ostream &
+paludis::args::operator<< (std::ostream & s, const ArgsHandler & h)
+{
+ h.dump_to_stream(s);
+ return s;
+}
+#endif
+
diff --git a/0.4.0/paludis/args/args_handler.hh b/0.4.0/paludis/args/args_handler.hh
new file mode 100644
index 000000000..42a517920
--- /dev/null
+++ b/0.4.0/paludis/args/args_handler.hh
@@ -0,0 +1,129 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * 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_ARGS_ARGS_HANDLER_HH
+#define PALUDIS_GUARD_ARGS_ARGS_HANDLER_HH 1
+
+#include <map>
+#include <ostream>
+#include <paludis/args/args_group.hh>
+#include <paludis/util/instantiation_policy.hh>
+#include <string>
+
+/** \file
+ * Declaration for ArgsHandler.
+ *
+ * \ingroup grplibpaludisargs
+ */
+
+namespace paludis
+{
+ namespace args
+ {
+ /**
+ * Handles command line arguments.
+ *
+ * \ingroup grplibpaludisargs
+ */
+ class ArgsHandler : private InstantiationPolicy<ArgsHandler, instantiation_method::NonCopyableTag>
+ {
+ friend class ArgsGroup;
+ friend std::ostream & operator<< (std::ostream &, const ArgsHandler &);
+
+ private:
+ std::list<ArgsGroup *> _groups;
+ std::list<std::string> _parameters;
+
+ std::map<std::string, ArgsOption *> _longopts;
+ std::map<char, ArgsOption *> _shortopts;
+
+ protected:
+ /**
+ * Add an new ArgsGroup (called by the ArgsGroup constructor).
+ */
+ void add(ArgsGroup * const);
+
+ /**
+ * Dump, for --help output (called by operator<<).
+ */
+ void dump_to_stream(std::ostream & s) const;
+
+ public:
+ /**
+ * Constructor.
+ */
+ ArgsHandler();
+
+ /**
+ * Parse command line arguments.
+ */
+ void run(const int, const char * const * const);
+
+ /**
+ * Iterate over our parameters (non - and -- switches and their
+ * values).
+ */
+ typedef std::list<std::string>::const_iterator ParametersIterator;
+
+ /**
+ * Pointer to the start of our parameters.
+ */
+ ParametersIterator begin_parameters() const
+ {
+ return _parameters.begin();
+ }
+
+ /**
+ * Pointer to past the end of our parameters.
+ */
+ ParametersIterator end_parameters() const
+ {
+ return _parameters.end();
+ }
+
+ /**
+ * Do we have no parameters?
+ */
+ bool empty() const
+ {
+ return _parameters.empty();
+ }
+
+ /**
+ * Add an ArgsOption instance.
+ */
+ void add_option(ArgsOption *opt, const std::string long_name, const char short_name = '\0')
+ {
+ _longopts[long_name] = opt;
+ if (short_name != '\0')
+ _shortopts[short_name] = opt;
+ }
+
+ };
+
+ /**
+ * Output an ArgsHandler to an ostream, for --help output.
+ *
+ * \ingroup grplibpaludisargs
+ */
+ std::ostream & operator<< (std::ostream &, const ArgsHandler &);
+ }
+}
+
+#endif
diff --git a/0.4.0/paludis/args/args_option.cc b/0.4.0/paludis/args/args_option.cc
new file mode 100644
index 000000000..b7f4287bc
--- /dev/null
+++ b/0.4.0/paludis/args/args_option.cc
@@ -0,0 +1,134 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * 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
+ */
+
+#include "args.hh"
+#include "bad_value.hh"
+
+/** \file
+ * Implementation for ArgsOption.
+ *
+ * \ingroup grplibpaludisargs
+ */
+
+using namespace paludis::args;
+
+ArgsOption::ArgsOption(ArgsGroup * const g, const std::string & long_name,
+ const char short_name, const std::string & description) :
+ _group(g),
+ _long_name(long_name),
+ _short_name(short_name),
+ _description(description),
+ _specified(false)
+{
+ g->add(this);
+ g->_handler->add_option(this, long_name, short_name);
+}
+
+ArgsOption::~ArgsOption()
+{
+}
+
+SwitchArg::SwitchArg(ArgsGroup * const group, std::string long_name, char short_name,
+ std::string description) :
+ ArgsOption(group, long_name, short_name, description)
+{
+}
+
+SwitchArg::~SwitchArg()
+{
+}
+
+AliasArg::AliasArg(ArgsOption * const other, const std::string & long_name) :
+ ArgsOption(other->group(), long_name, '\0', "Alias for --" + other->long_name()),
+ _other(other)
+{
+ other->group()->handler()->add_option(other, long_name);
+}
+
+StringArg::StringArg(ArgsGroup * const g, const std::string & long_name,
+ const char short_name, const std::string & description) :
+ ArgsOption(g, long_name, short_name, description)
+{
+}
+
+StringSetArg::StringSetArg(ArgsGroup * const g, const std::string & long_name,
+ const char short_name, const std::string & description) :
+ ArgsOption(g, long_name, short_name, description)
+{
+}
+
+IntegerArg::IntegerArg(ArgsGroup * const group, const std::string& long_name,
+ char short_name, const std::string& description) :
+ ArgsOption(group, long_name, short_name, description)
+{
+}
+
+namespace
+{
+ /**
+ * Is an arg a particular value?
+ *
+ * \ingroup grplibpaludisargs
+ */
+ struct ArgIs
+ {
+ /// The argument.
+ const std::string arg;
+
+ /// Constructor.
+ ArgIs(const std::string & a) :
+ arg(a)
+ {
+ }
+
+ /// Comparator.
+ bool operator() (const std::pair<std::string, std::string> & p) const
+ {
+ return p.first == arg;
+ }
+ };
+}
+
+void EnumArg::set_argument(const std::string & arg)
+{
+ if (_allowed_args.end() == std::find_if(_allowed_args.begin(),
+ _allowed_args.end(), ArgIs(arg)))
+ throw (BadValue("--" + long_name(), arg));
+
+ _argument = arg;
+}
+
+EnumArg::~EnumArg()
+{
+}
+
+EnumArg::EnumArgOptions::EnumArgOptions(std::string opt, std::string desc)
+{
+ _options.push_back(std::make_pair(opt, desc));
+}
+
+EnumArg::EnumArgOptions & EnumArg::EnumArgOptions::operator() (std::string opt, std::string desc)
+{
+ _options.push_back(std::make_pair(opt, desc));
+ return *this;
+}
+
+EnumArg::EnumArgOptions::~EnumArgOptions()
+{
+}
diff --git a/0.4.0/paludis/args/args_option.hh b/0.4.0/paludis/args/args_option.hh
new file mode 100644
index 000000000..bce3c863b
--- /dev/null
+++ b/0.4.0/paludis/args/args_option.hh
@@ -0,0 +1,359 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ * Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+ *
+ * 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_ARGS_ARGS_OPTION_HH
+#define PALUDIS_GUARD_ARGS_ARGS_OPTION_HH 1
+
+#include <paludis/args/args_visitor.hh>
+#include <set>
+#include <string>
+#include <vector>
+
+/** \file
+ * Declaration for ArgsOption.
+ *
+ * \ingroup grplibpaludisargs
+ */
+
+namespace paludis
+{
+ namespace args
+ {
+ class ArgsGroup;
+
+ /**
+ * Base class for a command line option.
+ *
+ * \ingroup grplibpaludisargs
+ */
+ class ArgsOption : public virtual VisitableInterface<ArgsVisitorTypes>
+ {
+ friend class ArgsHandler;
+
+ private:
+ ArgsGroup * const _group;
+
+ const std::string _long_name;
+ const char _short_name;
+ const std::string _description;
+
+ bool _specified;
+
+ ArgsOption(const ArgsOption &);
+
+ void operator= (const ArgsOption &);
+
+ protected:
+ /**
+ * Constructor.
+ */
+ ArgsOption(ArgsGroup * const, const std::string & long_name,
+ const char short_name, const std::string & description);
+
+ /**
+ * Destructor.
+ */
+ ~ArgsOption();
+
+ public:
+ /**
+ * Fetch our long name.
+ */
+ const std::string & long_name() const
+ {
+ return _long_name;
+ }
+
+ /**
+ * Fetch our short name (may be 0).
+ */
+ char short_name() const
+ {
+ return _short_name;
+ }
+
+ /**
+ * Fetch our description.
+ */
+ const std::string & description() const
+ {
+ return _description;
+ }
+
+ /**
+ * Fetch whether or not we were specified on the
+ * command line.
+ */
+ virtual bool specified() const
+ {
+ return _specified;
+ }
+
+ /**
+ * Set the value returned by specified().
+ */
+ virtual void set_specified(const bool value)
+ {
+ _specified = value;
+ }
+
+ /**
+ * Fetch our group.
+ */
+ ArgsGroup * group()
+ {
+ return _group;
+ }
+ };
+
+ /**
+ * A SwitchArg is an option that can either be specified or not
+ * specified, and that takes no value (for example, --help).
+ *
+ * \ingroup grplibpaludisargs
+ */
+ class SwitchArg : public ArgsOption, public Visitable<SwitchArg, ArgsVisitorTypes>
+ {
+ public:
+ /**
+ * Constructor.
+ */
+ SwitchArg(ArgsGroup * const group, std::string long_name, char short_name,
+ std::string description);
+
+ ~SwitchArg();
+ };
+
+ /**
+ * An option that takes a string argument.
+ *
+ * \ingroup grplibpaludisargs
+ */
+ class StringArg : public ArgsOption, public Visitable<StringArg, ArgsVisitorTypes>
+ {
+ private:
+ std::string _argument;
+
+ public:
+
+ /**
+ * Constructor
+ */
+ StringArg(ArgsGroup * const, const std::string & long_name,
+ const char short_name, const std::string & description);
+
+ /**
+ * Fetch the argument that was given to this option.
+ */
+ const std::string& argument() const { return _argument; }
+
+ /**
+ * Set the argument returned by argument().
+ */
+ void set_argument(const std::string& arg) { _argument = arg; }
+ };
+
+ /**
+ * An option that takes a set of strings.
+ *
+ * \ingroup grplibpaludisargs
+ */
+ class StringSetArg : public ArgsOption, public Visitable<StringSetArg, ArgsVisitorTypes>
+ {
+ private:
+ std::set<std::string> _args;
+
+ public:
+
+ /**
+ * Type used to iterate over specified args.
+ */
+ typedef std::set<std::string>::const_iterator Iterator;
+
+ /**
+ * Constructor
+ */
+ StringSetArg(ArgsGroup * const, const std::string & long_name,
+ const char short_name, const std::string & description);
+
+ /**
+ * Retrieve an iterator to the first arg
+ */
+ Iterator args_begin() const { return _args.begin(); }
+
+ /**
+ * Retrieve an iterator one past the last arg
+ */
+ Iterator args_end() const { return _args.end(); }
+
+ /**
+ * Add an argument to the set returned by [ args_begin(), args_end() )
+ */
+ void add_argument(const std::string & arg) { _args.insert(arg); }
+ };
+
+
+ /**
+ * An AliasArg is an alias for another argument.
+ *
+ * \ingroup grplibpaludisargs
+ */
+ class AliasArg : public ArgsOption, public Visitable<AliasArg, ArgsVisitorTypes>
+ {
+ private:
+ ArgsOption * const _other;
+
+ public:
+ /**
+ * Constructor.
+ */
+ AliasArg(ArgsOption * const other, const std::string & new_long_name);
+
+ virtual bool specified() const
+ {
+ return _other->specified();
+ }
+
+ virtual void set_specified(const bool value)
+ {
+ _other->set_specified(value);
+ }
+ };
+
+ /**
+ * An option that takes an integer argument.
+ *
+ * \ingroup grplibpaludisargs
+ */
+ class IntegerArg : public ArgsOption, public Visitable<IntegerArg, ArgsVisitorTypes>
+ {
+ private:
+ int _argument;
+
+ public:
+ /**
+ * Constructor
+ */
+ IntegerArg(ArgsGroup * const, const std::string & long_name,
+ const char short_name, const std::string & description);
+ /**
+ * Fetch the argument that was given to this option.
+ */
+ int argument() const { return _argument; }
+
+ /**
+ * Set the argument returned by argument().
+ */
+ void set_argument(const int arg) { _argument = arg; }
+ };
+
+ /**
+ * An option that takes one of a predefined set of string arguments.
+ *
+ * \ingroup grplibpaludisargs
+ */
+ class EnumArg : public ArgsOption, public Visitable<EnumArg, ArgsVisitorTypes>
+ {
+ private:
+ const std::vector<std::pair<std::string, std::string> > _allowed_args;
+ std::string _argument;
+ const std::string _default_arg;
+
+ public:
+
+ /**
+ * Helper class for passing available options and associated descriptions
+ * to the EnumArg constructor.
+ *
+ * \ingroup grplibpaludisargs
+ */
+ class EnumArgOptions
+ {
+ private:
+ friend class EnumArg;
+ std::vector<std::pair<std::string, std::string> > _options;
+
+ public:
+ /**
+ * Constructor
+ */
+ EnumArgOptions(const std::string, const std::string);
+
+ /**
+ * Destructor.
+ */
+ ~EnumArgOptions();
+
+ /**
+ * Adds another (option, description) pair.
+ */
+ EnumArgOptions& operator() (const std::string, const std::string);
+ };
+
+ /**
+ * Constructor.
+ */
+ EnumArg(ArgsGroup * const group, const std::string & long_name,
+ const char short_name, const std::string & description,
+ const EnumArgOptions & opts, const std::string & default_arg) :
+ ArgsOption(group, long_name, short_name, description),
+ _allowed_args(opts._options), _argument(default_arg),
+ _default_arg(default_arg)
+ {
+ }
+
+ ~EnumArg();
+
+ /**
+ * Fetch the argument that was given to this option.
+ */
+ const std::string & argument() const { return _argument; }
+
+ /**
+ * Set the argument returned by argument(), having verified that
+ * it is one of the arguments allowed for this option.
+ */
+ void set_argument(const std::string & arg);
+
+ /**
+ * Fetch the default option, as specified to the constructor.
+ */
+ const std::string & default_arg() const { return _default_arg; }
+
+ /**
+ * Type used to iterate over valid arguments to this option
+ */
+ typedef std::vector<std::pair<std::string, std::string> >::const_iterator AllowedArgIterator;
+
+ /**
+ * Returns an iterator pointing to a pair containing the first valid argument,
+ * and its description.
+ */
+ AllowedArgIterator begin_allowed_args() const { return _allowed_args.begin(); }
+
+ /**
+ * Returns an iterator pointing just beyond the last valid argument.
+ */
+ AllowedArgIterator end_allowed_args() const { return _allowed_args.end(); }
+ };
+ }
+}
+
+#endif
diff --git a/0.4.0/paludis/args/args_visitor.cc b/0.4.0/paludis/args/args_visitor.cc
new file mode 100644
index 000000000..979debd67
--- /dev/null
+++ b/0.4.0/paludis/args/args_visitor.cc
@@ -0,0 +1,97 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+/*
+ * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * 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
+ */
+
+#include "args_option.hh"
+#include "bad_value.hh"
+#include "missing_value.hh"
+#include <paludis/util/visitor.hh>
+
+#include <paludis/util/destringify.hh>
+
+#include <sstream>
+
+/** \file
+ * Implementation for ArgsVisitor.
+ *
+ * \ingroup grplibpaludisargs
+ */
+
+using namespace paludis;
+using namespace args;
+
+ArgsVisitor::ArgsVisitor(std::list<std::string>::iterator *ai,
+ std::list<std::string>::iterator ae) : _args_index(ai), _args_end(ae)
+{
+}
+
+const std::string& ArgsVisitor::get_param(const ArgsOption * const arg)
+{
+ if (++(*_args_index) == _args_end)
+ {
+ throw MissingValue("--" + arg->long_name());
+ }
+ return **_args_index;
+}
+
+void ArgsVisitor::visit(ArgsOption * const arg)
+{
+ arg->set_specified(true);
+}
+
+void ArgsVisitor::visit(StringArg * const arg)
+{
+ visit(static_cast<ArgsOption *>(arg));
+ arg->set_argument(get_param(arg));
+}
+
+void ArgsVisitor::visit(AliasArg * const arg)
+{
+ visit(static_cast<ArgsOption *>(arg));
+}
+
+void ArgsVisitor::visit(SwitchArg * const arg)
+{
+ visit(static_cast<ArgsOption *>(arg));
+}
+
+void ArgsVisitor::visit(IntegerArg * const arg)
+{
+ visit(static_cast<ArgsOption*>(arg));
+ std::string param = get_param(arg);
+ try
+ {
+ arg->set_argument(destringify<int>(param));
+ }
+ catch(DestringifyError &e)
+ {
+ throw BadValue("--" + arg->long_name(), param);
+ }
+}
+
+void ArgsVisitor::visit(EnumArg * const arg)
+{
+ visit(static_cast<ArgsOption*>(arg));
+ arg->set_argument(get_param(arg));
+}
+
+void ArgsVisitor::visit(StringSetArg * const arg)
+{
+ visit(static_cast<ArgsOption *>(arg));
+ std::string param = get_param(arg);
+ arg->add_argument(param);
+}
diff --git a/0.4.0/paludis/args/args_visitor.hh b/0.4.0/paludis/args/args_visitor.hh
new file mode 100644
index 000000000..17a9eacba
--- /dev/null
+++ b/0.4.0/paludis/args/args_visitor.hh
@@ -0,0 +1,96 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ * Copyright (c) 2006 Stephen Bennett <spb@gentoo.org>
+ *
+ * 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_ARGS_ARGS_VISITOR_HH
+#define PALUDIS_GUARD_ARGS_ARGS_VISITOR_HH 1
+
+#include <list>
+#include <paludis/util/visitor.hh>
+#include <string>
+
+/** \file
+ * Declaration for ArgsVisitor
+ *
+ * \ingroup grplibpaludisargs
+ */
+
+namespace paludis
+{
+ namespace args
+ {
+ class ArgsOption;
+ class StringArg;
+ class AliasArg;
+ class SwitchArg;
+ class IntegerArg;
+ class EnumArg;
+ class StringSetArg;
+
+ /**
+ * Visitor types for visitors that can visit Args.
+ *
+ * \ingroup grplibpaludisargs
+ */
+ typedef VisitorTypes<ArgsOption *, StringArg *, AliasArg *, SwitchArg *,
+ IntegerArg *, EnumArg *, StringSetArg *> ArgsVisitorTypes;
+
+ /**
+ * Visitor class. Processes command-line options as they are found.
+ *
+ * \ingroup grplibpaludisargs
+ */
+ class ArgsVisitor : public ArgsVisitorTypes::Visitor
+ {
+ private:
+ std::list<std::string>::iterator *_args_index, _args_end;
+
+ const std::string& get_param(const ArgsOption * const);
+
+ public:
+ /**
+ * Constructor
+ */
+ ArgsVisitor(std::list<std::string>::iterator *, std::list<std::string>::iterator);
+
+ /// Visit an ArgsOption.
+ void visit(ArgsOption * const);
+
+ /// Visit a StringArg.
+ void visit(StringArg * const);
+
+ /// Visit an AliasArg.
+ void visit(AliasArg * const);
+
+ /// Visit a SwitchArg.
+ void visit(SwitchArg * const);
+
+ /// Visit an IntegerArg.
+ void visit(IntegerArg * const);
+
+ /// Visit an EnumArg.
+ void visit(EnumArg * const);
+
+ /// Visit a StringSetArg.
+ void visit(StringSetArg * const);
+ };
+ }
+}
+
+#endif
diff --git a/0.4.0/paludis/args/bad_argument.cc b/0.4.0/paludis/args/bad_argument.cc
new file mode 100644
index 000000000..af5554c20
--- /dev/null
+++ b/0.4.0/paludis/args/bad_argument.cc
@@ -0,0 +1,35 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * 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 prog