-
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 branch 'main' into playbook_test_step
- Loading branch information
Showing
14 changed files
with
280 additions
and
41 deletions.
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
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
22 changes: 0 additions & 22 deletions
22
ansible/playbooks/roles/compatibility_layer/tasks/install_packages.yml
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
45 changes: 45 additions & 0 deletions
45
ansible/playbooks/roles/compatibility_layer/tasks/set_glibc_trusted_dirs.yml
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,45 @@ | ||
# Make sure that glibc is always compiled with a user-defined-trusted-dirs option | ||
--- | ||
- name: Find all strings in libc library | ||
command: "strings {{ gentoo_prefix_path }}/usr/lib64/libc.a" | ||
register: libc_strings | ||
when: eessi_host_os == "linux" | ||
|
||
- name: Find user defined trusted dirs in libc strings output | ||
set_fact: match='{{ libc_strings.stdout | regex_search("\n" + item + "/?\n") | default('', True) | string | length>0 }}' | ||
with_items: "{{ prefix_user_defined_trusted_dirs }}" | ||
register: trusted_dirs_in_libc | ||
|
||
- name: (Re)install glibc with the user-defined-trusted-dirs option | ||
portage: | ||
package: sys-libs/glibc | ||
noreplace: no | ||
oneshot: yes | ||
become: no | ||
environment: | ||
EXTRA_EMAKE: "user-defined-trusted-dirs={{ prefix_user_defined_trusted_dirs | join(':') }}" | ||
when: | ||
- eessi_host_os == "linux" | ||
- trusted_dirs_in_libc.results | selectattr('ansible_facts.match', 'equalto', False) | list | length>0 | ||
|
||
- name: Create portage env directory | ||
file: | ||
path: "{{ gentoo_prefix_path }}/etc/portage/env" | ||
state: directory | ||
mode: 0755 | ||
|
||
- name: Add env file for glibc to make sure the user-defined-trusted-dirs is always used | ||
copy: | ||
dest: "{{ gentoo_prefix_path }}/etc/portage/env/glibc-user-defined-trusted-dirs.conf" | ||
mode: 0644 | ||
content: | | ||
EXTRA_EMAKE="user-defined-trusted-dirs={{ prefix_user_defined_trusted_dirs | join(':') }}" | ||
- name: Add glibc env file to package.env | ||
lineinfile: | ||
path: "{{ gentoo_prefix_path }}/etc/portage/package.env" | ||
create: yes | ||
mode: 0644 | ||
line: sys-libs/glibc glibc-user-defined-trusted-dirs.conf | ||
state: present | ||
|
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
Oops, something went wrong.