Skip to content

common: configure_cache_path: Invalid conf generated #25

@NGenetzky

Description

@NGenetzky
  1. by using -e for echo you are actually removing the '\n' which needs to be in the output.
  2. This also adds an absolute path into the project - which is a problem for shared projects.
  3. this also appends to the file again if called again - which might not be a problem, but it is a disadvantage.
→ bash -x echo_badly.sh 
+ CACHE_DIR=/a/b/c
+ DOWNLOAD_CACHE=dl
+ CONF_FILE=foo.conf
+ echo -e '\nPREMIRRORS_prepend = "git://.*/.* file:///a/b/c/dl \ \n' 'ftp://.*/.* file:///a/b/c/dl \ \n' 'http://.*/.* file:///a/b/c/dl \ \n' 'https://.*/.* file:///a/b/c/dl "\n'
+ cat foo.conf

PREMIRRORS_prepend = "git://.*/.* file:///a/b/c/dl \ 
 ftp://.*/.* file:///a/b/c/dl \ 
 http://.*/.* file:///a/b/c/dl \ 
 https://.*/.* file:///a/b/c/dl "

Similar comments here about adding absolute path into the project. These variables are easily configured many other more proper ways, consider using them.

  echo "DL_DIR = \"${CACHE_DIR}/${DOWNLOAD_CACHE}\"" >> ${CONF_FILE}
  echo "SSTATE_DIR = \"${CACHE_DIR}/${SSTATE_CACHE}\"" >> ${CONF_FILE}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions