Commit c02e0ff6 authored by aTc's avatar aTc
Browse files

Merge branch 'master' of https://github.com/slaeshjag/dbp into upstream

parents 76c86373 f3591d83
......@@ -10,5 +10,5 @@
*.orig
*.local
*.remote
version.mk
build/
install/
......@@ -8,7 +8,6 @@ include config.mk
.PHONY: all install clean
all:
@./update_version
@echo " [INIT] build/"
@$(MKDIR) build/
@echo " [INIT] build/bin"
......@@ -21,8 +20,10 @@ all:
@echo " [INIT] build/include/dbpmgr"
@$(MKDIR) build/include
@$(MKDIR) build/include/dbpmgr
@echo " [ CD ] dbp-common/"
+@make -C dbp-common/
@echo " [INIT] build/include/dbpbase"
@$(MKDIR) build/include/dbpbase
@echo " [ CD ] libdbpbase/"
+@make -C libdbpbase/
@echo " [ CD ] libdbpmgr/"
+@make -C libdbpmgr/
@echo " [ CD ] dbpd/"
......@@ -51,8 +52,8 @@ all:
clean:
@echo " [ RM ] build/"
+@$(RM) build/
@echo " [ CD ] dbp-common/"
+@make -C dbp-common/ clean
@echo " [ CD ] libdbpbase/"
+@make -C libdbpbase/ clean
@echo " [ CD ] libdbpmgr/"
+@make -C libdbpmgr/ clean
@echo " [ CD ] dbpd/"
......@@ -73,3 +74,36 @@ clean:
@echo "Source tree cleaned."
@echo
install:
install -d "$(PREFIX)/etc/dbp"
install -m 644 -t "$(PREFIX)/etc/dbp" "$(TOPDIR)/conf/dbp_config.ini"
install -m 644 -t "$(PREFIX)/etc/dbp" "$(TOPDIR)/conf/dbpd-introspection.xml"
install -m 644 -t "$(PREFIX)/etc/dbp" "$(TOPDIR)/scripts/dbp_exec"
install -m 755 -t "$(PREFIX)/etc/dbp" "$(TOPDIR)/scripts/run_script"
install -d "$(PREFIX)/lib/systemd/system/"
install -m 644 -t "$(PREFIX)/lib/systemd/system" "$(TOPDIR)/conf/dbpd.service"
install -d "$(PREFIX)/etc/dbus-1/system.d"
install -m 644 -t "$(PREFIX)/etc/dbus-1/system.d" "$(TOPDIR)/conf/de.dragonbox.PackageDaemon.conf"
install -d "$(PREFIX)/etc/xdg/autostart"
install -m 644 -t "$(PREFIX)/etc/xdg/autostart" "$(TOPDIR)/conf/dbp-desktopd-autostart.desktop"
install -d "$(PREFIX)/usr/share/binfmts/"
install -m 644 -t "$(PREFIX)/usr/share/binfmts" "$(TOPDIR)/conf/binfmts/dbp.binfmt"
install -d "$(PREFIX)/usr/share/applications"
install -m 644 -t "$(PREFIX)/usr/share/applications" "$(TOPDIR)/conf/dbp-run-path.desktop"
install -d "$(PREFIX)/usr/share/mime"
install -m 644 -t "$(PREFIX)/usr/share/mime" "$(TOPDIR)/conf/mime/x-dbp.xml"
install -d "$(PREFIX)/usr/bin"
install -m 755 $(STRIP_FLAG) -t "$(PREFIX)/usr/bin/" "$(TOPDIR)/build/bin/dbp-cfg"
install -m 755 $(STRIP_FLAG) -t "$(PREFIX)/usr/bin/" "$(TOPDIR)/build/bin/dbp-cmd"
install -m 755 $(STRIP_FLAG) -t "$(PREFIX)/usr/bin/" "$(TOPDIR)/build/bin/dbpd"
install -m 755 $(STRIP_FLAG) -t "$(PREFIX)/usr/bin/" "$(TOPDIR)/build/bin/dbp-desktopd"
install -m 755 $(STRIP_FLAG) -t "$(PREFIX)/usr/bin/" "$(TOPDIR)/build/bin/dbp-meta"
install -m 755 $(STRIP_FLAG) -t "$(PREFIX)/usr/bin/" "$(TOPDIR)/build/bin/dbp-run"
install -m 755 $(STRIP_FLAG) -t "$(PREFIX)/usr/bin/" "$(TOPDIR)/build/bin/dbp-run-path"
install -d "$(PREFIX)/usr/lib"
install -m 644 $(STRIP_FLAG) -t "$(PREFIX)/usr/lib/" "$(TOPDIR)/build/lib/libdbpmgr.so"
install -m 644 $(STRIP_FLAG) -t "$(PREFIX)/usr/lib/" "$(TOPDIR)/build/lib/libdbpbase.so"
install -d "$(PREFIX)/usr/include/dbpmgr"
install -m 644 -t "$(PREFIX)/usr/include/dbpmgr" $(TOPDIR)/build/include/dbpmgr/*.h
install -d "$(PREFIX)/usr/include/dbpbase"
install -m 644 -t "$(PREFIX)/usr/include/dbpbase" $(TOPDIR)/build/include/dbpbase/*.h
== Legend ==
+ Feature added
- Feature removed
* Bug fixed
[0.6.11] 2015-11-05
+ New dependency checking system
% Dependencies are now in 5 different categories
+ dbp-common has been moved into a shared library
% Makes it easier to re-use it in other applications
[0.6.10] First numbered release - 2015-10-31
* Fixed bug causing dbp-desktopd creating "unsafe" launchers
* Minor memory leaks in the dbpd DBus code has been fixed
+ Delayed umount of packages implemented in dbpd
% Leaved a mounted package around for a bit in case it is
% launched again.
+ Basic check of package architecture
% Package architecture is checked against supported ones listed
% in dbp_config.ini, dbp-run throws an error if it's unsupported.
+ dbpd now supports override files
% It is now possible to inject and/or override .desktop launchers
% in a package by placing special files in its appdata directory
+ Missing dependency dialog cares about input
% An aborted package launch is actually aborted now
% Installing of deps is still unsupported and throws an error
......@@ -37,9 +37,7 @@ state_file=/var/lib/dbp/dbp.state
;; run_script without index is used when a dbp is lacking the Arch key, or if it's set to "any".
run_script=/etc/dbp/run_script
run_script[armhf]=/etc/dbp/run_script
native_arch=armhf
;; Secondary and emulated arch is a semi-colon separated list
secondary_arch=armel
emulated_arch=i386
;; List of supported architectures, in order of preference
supported_archs=armhf;armel;i386
;; Be more verbose about package events. Might fill your FS with logs
verbose_debug_output=no
......@@ -37,7 +37,7 @@
<arg type='i' name='dummy' direction='out' />
</method>
<method name='PackageList'>
<arg type='a(sss)' name='entry' direction='out' />
<arg type='a(ssss)' name='entry' direction='out' />
</method>
<signal name='NewMeta'>
<arg type='s' name='pkg_id' />
......
......@@ -5,11 +5,11 @@
NAME = dbp
#Uncomment to build dbp-run without dpkg dependency checking
#BUILD_DPKG = NO
DAEMONBIN = "$(TOPDIR)/build/bin/$(NAME)d"
LIBBINFILE = "lib$(NAME)mgr.so"
LIBBIN = "$(TOPDIR)/build/lib/$(LIBBINFILE)"
LIBBASEFILE = "lib$(NAME)base.so"
LIBBASE = "$(TOPDIR)/build/lib/$(LIBBASEFILE)"
RUNNERBIN = "$(TOPDIR)/build/bin/$(NAME)-run-old"
CONFIGBIN = "$(TOPDIR)/build/bin/$(NAME)-cfg"
METABIN = "$(TOPDIR)/build/bin/$(NAME)-meta"
......@@ -17,18 +17,18 @@ CMDBIN = "$(TOPDIR)/build/bin/$(NAME)-cmd"
DESKTOPBIN = "$(TOPDIR)/build/bin/$(NAME)-desktopd"
THUMBBIN = "$(TOPDIR)/build/bin/$(NAME)-thumbnailer"
LIB = "$(TOPDIR)/dbp-common/dbp-common.a"
LIBINC = "-I$(TOPDIR)/dbp-common" "-I$(TOPDIR)/build/include"
PREFIX += /usr/local
LIBINC = "-I$(TOPDIR)/libdbpbase" "-I$(TOPDIR)/build/include"
LDPATH += "-L$(TOPDIR)/build/lib"
#DBGFLAGS = -O0 -g -D__DEBUG__
DBGFLAGS = -O3 -g
DBGFLAGS = -O0 -g -D__DEBUG__
#DBGFLAGS = -O3 -g
CFLAGS += -Wall -Wextra -D_XOPEN_SOURCE=700 -std=c99 $(INCS) $(DBGFLAGS)
LDFLAGS += $(LIB) -larchive -lpthread
LDFLAGS += -larchive -lpthread
RM = rm -fR
MKDIR = mkdir -p
CP = cp
MV = mv
PREFIX ?= /
ifneq ($(wildcard /etc/debian_version),)
#Debian packaging
......@@ -39,3 +39,6 @@ ifneq ($(wildcard /etc/debian_version),)
DEPS = libc6, libarchive13
endif
ifeq ($(STRIP_INSTALL), true)
STRIP_FLAG = -s
endif
......@@ -3,11 +3,12 @@ include $(TOPDIR)/config.mk
SRCFILES = $(wildcard *.c)
OBJFILES = $(SRCFILES:.c=.o)
LDFLAGS += -ldbpbase
.PHONY: all clean
all: $(OBJFILES) $(DEPENDS)
@echo " [ LD ] $(CONFIGBIN)"
@$(CC) -o $(CONFIGBIN) $(OBJFILES) $(LIB) $(LDFLAGS)
@$(CC) -o $(CONFIGBIN) $(OBJFILES) $(LDPATH) $(LDFLAGS)
@echo "Done."
@echo
......
#include "config.h"
#include "desktop.h"
#include <dbpbase/dbpbase.h>
#include <stdio.h>
#include <libintl.h>
#include <locale.h>
#define _(STRING) gettext(STRING)
FILE *dbp_error_log;
void usage(char *name) {
fprintf(stderr, _("Extracts configuration keys out of the DBP config\n"));
fprintf(stderr, _("By Steven Arnow, 2015, version %s\n"), config_version_get());
fprintf(stderr, _("By Steven Arnow, 2015, version %s\n"), dbp_config_version_get());
fprintf(stderr, "\n");
fprintf(stderr, _("Usage: %s <config key>\n"), name);
}
int main(int argc, char **argv) {
struct desktop_file_s *df;
struct DBPDesktopFile *df;
const char *value;
dbp_error_log = stderr;
setlocale(LC_ALL, "");
textdomain("dbp-run");
dbp_init(NULL);
if (argc < 2)
return usage(argv[0]), -1;
if (!strcmp(argv[1], "--help"))
return usage(argv[0]), 0;
if (!(df = desktop_parse_file(CONFIG_FILE_PATH))) {
fprintf(stderr, _("Unable to open config file %s\n"), CONFIG_FILE_PATH);
if (!(df = dbp_desktop_parse_file(DBP_CONFIG_FILE_PATH))) {
fprintf(stderr, _("Unable to open config file %s\n"), DBP_CONFIG_FILE_PATH);
return -1;
}
if (!(value = desktop_lookup(df, argv[1], "", "Package Daemon Config"))) {
if (!(value = dbp_desktop_lookup(df, argv[1], "", "Package Daemon Config"))) {
fprintf(stderr, _("Key '%s' doesn't exist in config\n"), argv[1]);
return -1;
}
......
......@@ -7,7 +7,7 @@ OBJFILES = $(SRCFILES:.c=.o)
all: $(OBJFILES) $(DEPENDS)
@echo " [ LD ] $(CMDBIN)"
@$(CC) $(LDPATH) -o $(CMDBIN) $(OBJFILES) $(LIB) $(LDFLAGS) -ldbpmgr
@$(CC) $(LDPATH) -o $(CMDBIN) $(OBJFILES) $(LDFLAGS) -ldbpbase -ldbpmgr
@echo "Done."
@echo
......
#include <dbpbase/dbpbase.h>
#include <dbpmgr/dbpmgr.h>
#include <stdio.h>
......@@ -176,7 +177,8 @@ int main(int argc, char **argv) {
if (argc < 2)
exit(usage());
dbp_init(NULL);
if (dbpmgr_server_connect() < 0)
return 1;
for (i = 0; lookup[i].name; i++)
......
#ifndef __DESKTOP_H__
#define __DESKTOP_H__
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct desktop_file_entry_s {
char *key;
char *locale;
char *value;
};
struct desktop_file_section_s {
char *name;
struct desktop_file_entry_s *entry;
int entries;
};
struct desktop_file_s {
struct desktop_file_section_s *section;
int sections;
};
struct desktop_file_s *desktop_parse(char *str);
struct desktop_file_s *desktop_parse_file(const char *path);
void *desktop_free(struct desktop_file_s *df);
void desktop_write(struct desktop_file_s *df, const char *path);
char *desktop_lookup(struct desktop_file_s *df, const char *key, const char *locale, const char *section);
int desktop_lookup_section(struct desktop_file_s *df, const char *section);
int desktop_lookup_entry(struct desktop_file_s *df, const char *key, const char *locale, int section);
int desktop_entry_new(struct desktop_file_s *df, const char *key, const char *locale, const char *value);
int desktop_section_new(struct desktop_file_s *df, const char *name);
#endif
#ifndef __LOOP_H__
#define __LOOP_H__
int loop_desktop_directory(const char *path);
int loop_mount(const char *image, const char *id, const char *user, const char *src_mount, const char *appdata);
void loop_umount(const char *pkg_id, int loop, const char *user);
int loop_directory_setup(const char *path, int umask);
#endif
......@@ -8,7 +8,7 @@ CFLAGS += -D_GNU_SOURCE
all: $(OBJFILES) $(DEPENDS)
@echo " [ LD ] $(DESKTOPBIN)"
@$(CC) $(LDPATH) -o $(DESKTOPBIN) $(OBJFILES) $(LIB) $(LDFLAGS) -ldbpmgr
@$(CC) $(LDPATH) -o $(DESKTOPBIN) $(OBJFILES) $(LDFLAGS) -ldbpbase -ldbpmgr
@echo "Done."
@echo
......
......@@ -9,13 +9,12 @@
#include <pthread.h>
#include <dbpmgr/dbpmgr.h>
#include "config.h"
#include <dbpbase/dbpbase.h>
#define HAS_SUFFIX(str, suffix) (strlen((suffix)) < strlen((str)) && !strcmp((str) + strlen((str)) - strlen((suffix)), suffix))
#define HAS_PREFIX(str, prefix) (strstr((str), (prefix)) == (str))
static char *desktop_directory = NULL;
FILE *dbp_error_log;
static char *find_desktop() {
char *desktop_dir, *home_dir, *desktop_path;
......@@ -70,6 +69,8 @@ static void copy_file(const char *source, const char *destination, int thread) {
while (fwrite(buff, 1, fread(buff, 1, 8192, in), out) > 0);
if (in) fclose(in); if (out) fclose(out);
// apparently desktop files should be +x //
chmod(dest_path, 0755);
rename(dest_path, destination);
free(temp); free(dest_path);
}
......@@ -107,14 +108,14 @@ static void add_package_meta(char *pkg_id) {
asprintf(&prefix, "__dbp__%s_", pkg_id);
if (!(dir_s = opendir(config_struct.desktop_directory))) {
fprintf(stderr, "Unable to open '%s' for directory list\n", config_struct.desktop_directory);
if (!(dir_s = opendir(dbp_config_struct.desktop_directory))) {
fprintf(stderr, "Unable to open '%s' for directory list\n", dbp_config_struct.desktop_directory);
return free(prefix);
}
for (readdir_r(dir_s, &ent, &result); result; readdir_r(dir_s, &ent, &result)) {
if (HAS_PREFIX(ent.d_name, prefix) && HAS_SUFFIX(ent.d_name, ".desktop")) {
asprintf(&source, "%s/%s", config_struct.desktop_directory, ent.d_name);
asprintf(&source, "%s/%s", dbp_config_struct.desktop_directory, ent.d_name);
add_meta(source, 0);
free(source);
}
......@@ -133,8 +134,7 @@ static void sighndlr(const char *signal, const char *value, void *data) {
int main(int argc, char **argv) {
struct DBPList *list, *next;
(void) argc; (void) argv;
dbp_error_log = stderr;
config_init();
dbp_init(NULL);
if (!(desktop_directory = find_desktop()))
return 1;
nuke_desktop(desktop_directory);
......
......@@ -3,11 +3,12 @@ include $(TOPDIR)/config.mk
SRCFILES = $(wildcard *.c)
OBJFILES = $(SRCFILES:.c=.o)
LDFLAGS += -ldbpbase
.PHONY: all clean
all: $(OBJFILES) $(DEPENDS)
@echo " [ LD ] $(METABIN)"
@$(CC) -o $(METABIN) $(OBJFILES) $(LIB) $(LDFLAGS)
@$(CC) -o $(METABIN) $(OBJFILES) $(LDPATH) $(LDFLAGS)
@echo "Done."
@echo
......
#include <libintl.h>
#include <locale.h>
#include <stdio.h>
#include "meta.h"
#include "config.h"
#include <dbpbase/dbpbase.h>
#define _(STRING) gettext(STRING)
FILE *dbp_error_log;
void usage() {
fprintf(stdout, _("Extracts meta keys from a DBP\n"));
fprintf(stdout, _("By Steven Arnow, 2015, version %s\n"), config_version_get());
fprintf(stdout, _("By Steven Arnow, 2015, version %s\n"), dbp_config_version_get());
fprintf(stdout, "\n");
fprintf(stdout, _("Usage:\n"));
fprintf(stdout, _("dbp-meta list <path-to-dbp> - lists all meta keys for the package\n"));
......@@ -18,19 +15,19 @@ void usage() {
int main(int argc, char **argv) {
struct meta_package_s mp;
struct DBPMetaPackage mp;
const char *str;
setlocale(LC_ALL, "");
textdomain("dbp-run");
dbp_error_log = stderr;
if (argc <3) {
usage();
return 1;
}
if (meta_package_open(argv[2], &mp)) {
dbp_init(NULL);
if (dbp_meta_package_open(argv[2], &mp)) {
fprintf(stderr, _("Unable to open package %s\n"), argv[2]);
return 1;
}
......@@ -38,7 +35,7 @@ int main(int argc, char **argv) {
if (!strcmp(argv[1], "list")) {
int section, i;
section = desktop_lookup_section(mp.df, mp.section);
section = dbp_desktop_lookup_section(mp.df, mp.section);
for (i = 0; i < mp.df->section[section].entries; i++)
fprintf(stdout, "%s[%s]=\"%s\"\n", mp.df->section[section].entry[i].key, mp.df->section[section].entry[i].locale, mp.df->section[section].entry[i].value);
return 0;
......@@ -52,9 +49,9 @@ int main(int argc, char **argv) {
}
if (argc < 5)
str = desktop_lookup(mp.df, argv[3], "", mp.section);
str = dbp_desktop_lookup(mp.df, argv[3], "", mp.section);
else
str = desktop_lookup(mp.df, argv[3], argv[4], mp.section);
str = dbp_desktop_lookup(mp.df, argv[3], argv[4], mp.section);
if (str)
fprintf(stdout, "%s\n", str);
return 0;
......
VALAC = valac
VALAPKG = --pkg=gio-2.0 --target-glib 2.32 --pkg glib-2.0 --pkg=gtk+-3.0 --pkg=posix --pkg=dbp
VALAFLAGS = --vapidir=./common -X -I../dbp-common -X -I../build/include --thread -X -DGETTEXT_PACKAGE=\"dbp-run\" -X -L../build/lib
VALASTATICLIBS = -X ../dbp-common/dbp-common.a
LIBS = -X -larchive -X -ldbpmgr
VALAFLAGS = --vapidir=./common -X -I../libdbpbase -X -I../build/include --thread -X -DGETTEXT_PACKAGE=\"dbp-run\" -X -L../build/lib
LIBS = -X -larchive -X -ldbpmgr -X -ldbpbase
ifeq ($(BUILD_DPKG), NO)
DEPCHECKLIBS =
DEPCHECKSRC = -X -I./dep-check dep-check/*.vala
else
DEPCHECKLIBS = -X -ldpkg
DEPCHECKSRC = -X -I./dep-check dep-check/*.vala
endif
BINPATH = ../build/bin
all:
@echo " [VALA] dbp-run.vala"
@$(VALAC) -o $(BINPATH)/dbp-run $(VALAPKG) $(VALAFLAGS) dbp-run.vala common/*.vala -X common/*.c $(DEPCHECKSRC) $(VALASTATICLIBS) $(LIBS) $(DEPCHECKLIBS)
@$(VALAC) -o $(BINPATH)/dbp-run $(VALAPKG) $(VALAFLAGS) dbp-run.vala common/*.vala $(VALASTATICLIBS) $(LIBS)
@echo " [VALA] dbp-run-path.vala"
@$(VALAC) -o $(BINPATH)/dbp-run-path $(VALAPKG) $(VALAFLAGS) dbp-run-path.vala common/*.vala -X common/*.c $(DEPCHECKSRC) $(VALASTATICLIBS) $(LIBS) $(DEPCHECKLIBS)
@#echo " [VALA] dbp-desktopd.vala"
@#$(VALAC) -o $(BINPATH)/dbp-desktopd $(VALAPKG) $(VALAFLAGS) dbp-desktopd.vala common/*.c $(VALASTATICLIBS) $(LIBS)
@$(VALAC) -o $(BINPATH)/dbp-run-path $(VALAPKG) $(VALAFLAGS) dbp-run-path.vala common/*.vala $(VALASTATICLIBS) $(LIBS)
@echo "Done."
@$(VALAC) -o $(BINPATH)/dbp-apitest $(VALAPKG) $(VALAFLAGS) apitest.vala common/*.c $(VALASTATICLIBS) $(LIBS)
clean:
@echo " Nothing needs to be done to clean dbp-run/"
......@@ -46,7 +46,7 @@ namespace DBP {
[CCode (cheader_filename = "config.h")]
namespace Config {
[CCode (cname = "struct config_s", has_type_id = false)]
[CCode (cname = "struct DBPConfig", has_type_id = false)]
struct Config {
[CCode (array_length_cname = "file_extensions", array_length_type = "int")]
string[] file_extension;
......@@ -74,65 +74,61 @@ namespace DBP {
bool per_user_appdata;
bool per_package_appdata;
bool create_rodata;
[CCode (array_length_cname = "archs", array_length_type = "int")]
string[] arch;
string? run_script;
Desktop df;
}
[CCode (cname = "config_struct")]
[CCode (cname = "dbp_config_struct")]
Config config;
[CCode (cprefix = "CONFIG_")]
[CCode (cprefix = "DBP_CONFIG_")]
public const string FILE_PATH;
[CCode (cname = "config_init")]
[CCode (cname = "dbp_config_init")]
void init();
[CCode (cname = "config_version_get")]
[CCode (cname = "dbp_config_version_get")]
public unowned string version();
}
[CCode (cheader_filename = "desktop.h", cname = "struct desktop_file_s", free_function = "desktop_free")]
[CCode (cheader_filename = "desktop.h", cname = "struct DBPDesktopFile", free_function = "dbp_desktop_free")]
[Compact]
public class Desktop {
[CCode (cname = "desktop_parse")]
[CCode (cname = "dbp_desktop_parse")]
public Desktop(char[] str);
[CCode (cname = "desktop_parse_file")]
[CCode (cname = "dbp_desktop_parse_file")]
public Desktop.from_file(string path);
[CCode (cname = "desktop_write")]
[CCode (cname = "dbp_desktop_write")]
public void write(string path);
[CCode (cname = "desktop_lookup")]
[CCode (cname = "dbp_desktop_lookup")]
public unowned string? lookup(string key, string locale, string section);
[CCode (cname = "desktop_lookup_section")]
[CCode (cname = "dbp_desktop_lookup_section")]
public int lookup_section(string section);
[CCode (cname = "desktop_lookup_entry")]
[CCode (cname = "dbp_desktop_lookup_entry")]
public int lookup_entry(string key, string locale, int section);
}
[CCode (cheader_filename = "loop.h", cprefix = "loop_")]
[CCode (cheader_filename = "loop.h", cprefix = "dbp_loop_")]
namespace Loop {
int mount(string image, string id, string user, string src_mount, string appdata);
void umount(string pkg_id, int loop, string user);
int directory_setup(string path, int umask);
}
[CCode (cheader_filename = "deb_dep_check.h", cprefix = "deb_")]
namespace DebDepCheck {
void do_init();
void do_free();
bool check_package(string pkgname, string package_arch);
}
[CCode (cheader_filename = "meta.h")]
namespace Meta {
[CCode (cname = "struct meta_package_s", has_type_id = false, destroy_function = "", default_value = "{}")]
[CCode (cname = "struct DBPMetaPackage", has_type_id = false, destroy_function = "", default_value = "{}")]
public struct Package {
[CCode (cname = "df")]
Desktop desktop_file;
string section;
}
[CCode (cname = "meta_package_open")]
[CCode (cname = "dbp_meta_package_open")]
int package_open(string path, out Package mp);
}
......@@ -146,6 +142,25 @@ namespace DBP {
namespace Depend {
[CCode (cname = "dbpmgr_depend_debian_check")]
bool debian_check(string? package_string);
[CCode (cname = "struct DBPDependList", has_type_id = false, destroy_function = "", default_value = "{}")]
public struct ListEntry {
[CCode (array_length_cname = "depends", array_length_type = "int")]
string?[] depend;
}
[CCode (cname = "struct DBPDependListList", free_function = "dbpmgr_depend_delete_list_ptr")]
[Compact]
public class List {
[CCode (cname = "dbpmgr_depend_check")]
public List(DBP.Desktop df);
public ListEntry sysonly;
public ListEntry dbponly;
public ListEntry syspref;
public ListEntry dbppref;
public ListEntry whatevs;
}
}
[CCode (cheader_filename = "dbpmgr/dbpmgr.h", cprefix = "dbpmgr_server_")]
......
#include <stdio.h>
FILE *dbp_error_log;
\ No newline at end of file
......@@ -36,26 +36,33 @@ namespace Run {
}
bool dependency_ok(string pkg_id, DBP.Meta.Package pkg, bool gui_errors) throws IOError {
string[] sysdeps, dbpdeps, sysmissing, dbpmissing;
string sysdep, dbpdep, pkgarch;
string[] sysmissing = {}, dbpmissing = {};
string pkgarch;
DBP.Depend.List deplist = new DBP.Depend.List(pkg.desktop_file);
sysdep = pkg.desktop_file.lookup("SysDependency", "", "Package Entry");
dbpdep = pkg.desktop_file.lookup("PkgDependency", "", "Package Entry");
pkgarch = pkg.desktop_file.lookup("Arch", "", "Package Entry");
if (pkgarch == null || pkgarch == "")
pkgarch = "any";
if (pkgarch != "any") {
bool supported = false;
foreach (string s in DBP.Config.config.arch)