From be8ca3a7b8046480025a6ab0911437a986aac0a0 Mon Sep 17 00:00:00 2001 From: "Andreas K. Huettel (dilfridge)" Date: Sat, 5 Sep 2015 16:19:38 +0200 Subject: [PATCH 1/2] Update README; the metadata cache regeneration is included in the scripts and always starts at last snapshot --- README.md | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/README.md b/README.md index fd9207a..50b686c 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,8 @@ This is not a full portage configuration. It contains only those parts that are necessary to set up a gentoo github mirror based sync system: * Configures Portage to sync via https://github.com/gentoo/gentoo.git URL. -* Updates metadata-cache (the first update might take long, all subsequent ones not). +* Updates metadata-cache. * Updates the dtd directory. * Updates the glsa directory. * Updates `herds.xml` file. * Updates the news directory. - -## 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 -``` From 50d8ab36864f2a76e1ee210de7670b81219e1b2d Mon Sep 17 00:00:00 2001 From: "Andreas K. Huettel (dilfridge)" Date: Sat, 5 Sep 2015 16:22:14 +0200 Subject: [PATCH 2/2] First set repository_name, then check if it's gentoo --- etc/portage/repo.postsync.d/sync_gentoo_cache | 6 +++--- etc/portage/repo.postsync.d/sync_gentoo_dtd | 6 +++--- etc/portage/repo.postsync.d/sync_gentoo_glsa | 6 +++--- etc/portage/repo.postsync.d/sync_gentoo_herds_xml | 6 +++--- etc/portage/repo.postsync.d/sync_gentoo_news | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/etc/portage/repo.postsync.d/sync_gentoo_cache b/etc/portage/repo.postsync.d/sync_gentoo_cache index f7b1fe6..95863bf 100755 --- a/etc/portage/repo.postsync.d/sync_gentoo_cache +++ b/etc/portage/repo.postsync.d/sync_gentoo_cache @@ -1,12 +1,12 @@ #!/bin/bash +repository_name="${1}" +repository_path="${3}" + [[ ${repository_name} == "gentoo" ]] || exit 0 source /lib/gentoo/functions.sh -repository_name="${1}" -repository_path="${3}" - # Number of jobs for egencache, default is number or processors. parallel_jobs="$(nproc)" diff --git a/etc/portage/repo.postsync.d/sync_gentoo_dtd b/etc/portage/repo.postsync.d/sync_gentoo_dtd index d523356..56ad70d 100755 --- a/etc/portage/repo.postsync.d/sync_gentoo_dtd +++ b/etc/portage/repo.postsync.d/sync_gentoo_dtd @@ -1,12 +1,12 @@ #!/bin/bash +repository_name="${1}" +repository_path="${3}" + [[ ${repository_name} == "gentoo" ]] || exit 0 source /lib/gentoo/functions.sh -repository_name="${1}" -repository_path="${3}" - DTDDIR="${repository_path}"/metadata/dtd ebegin "Updating DTDs" if [[ -e ${DTDDIR} ]]; then diff --git a/etc/portage/repo.postsync.d/sync_gentoo_glsa b/etc/portage/repo.postsync.d/sync_gentoo_glsa index 6ce3e11..775ca90 100755 --- a/etc/portage/repo.postsync.d/sync_gentoo_glsa +++ b/etc/portage/repo.postsync.d/sync_gentoo_glsa @@ -1,12 +1,12 @@ #!/bin/bash +repository_name="${1}" +repository_path="${3}" + [[ ${repository_name} == "gentoo" ]] || exit 0 source /lib/gentoo/functions.sh -repository_name="${1}" -repository_path="${3}" - GLSADIR="${repository_path}"/metadata/glsa ebegin "Updating GLSAs" if [[ -e ${GLSADIR} ]]; then diff --git a/etc/portage/repo.postsync.d/sync_gentoo_herds_xml b/etc/portage/repo.postsync.d/sync_gentoo_herds_xml index 2075c35..277ee9f 100755 --- a/etc/portage/repo.postsync.d/sync_gentoo_herds_xml +++ b/etc/portage/repo.postsync.d/sync_gentoo_herds_xml @@ -1,12 +1,12 @@ #!/bin/bash +repository_name="${1}" +repository_path="${3}" + [[ ${repository_name} == "gentoo" ]] || exit 0 source /lib/gentoo/functions.sh -repository_name="${1}" -repository_path="${3}" - ebegin "Updating herds.xml" wget -q -O "${repository_path}"/metadata/herds.xml https://api.gentoo.org/packages/herds.xml eend $? diff --git a/etc/portage/repo.postsync.d/sync_gentoo_news b/etc/portage/repo.postsync.d/sync_gentoo_news index 78f9c41..bf24750 100755 --- a/etc/portage/repo.postsync.d/sync_gentoo_news +++ b/etc/portage/repo.postsync.d/sync_gentoo_news @@ -1,12 +1,12 @@ #!/bin/bash +repository_name="${1}" +repository_path="${3}" + [[ ${repository_name} == "gentoo" ]] || exit 0 source /lib/gentoo/functions.sh -repository_name="${1}" -repository_path="${3}" - NEWSDIR="${repository_path}"/metadata/news ebegin "Updating news items" if [[ -e ${NEWSDIR} ]]; then