aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2007-09-03 21:09:07 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2007-09-03 21:09:07 +0000
commite1322032cdba491c9d0a06c7aaa4037496a1f7b3 (patch)
treef0513a7dacffdedb3fcc47868324400b15370c4f
parentddbda2276f9b38ea50387a9f843438ae7bae8cce (diff)
downloadpaludis-e1322032cdba491c9d0a06c7aaa4037496a1f7b3.tar.gz
paludis-e1322032cdba491c9d0a06c7aaa4037496a1f7b3.tar.xz
Move default rsync excludes out of the syncers, and hide old-style digest files. Fixes: ticket:358
-rw-r--r--paludis/repositories/e/Makefile.am4
-rw-r--r--paludis/repositories/e/e_repository.cc2
-rw-r--r--paludis/repositories/e/layout.cc6
-rw-r--r--paludis/repositories/e/layout.hh2
-rw-r--r--paludis/repositories/e/traditional.exclude4
-rw-r--r--paludis/repositories/e/traditional_layout.cc6
-rw-r--r--paludis/repositories/e/traditional_layout.hh2
-rw-r--r--paludis/syncer.cc3
-rw-r--r--paludis/syncer.sr1
-rw-r--r--paludis/syncers/dorsync.in4
-rw-r--r--paludis/syncers/dotar.in14
11 files changed, 37 insertions, 11 deletions
diff --git a/paludis/repositories/e/Makefile.am b/paludis/repositories/e/Makefile.am
index 704ba3e..f69ec80 100644
--- a/paludis/repositories/e/Makefile.am
+++ b/paludis/repositories/e/Makefile.am
@@ -478,6 +478,10 @@ xml_things_TEST_LDADD = \
endif
+paludis_datadir = $(datadir)/paludis
+
+paludis_data_DATA = traditional.exclude
+
TESTS = \
dep_lexer_TEST \
dep_parser_TEST \
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index 22b356d..9caf05d 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -597,7 +597,7 @@ ERepository::do_sync() const
.environment(_imp->params.environment)
.local(stringify(_imp->params.location))
.remote(*s));
- SyncOptions opts(_imp->params.sync_options);
+ SyncOptions opts(_imp->params.sync_options, _imp->layout->sync_filter_file());
try
{
syncer.sync(opts);
diff --git a/paludis/repositories/e/layout.cc b/paludis/repositories/e/layout.cc
index d98c64e..ddf6187 100644
--- a/paludis/repositories/e/layout.cc
+++ b/paludis/repositories/e/layout.cc
@@ -54,6 +54,12 @@ Layout::master_repository_location() const
return _master_repository_location;
}
+FSEntry
+Layout::sync_filter_file() const
+{
+ return FSEntry("/dev/null");
+}
+
namespace
{
template <typename T_>
diff --git a/paludis/repositories/e/layout.hh b/paludis/repositories/e/layout.hh
index 42bd400..5b586b5 100644
--- a/paludis/repositories/e/layout.hh
+++ b/paludis/repositories/e/layout.hh
@@ -135,6 +135,8 @@ namespace paludis
virtual tr1::shared_ptr<Map<FSEntry, std::string> > manifest_files(const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ virtual FSEntry sync_filter_file() const;
+
virtual void invalidate_masks() = 0;
///\}
diff --git a/paludis/repositories/e/traditional.exclude b/paludis/repositories/e/traditional.exclude
new file mode 100644
index 0000000..614a7a5
--- /dev/null
+++ b/paludis/repositories/e/traditional.exclude
@@ -0,0 +1,4 @@
+exclude /distfiles
+exclude /packages
+exclude /local
+hide **/files/digest-*
diff --git a/paludis/repositories/e/traditional_layout.cc b/paludis/repositories/e/traditional_layout.cc
index 68e126d..9a56633 100644
--- a/paludis/repositories/e/traditional_layout.cc
+++ b/paludis/repositories/e/traditional_layout.cc
@@ -539,6 +539,12 @@ TraditionalLayout::manifest_files(const QualifiedPackageName & qpn) const
return result;
}
+FSEntry
+TraditionalLayout::sync_filter_file() const
+{
+ return FSEntry(DATADIR "/paludis/traditional.exclude");
+}
+
void
TraditionalLayout::invalidate_masks()
{
diff --git a/paludis/repositories/e/traditional_layout.hh b/paludis/repositories/e/traditional_layout.hh
index d7433bb..81c7735 100644
--- a/paludis/repositories/e/traditional_layout.hh
+++ b/paludis/repositories/e/traditional_layout.hh
@@ -116,6 +116,8 @@ namespace paludis
virtual tr1::shared_ptr<Map<FSEntry, std::string> > manifest_files(const QualifiedPackageName &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual FSEntry sync_filter_file() const;
+
virtual void invalidate_masks();
};
}
diff --git a/paludis/syncer.cc b/paludis/syncer.cc
index 66ca515..9fd3797 100644
--- a/paludis/syncer.cc
+++ b/paludis/syncer.cc
@@ -102,7 +102,8 @@ DefaultSyncer::sync(const SyncOptions & opts) const
.with_setenv("PALUDIS_BASHRC_FILES", join(bashrc_files->begin(), bashrc_files->end(), " "))
.with_setenv("PALUDIS_FETCHERS_DIRS", join(fetchers_dirs->begin(), fetchers_dirs->end(), " "))
.with_setenv("PALUDIS_SYNCERS_DIRS", join(syncers_dirs->begin(), syncers_dirs->end(), " "))
- .with_setenv("PALUDIS_EBUILD_DIR", getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis")));
+ .with_setenv("PALUDIS_EBUILD_DIR", getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis"))
+ .with_setenv("PALUDIS_SYNC_FILTER_FILE", stringify(opts.filter_file)));
if (run_command(cmd))
throw SyncFailedError(_local, _remote);
diff --git a/paludis/syncer.sr b/paludis/syncer.sr
index 4467072..ff35689 100644
--- a/paludis/syncer.sr
+++ b/paludis/syncer.sr
@@ -6,6 +6,7 @@ make_class_SyncOptions()
visible
key options std::string
+ key filter_file FSEntry
doxygen_comment << "END"
/**
diff --git a/paludis/syncers/dorsync.in b/paludis/syncers/dorsync.in
index 5ac2fd7..c5ecee9 100644
--- a/paludis/syncers/dorsync.in
+++ b/paludis/syncers/dorsync.in
@@ -72,7 +72,7 @@ fi
REMOTE="${REMOTE#file://}"
${RSYNC_WRAPPER} rsync --recursive --links --safe-links --perms --times \
- --compress --force --whole-file --delete --delete-after --stats \
- --timeout=180 --exclude=/distfiles --exclude=/packages --exclude=/local \
+ --compress --force --whole-file --delete --delete-after --stats --timeout=180 \
+ ${PALUDIS_SYNC_FILTER_FILE:+--filter "merge ${PALUDIS_SYNC_FILTER_FILE}"} \
--exclude=/.cache --progress "${RSYNC_OPTIONS[@]}" "${REMOTE%/}/" "${LOCAL}/"
diff --git a/paludis/syncers/dotar.in b/paludis/syncers/dotar.in
index 4f8317e..40ec8ea 100644
--- a/paludis/syncers/dotar.in
+++ b/paludis/syncers/dotar.in
@@ -13,14 +13,14 @@ LOCAL=
REMOTE=
FETCHER_OPTIONS=( )
-DOUNPACK_OPTIONS=( )
+UNPACK_OPTIONS=( )
RSYNC_OPTIONS=( )
while [[ $# -gt 0 ]]; do
case "${1}" in
--strip-components=*)
- DOUNPACK_OPTIONS[${#DOUNPACK_OPTIONS[@]}]=--tar-option="${1}"
+ UNPACK_OPTIONS[${#UNPACK_OPTIONS[@]}]=--tar-option="${1}"
;;
--exclude-from=*)
@@ -33,7 +33,7 @@ while [[ $# -gt 0 ]]; do
;;
--tar-option=*)
- DOUNPACK_OPTIONS[${#DOUNPACK_OPTIONS[@]}]="${1}"
+ UNPACK_OPTIONS[${#UNPACK_OPTIONS[@]}]="${1}"
;;
--rsync-option=*)
@@ -129,8 +129,8 @@ TARFILE="${URL##*/}"
UNPACKDIR="${TEMP}/repository"
mkdir "${UNPACKDIR}"
-( cd "${UNPACKDIR}" && "${PALUDIS_EBUILD_DIR}/utils/dounpack" \
- "${DOUNPACK_OPTIONS[@]}" "${TEMP}/${TARFILE}" ) || exit $?
+( cd "${UNPACKDIR}" && "${PALUDIS_EBUILD_DIR}/utils/unpack" \
+ "${UNPACK_OPTIONS[@]}" "${TEMP}/${TARFILE}" ) || exit $?
rm "${TEMP}/${TARFILE}"
@@ -142,8 +142,8 @@ fi
[[ -d "${LOCAL}" ]] || mkdir -p "${LOCAL}"
${RSYNC_WRAPPER} rsync --recursive --links --safe-links --perms --times \
- --compress --force --whole-file --delete --delete-after --stats \
- --timeout=180 --exclude=/distfiles --exclude=/packages --exclude=/local \
+ --compress --force --whole-file --delete --delete-after --stats --timeout=180 \
+ ${PALUDIS_SYNC_FILTER_FILE:+--filter "merge ${PALUDIS_SYNC_FILTER_FILE}"} \
--exclude=/.cache --progress "${RSYNC_OPTIONS[@]}" "${UNPACKDIR}/" "${LOCAL}/" || exit $?
rm -rf "${TEMP}"