-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from bedroge/gentoo_git
Use git instead of rsync for the Gentoo overlay
- Loading branch information
Showing
9 changed files
with
180 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
ansible/playbooks/roles/compatibility_layer/files/sync_gentoo_cache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
repository_name="${1}" | ||
repository_path="${3}" | ||
|
||
[[ ${repository_name} == "gentoo" ]] || exit 0 | ||
|
||
source $(portageq envvar EPREFIX)/lib/gentoo/functions.sh | ||
|
||
# Number of jobs for egencache, default is number or processors. | ||
parallel_jobs="$(nproc)" | ||
|
||
if [[ -f ${repository_path}/metadata/timestamp.x ]]; then | ||
portage_current_timestamp=$(cut -f 1 -d " " "${repository_path}/metadata/timestamp.x" ) | ||
else | ||
portage_current_timestamp=0 | ||
fi | ||
|
||
ebegin "Fetching metadata timestamp for ${repository_name}" | ||
rsync -aq rsync://rsync.gentoo.org/gentoo-portage/metadata/timestamp.x "${repository_path}"/metadata/timestamp.x | ||
eend $? | ||
portage_new_timestamp=$(cut -f 1 -d " " "${repository_path}/metadata/timestamp.x" ) | ||
|
||
if [[ ${portage_current_timestamp} -lt ${portage_new_timestamp} ]]; then | ||
ebegin "Fetching pre-generated metadata cache for ${repository_name}" | ||
rsync -aq rsync://rsync.gentoo.org/gentoo-portage/metadata/md5-cache/ "${repository_path}"/metadata/md5-cache/ | ||
eend $? | ||
else | ||
einfo "Metadata cache for ${repository_name} already recent, no need to fetch it :-)" | ||
fi | ||
|
||
ebegin "Updating metadata cache for ${repository_name}" | ||
egencache --jobs="${parallel_jobs}" --repo="${repository_name}" --update --update-use-local-desc | ||
eend $? |
17 changes: 17 additions & 0 deletions
17
ansible/playbooks/roles/compatibility_layer/files/sync_gentoo_dtd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
repository_name="${1}" | ||
repository_path="${3}" | ||
|
||
[[ ${repository_name} == "gentoo" ]] || exit 0 | ||
|
||
source $(portageq envvar EPREFIX)/lib/gentoo/functions.sh | ||
|
||
DTDDIR="${repository_path}"/metadata/dtd | ||
ebegin "Updating DTDs" | ||
if [[ -e ${DTDDIR} ]]; then | ||
git -C "${DTDDIR}" pull -q --ff-only | ||
else | ||
git clone -q https://anongit.gentoo.org/git/data/dtd.git "${DTDDIR}" | ||
fi | ||
eend "$?" |
17 changes: 17 additions & 0 deletions
17
ansible/playbooks/roles/compatibility_layer/files/sync_gentoo_glsa
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
repository_name="${1}" | ||
repository_path="${3}" | ||
|
||
[[ ${repository_name} == "gentoo" ]] || exit 0 | ||
|
||
source $(portageq envvar EPREFIX)/lib/gentoo/functions.sh | ||
|
||
GLSADIR="${repository_path}"/metadata/glsa | ||
ebegin "Updating GLSAs" | ||
if [[ -e ${GLSADIR} ]]; then | ||
git -C "${GLSADIR}" pull -q --ff-only | ||
else | ||
git clone -q https://anongit.gentoo.org/git/data/glsa.git "${GLSADIR}" | ||
fi | ||
eend "$?" |
17 changes: 17 additions & 0 deletions
17
ansible/playbooks/roles/compatibility_layer/files/sync_gentoo_news
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
repository_name="${1}" | ||
repository_path="${3}" | ||
|
||
[[ ${repository_name} == "gentoo" ]] || exit 0 | ||
|
||
source $(portageq envvar EPREFIX)/lib/gentoo/functions.sh | ||
|
||
NEWSDIR="${repository_path}"/metadata/news | ||
ebegin "Updating news items" | ||
if [[ -e ${NEWSDIR} ]]; then | ||
git -C "${NEWSDIR}" pull -q --ff-only | ||
else | ||
git clone -q https://anongit.gentoo.org/git/data/gentoo-news.git "${NEWSDIR}" | ||
fi | ||
eend $? "Try to remove ${NEWSDIR}" |
12 changes: 12 additions & 0 deletions
12
ansible/playbooks/roles/compatibility_layer/files/sync_gentoo_projects_xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
repository_name="${1}" | ||
repository_path="${3}" | ||
|
||
[[ ${repository_name} == "gentoo" ]] || exit 0 | ||
|
||
source $(portageq envvar EPREFIX)/lib/gentoo/functions.sh | ||
|
||
ebegin "Updating projects.xml" | ||
wget -q -P "${repository_path}"/metadata/ -N https://api.gentoo.org/metastructure/projects.xml | ||
eend $? |
14 changes: 14 additions & 0 deletions
14
ansible/playbooks/roles/compatibility_layer/files/sync_overlay_cache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
repository_name="${1}" | ||
|
||
[[ ${repository_name} == "gentoo" ]] && exit 0 | ||
|
||
source $(portageq envvar EPREFIX)/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 $? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters