aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2009-12-27 00:12:45 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2009-12-27 00:12:45 +0000
commite51e426e68607eb823b492fbcd5789684f5ab80f (patch)
tree5c117635e2d8144f397e36c89ab5dbb56a144ae6
parentc168ee42ab22b89a632714ed2632a4134812a5bb (diff)
downloadpaludis-e51e426e68607eb823b492fbcd5789684f5ab80f.tar.gz
paludis-e51e426e68607eb823b492fbcd5789684f5ab80f.tar.xz
Rename the ebuild in the VDB too
-rw-r--r--paludis/repositories/e/vdb_repository.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index 593f1fa..42c317b 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -1452,11 +1452,26 @@ VDBRepository::perform_updates()
}
else
{
+ std::string oldpf(stringify(m->first->name().package()) + "-" + stringify(m->first->version()));
+ std::string newpf(stringify(m->second.package()) + "-" + stringify(m->first->version()));
+
from_dir.rename(to_dir);
+
SafeOFStream pf(to_dir / "PF");
- pf << m->second.package() << "-" << m->first->version() << std::endl;
+ pf << newpf << std::endl;
SafeOFStream category(to_dir / "CATEGORY");
category << m->second.category() << std::endl;
+
+ if (newpf != oldpf)
+ {
+ for (DirIterator it(to_dir, DirIteratorOptions() + dio_inode_sort),
+ it_end; it_end != it; ++it)
+ {
+ std::string::size_type lastdot(it->basename().rfind('.'));
+ if (std::string::npos != lastdot && 0 == it->basename().compare(0, lastdot, oldpf, 0, oldpf.length()))
+ FSEntry(*it).rename(to_dir / (newpf + it->basename().substr(lastdot)));
+ }
+ }
}
}
}