aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Stephen Klimaszewski <steev@gentoo.org> 2006-04-06 23:45:00 +0000
committerAvatar Stephen Klimaszewski <steev@gentoo.org> 2006-04-06 23:45:00 +0000
commit4b23fc729c38213ba96a6d3555a765fe42646529 (patch)
tree483f6a18deb364b8538565bf106ec95a8575e8c4
parentc6b39a12bb3f755cd6b51fec1d943df3d7fc2571 (diff)
downloadpaludis-4b23fc729c38213ba96a6d3555a765fe42646529.tar.gz
paludis-4b23fc729c38213ba96a6d3555a765fe42646529.tar.xz
Add svn syncing support
-rw-r--r--AUTHORS3
-rw-r--r--paludis/syncer.cc36
2 files changed, 38 insertions, 1 deletions
diff --git a/AUTHORS b/AUTHORS
index 189bd5c..3ba1aa1 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -12,3 +12,6 @@ Mark Loeser <halcy0n@gentoo.org>
John N. Laliberte <allanonjl@gentoo.org>
Contributor to Qualudis
+
+Stephen Klimaszewski <steev@gentoo.org>
+ Contributor
diff --git a/paludis/syncer.cc b/paludis/syncer.cc
index 279eaca..6d9af1e 100644
--- a/paludis/syncer.cc
+++ b/paludis/syncer.cc
@@ -2,6 +2,7 @@
/*
* Copyright (c) 2006 Ciaran McCreesh <ciaranm@gentoo.org>
+ * Copyright (c) 2006 Stephen Klimaszewski <steev@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
@@ -50,7 +51,31 @@ namespace
}
};
- static const SyncerMaker::RegisterMaker register_rsync_syncer("rsync", &RsyncSyncer::make);
+ class SvnSyncer :
+ public Syncer
+ {
+ private:
+ std::string _local;
+ std::string _remote;
+
+ protected:
+ SvnSyncer(const std::string & local, const std::string & remote) :
+ _local(local),
+ _remote(remote)
+ {
+ }
+
+ public:
+ virtual void sync() const;
+ static Syncer::Pointer make(const std::string & local, const std::string & remote)
+ {
+ return Syncer::Pointer(new SvnSyncer(local, remote));
+ }
+ };
+
+ static const SyncerMaker::RegisterMaker register_rsync_syncer("rsync", &RsyncSyncer::make);
+ static const SyncerMaker::RegisterMaker register_svn_syncer("svn", &SvnSyncer::make);
+ static const SyncerMaker::RegisterMaker register_svnplusssh_syncer("svn+ssh", &SvnSyncer::make);
}
void
@@ -65,6 +90,15 @@ RsyncSyncer::sync() const
throw SyncFailedError(_local, _remote);
}
+void
+SvnSyncer::sync() const
+{
+ std::string cmd("svn checkout '" + _remote + "' '" + _local + "/'");
+
+ if (0 != run_command(cmd))
+ throw SyncFailedError(_local, _remote);
+}
+
SyncFailedError::SyncFailedError(const std::string & local, const std::string & remote) throw () :
PackageActionError("sync of '" + local + "' from '" + remote + "' failed")
{