Creating all necessary paths from the config file

Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
Dimitris Zlatanidis 2022-10-28 09:12:37 +03:00
parent 75cca386b7
commit 2437a3fe0b
3 changed files with 18 additions and 5 deletions

View file

@ -1,3 +1,7 @@
4.2.3 - 28/10/2022
Updated:
- Creating all necessary paths from config file
4.2.2 - 20/10/2022
Updated:
- Removed version for skip installed option

View file

@ -97,7 +97,7 @@ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | gr
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
# Install configuration files and creating lib directory
mkdir -p $PKG/etc/$PRGNAM $PKG/var/lib/$PRGNAM/database $PKG/var/lib/$PRGNAM/repository
mkdir -p $PKG/etc/$PRGNAM
install -D -m0644 configs/slpkg.yml $PKG/etc/slpkg/slpkg.yml.new
install -D -m0645 configs/blacklist.yml $PKG/etc/slpkg/blacklist.yml.new

View file

@ -49,10 +49,6 @@ class Configs:
# Wget options
wget_options = '-c -N'
# Creating the build path
if not os.path.isdir(build_path):
os.makedirs(build_path)
''' Overwrite with user configuration. '''
config_file: str = f'{etc_path}/{prog_name}.yml'
if os.path.isfile(config_file):
@ -95,6 +91,19 @@ class Configs:
except KeyError:
pass
# Creating the paths if they doesn't exists
paths = [tmp_path,
build_path,
download_only,
sbo_repo_path,
lib_path,
etc_path,
db_path]
for path in paths:
if not os.path.isdir(path):
os.makedirs(path)
@classmethod
def colour(cls):
color = {