libropkg: implement package manager system directory initialisation

This commit is contained in:
2025-07-21 22:46:20 +01:00
parent 49d313400c
commit b11682d55d
4 changed files with 247 additions and 0 deletions

30
libropkg/instance.h Normal file
View File

@@ -0,0 +1,30 @@
#ifndef _ROPKG_INSTANCE_H_
#define _ROPKG_INSTANCE_H_
#include <blue/io/directory.h>
#define ROPKG_INSTANCE_DIRPATH_CONFIG "etc/ropkg"
#define ROPKG_INSTANCE_DIRPATH_CACHE "var/cache/ropkg"
#define ROPKG_INSTANCE_DIRPATH_DATABASE "var/lib/ropkg"
#define ROPKG_INSTANCE_DIRPATH_CONFIG_COLLECTION \
ROPKG_INSTANCE_DIRPATH_CONFIG "/config"
#define ROPKG_INSTANCE_DIRPATH_SOURCES ROPKG_INSTANCE_DIRPATH_CONFIG "/sources"
#define ROPKG_INSTANCE_DIRPATH_AVAILABLE \
ROPKG_INSTANCE_DIRPATH_DATABASE "/available.d"
#define ROPKG_INSTANCE_DIRPATH_ARCHIVES ROPKG_INSTANCE_DIRPATH_CACHE "/archives"
#define ROPKG_INSTANCE_FILEPATH_INSTALLED \
ROPKG_INSTANCE_DIRPATH_DATABASE "/installed"
#define ROPKG_INSTANCE_FILEPATH_AVAILABLE \
ROPKG_INSTANCE_DIRPATH_DATABASE "/available"
struct ropkg_instance {
b_directory *inst_root;
b_directory *inst_dir_config;
b_directory *inst_dir_cache;
b_directory *inst_dir_database;
};
#endif