aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Danny van Dyk <dvandyk@exherbo.org> 2006-05-19 23:28:27 +0000
committerAvatar Danny van Dyk <dvandyk@exherbo.org> 2006-05-19 23:28:27 +0000
commit9edd44a51ae6ecfc0a1f6f18f1dd78d8092082f0 (patch)
treef966477b6bc4dfa81cc77a19da7a9d4f3994b028
parentd09406a12799996a77501b9e4e34507a06c15055 (diff)
downloadpaludis-9edd44a51ae6ecfc0a1f6f18f1dd78d8092082f0.tar.gz
paludis-9edd44a51ae6ecfc0a1f6f18f1dd78d8092082f0.tar.xz
Turn the location of the security advisory directory into a config item.
-rw-r--r--paludis/portage_repository.cc15
-rw-r--r--paludis/portage_repository.hh2
-rw-r--r--paludis/util/smart_record.hh.m42
3 files changed, 15 insertions, 4 deletions
diff --git a/paludis/portage_repository.cc b/paludis/portage_repository.cc
index b026c01..dfe523b 100644
--- a/paludis/portage_repository.cc
+++ b/paludis/portage_repository.cc
@@ -136,6 +136,9 @@ namespace paludis
/// Sets dir
FSEntry setsdir;
+ /// Security dir
+ FSEntry securitydir;
+
/// News dir
FSEntry newsdir;
@@ -251,6 +254,7 @@ Implementation<PortageRepository>::Implementation(const PortageRepositoryParams
eclassdir(p.get<prpk_eclassdir>()),
distdir(p.get<prpk_distdir>()),
setsdir(p.get<prpk_setsdir>()),
+ securitydir(p.get<prpk_securitydir>()),
newsdir(p.get<prpk_newsdir>()),
sync(p.get<prpk_sync>()),
sync_exclude(p.get<prpk_sync_exclude>()),
@@ -525,6 +529,7 @@ PortageRepository::PortageRepository(const PortageRepositoryParams & p) :
_info.insert(std::make_pair(std::string("cache"), stringify(_imp->cache)));
_info.insert(std::make_pair(std::string("eclassdir"), stringify(_imp->eclassdir)));
_info.insert(std::make_pair(std::string("distdir"), stringify(_imp->distdir)));
+ _info.insert(std::make_pair(std::string("securitydir"), stringify(_imp->securitydir)));
_info.insert(std::make_pair(std::string("setsdir"), stringify(_imp->setsdir)));
_info.insert(std::make_pair(std::string("newsdir"), stringify(_imp->newsdir)));
_info.insert(std::make_pair(std::string("format"), std::string("portage")));
@@ -1176,6 +1181,10 @@ PortageRepository::make_portage_repository(
if (m.end() == m.find("setsdir") || ((setsdir = m.find("setsdir")->second)).empty())
setsdir = location + "/sets";
+ std::string securitydir;
+ if (m.end() == m.find("securitydir") || ((securitydir = m.find("securitydir")->second)).empty())
+ securitydir = location + "/metadata/security";
+
std::string newsdir;
if (m.end() == m.find("newsdir") || ((newsdir = m.find("newsdir")->second)).empty())
newsdir = location + "/metadata/news";
@@ -1204,6 +1213,7 @@ PortageRepository::make_portage_repository(
param<prpk_cache>(cache),
param<prpk_eclassdir>(eclassdir),
param<prpk_distdir>(distdir),
+ param<prpk_securitydir>(securitydir),
param<prpk_setsdir>(setsdir),
param<prpk_newsdir>(newsdir),
param<prpk_sync>(sync),
@@ -1577,12 +1587,11 @@ PortageRepository::do_security_set() const
Context c("When building security package set:");
AllDepAtom::Pointer security_packages(new AllDepAtom);
- FSEntry security = _imp->location / "metadata" / "security";
- if (!security.is_directory())
+ if (!_imp->securitydir.is_directory())
return DepAtom::Pointer(new AllDepAtom);
std::list<FSEntry> advisories;
- std::copy(DirIterator(_imp->location / "metadata" / "security"), DirIterator(),
+ std::copy(DirIterator(_imp->securitydir), DirIterator(),
filter_inserter(std::back_inserter(advisories),
IsFileWithExtension("advisory-", ".conf")));
diff --git a/paludis/portage_repository.hh b/paludis/portage_repository.hh
index 17be931..dcf7074 100644
--- a/paludis/portage_repository.hh
+++ b/paludis/portage_repository.hh
@@ -53,6 +53,7 @@ namespace paludis
prpk_distdir,
prpk_eclassdir,
prpk_setsdir,
+ prpk_securitydir,
prpk_newsdir,
prpk_sync,
prpk_sync_exclude,
@@ -77,6 +78,7 @@ namespace paludis
SmartRecordKey<prpk_distdir, const FSEntry>,
SmartRecordKey<prpk_eclassdir, const FSEntry>,
SmartRecordKey<prpk_setsdir, const FSEntry>,
+ SmartRecordKey<prpk_securitydir, const FSEntry>,
SmartRecordKey<prpk_newsdir, const FSEntry>,
SmartRecordKey<prpk_sync, const std::string>,
SmartRecordKey<prpk_sync_exclude, const std::string>,
diff --git a/paludis/util/smart_record.hh.m4 b/paludis/util/smart_record.hh.m4
index 6dcfbee..0113c44 100644
--- a/paludis/util/smart_record.hh.m4
+++ b/paludis/util/smart_record.hh.m4
@@ -20,7 +20,7 @@ dnl vim: set ft=cpp et sw=4 sts=4 :
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-define(`max_record_size', `12')
+define(`max_record_size', `15')
define(`forloop', `pushdef(`$1', `$2')_forloop(`$1', `$2', `$3', `$4')popdef(`$1')')
define(`_forloop', `$4`'ifelse($1, `$3', , `define(`$1', incr($1))_forloop(`$1', `$2', `$3', `$4')')')
#endif