Use our own example script for overlays

This commit is contained in:
hasufell 2015-09-05 19:18:56 +02:00
parent bb72ace040
commit c0616bd6e3
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020
2 changed files with 18 additions and 8 deletions

View File

@ -10,12 +10,8 @@ necessary to set up a gentoo github mirror based sync system:
## Notes ##
Note that typically most repositories other than `gentoo` don't come with a
pregenerated cache. It is a good idea to generate/update their cache every
time they are synced. One way to do this, is by activating the `example` hook
script that portage installs by default in `/etc/portage/postsync.d`:
```
cp -i /etc/portage/repo.postsync.d/example /etc/portage/repo.postsync.d/gen_cache
chmod +x /etc/portage/repo.postsync.d/gen_cache
If you want your overlay metadata caches to be automatically regenerated
as well, do:
```sh
chmod +x /etc/portage/repo.postsync.d/sync_overlay_cache
```

View File

@ -0,0 +1,14 @@
#!/bin/bash
repository_name="${1}"
[[ ${repository_name} == "gentoo" ]] && exit 0
source /lib/gentoo/functions.sh
# Number of jobs for egencache, default is number or processors.
parallel_jobs="$(nproc)"
ebegin "Updating metadata cache for ${repository_name}"
egencache --jobs="${parallel_jobs}" --repo="${repository_name}" --update --update-use-local-desc
eend $?