Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant cache_dirs, fix read only cache_dirs issue #58

Closed
wants to merge 2 commits into from

Conversation

bartoszek
Copy link
Contributor

@bartoszek bartoszek commented Mar 3, 2021

Fix #57

  • compartmentalize cache_dirs
    • cache_dirs contains cached directly sourced from $pac_conf file with pacconf CacheDir
    • extra_cache_dirs contains caches form host mirrors and local repositories
    • filter out extra_cache_dirs from cache_dirs preventing using local repository as pacman cache if listed first in pacman.conf
  • instead of inserting caches into each CacheDir= line in $working_dir/etc/pacman.conf on each arch-nspawn call, append new [options] section containing CacheDir=${extra_cache_dirs[*]} to $working_dir/etc/pacman.conf when $working_dir/etc/pacman.conf gets overwritten ( arch-nspawn -C pacman.conf )

Prevent using local repository as pacman cache
bartoszek pushed a commit to bartoszek/devtools that referenced this pull request Mar 9, 2021
* initialize cache_dirs with one of:
 1. value provided in command line -c switch
 2. pacman.conf provided in command line -C switch
 3. container pacman.conf file
* find first writable cache_dir, bind it rw, remove from cache_dirs
* extract host mirrors, find file:// ones, append to cache_dirs
* extract server url, find file:// ones, append to cache_dirs
* concatenate cache_dirs removing duplicates, bind them ro to container
* check if any extra cache_dirs was defined, append to
  container pacman.conf as new [options] section.

Fix #57 archlinux#58 archlinux#59
bartoszek pushed a commit to bartoszek/devtools that referenced this pull request Mar 9, 2021
* initialize cache_dirs with one of:
 1. value provided in command line -c switch
 2. pacman.conf provided in command line -C switch
 3. container pacman.conf file
* find first writable cache_dir, bind it rw, remove from cache_dirs
* extract host mirrors, find file:// ones, append to cache_dirs
* extract server url, find file:// ones, append to cache_dirs
* concatenate cache_dirs removing duplicates, bind them ro to container
* check if any extra cache_dirs was defined, append to
  container pacman.conf as new [options] section.

Fix #57 archlinux#58 archlinux#59
bartoszek pushed a commit to bartoszek/devtools that referenced this pull request Mar 9, 2021
* initialize cache_dirs with one of:
 1. value provided in command line -c switch
 2. pacman.conf provided in command line -C switch
 3. container pacman.conf file
* find first writable cache_dir, bind it rw, remove from cache_dirs
* extract host mirrors, find file:// ones, append to cache_dirs
* extract server url, find file:// ones, append to cache_dirs
* concatenate cache_dirs removing duplicates, bind them ro to container
* check if any extra cache_dirs was defined, append to
  container pacman.conf as new [options] section.

Fix #57 archlinux#58 archlinux#59
bartoszek pushed a commit to bartoszek/devtools that referenced this pull request Mar 9, 2021
* initialize cache_dirs with one of:
 1. value provided in command line -c switch
 2. pacman.conf provided in command line -C switch
 3. container pacman.conf file
* find first writable cache_dir, bind it rw, remove from cache_dirs
* extract host mirrors, find file:// ones, append to cache_dirs
* extract server url, find file:// ones, append to cache_dirs
* concatenate cache_dirs removing duplicates, bind them ro to container
* check if any extra cache_dirs was defined, append to
  container pacman.conf as new [options] section.

Fix #57 archlinux#58 archlinux#59
bartoszek pushed a commit to bartoszek/devtools that referenced this pull request Mar 9, 2021
* initialize cache_dirs with one of:
 1. value provided in command line -c switch
 2. pacman.conf provided in command line -C switch
 3. container pacman.conf file
* find first writable cache_dir, bind it rw, remove from cache_dirs
* extract host mirrors, find file:// ones, append to cache_dirs
* extract server url, find file:// ones, append to cache_dirs
* concatenate cache_dirs removing duplicates, bind them ro to container
* check if any extra cache_dirs was defined, append to
  container pacman.conf as new [options] section.

Fix #57 archlinux#58 archlinux#59
bartoszek pushed a commit to bartoszek/devtools that referenced this pull request May 17, 2021
* initialize cache_dirs with one of:
 1. value provided in command line -c switch
 2. pacman.conf provided in command line -C switch
 3. container pacman.conf file
* find first writable cache_dir, bind it rw, remove from cache_dirs
* extract host mirrors, find file:// ones, append to cache_dirs
* extract server url, find file:// ones, append to cache_dirs
* concatenate cache_dirs removing duplicates, bind them ro to container
* check if any extra cache_dirs was defined, append to
  container pacman.conf as new [options] section.

Fix #57 archlinux#58 archlinux#59
@anthraxx
Copy link
Member

superseded by #60

@anthraxx anthraxx closed this Jul 17, 2021
hexchain pushed a commit to hexchain/devtools that referenced this pull request Sep 8, 2021
* initialize cache_dirs with one of:
 1. value provided in command line -c switch
 2. pacman.conf provided in command line -C switch
 3. container pacman.conf file
* find first writable cache_dir, bind it rw, remove from cache_dirs
* extract host mirrors, find file:// ones, append to cache_dirs
* extract server url, find file:// ones, append to cache_dirs
* concatenate cache_dirs removing duplicates, bind them ro to container
* check if any extra cache_dirs was defined, append to
  container pacman.conf as new [options] section.

Fix #57 archlinux#58 archlinux#59
hexchain pushed a commit to hexchain/devtools that referenced this pull request Sep 8, 2021
* initialize cache_dirs with one of:
 1. value provided in command line -c switch
 2. pacman.conf provided in command line -C switch
 3. container pacman.conf file
* find first writable cache_dir, bind it rw, remove from cache_dirs
* extract host mirrors, find file:// ones, append to cache_dirs
* extract server url, find file:// ones, append to cache_dirs
* concatenate cache_dirs removing duplicates, bind them ro to container
* check if any extra cache_dirs was defined, append to
  container pacman.conf as new [options] section.

Fix #57 archlinux#58 archlinux#59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cache_dirs gets corrupter on consecutive arch-nspawn calls
2 participants