Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dbp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
packages
dbp
Commits
c02e0ff6
Commit
c02e0ff6
authored
Nov 06, 2015
by
aTc
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/slaeshjag/dbp
into upstream
parents
76c86373
f3591d83
Changes
53
Hide whitespace changes
Inline
Side-by-side
Showing
53 changed files
with
853 additions
and
504 deletions
+853
-504
.gitignore
.gitignore
+1
-1
Makefile
Makefile
+39
-5
changelog
changelog
+27
-0
conf/dbp_config.ini
conf/dbp_config.ini
+2
-4
conf/dbpd-introspection.xml
conf/dbpd-introspection.xml
+1
-1
config.mk
config.mk
+10
-7
dbp-cfg/Makefile
dbp-cfg/Makefile
+2
-1
dbp-cfg/main.c
dbp-cfg/main.c
+7
-10
dbp-cmd/Makefile
dbp-cmd/Makefile
+1
-1
dbp-cmd/dbp-cmd.c
dbp-cmd/dbp-cmd.c
+3
-1
dbp-common/desktop.h
dbp-common/desktop.h
+0
-39
dbp-common/loop.h
dbp-common/loop.h
+0
-9
dbp-desktopd/Makefile
dbp-desktopd/Makefile
+1
-1
dbp-desktopd/desktopd.c
dbp-desktopd/desktopd.c
+7
-7
dbp-meta/Makefile
dbp-meta/Makefile
+2
-1
dbp-meta/dbp-meta.c
dbp-meta/dbp-meta.c
+8
-11
dbp-run/Makefile
dbp-run/Makefile
+4
-15
dbp-run/common/dbp.vapi
dbp-run/common/dbp.vapi
+37
-22
dbp-run/common/logging.c
dbp-run/common/logging.c
+0
-3
dbp-run/common/run.vala
dbp-run/common/run.vala
+30
-16
dbp-run/dep-check/deb_dep_check.c
dbp-run/dep-check/deb_dep_check.c
+0
-88
dbp-run/dep-check/deb_dep_check.h
dbp-run/dep-check/deb_dep_check.h
+0
-9
dbp-run/dep-check/deb_dep_check.nodpkg.c
dbp-run/dep-check/deb_dep_check.nodpkg.c
+0
-16
dbp-run/dep-check/dep-check.vala
dbp-run/dep-check/dep-check.vala
+0
-27
dbpd/Makefile
dbpd/Makefile
+2
-2
dbpd/comm.c
dbpd/comm.c
+12
-7
dbpd/daemon.c
dbpd/daemon.c
+16
-19
dbpd/mountwatch.c
dbpd/mountwatch.c
+14
-5
dbpd/package.c
dbpd/package.c
+138
-43
dbpd/package.h
dbpd/package.h
+13
-1
dbpd/state.c
dbpd/state.c
+20
-18
libdbpbase/Makefile
libdbpbase/Makefile
+7
-3
libdbpbase/config.c
libdbpbase/config.c
+21
-21
libdbpbase/config.h
libdbpbase/config.h
+14
-9
libdbpbase/dbp.c
libdbpbase/dbp.c
+18
-0
libdbpbase/dbp.h
libdbpbase/dbp.h
+2
-0
libdbpbase/dbpbase.h
libdbpbase/dbpbase.h
+11
-0
libdbpbase/desktop.c
libdbpbase/desktop.c
+53
-27
libdbpbase/desktop.h
libdbpbase/desktop.h
+41
-0
libdbpbase/loop.c
libdbpbase/loop.c
+51
-29
libdbpbase/loop.h
libdbpbase/loop.h
+9
-0
libdbpbase/meta.c
libdbpbase/meta.c
+3
-2
libdbpbase/meta.h
libdbpbase/meta.h
+16
-0
libdbpbase/util.c
libdbpbase/util.c
+0
-0
libdbpbase/util.h
libdbpbase/util.h
+0
-0
libdbpmgr/Makefile
libdbpmgr/Makefile
+3
-3
libdbpmgr/dbpd-dbus-client.c
libdbpmgr/dbpd-dbus-client.c
+5
-3
libdbpmgr/dependencies.c
libdbpmgr/dependencies.c
+180
-11
libdbpmgr/dependencies.h
libdbpmgr/dependencies.h
+5
-2
libdbpmgr/error.c
libdbpmgr/error.c
+2
-0
libdbpmgr/types.h
libdbpmgr/types.h
+14
-0
update_version
update_version
+0
-4
version.mk
version.mk
+1
-0
No files found.
.gitignore
View file @
c02e0ff6
...
...
@@ -10,5 +10,5 @@
*.orig
*.local
*.remote
version.mk
build/
install/
Makefile
View file @
c02e0ff6
...
...
@@ -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
changelog
0 → 100644
View file @
c02e0ff6
== 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
conf/dbp_config.ini
View file @
c02e0ff6
...
...
@@ -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
conf/dbpd-introspection.xml
View file @
c02e0ff6
...
...
@@ -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(sss
s
)'
name=
'entry'
direction=
'out'
/>
</method>
<signal
name=
'NewMeta'
>
<arg
type=
's'
name=
'pkg_id'
/>
...
...
config.mk
View file @
c02e0ff6
...
...
@@ -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
dbp-cfg/Makefile
View file @
c02e0ff6
...
...
@@ -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)
$(L
IB
)
$(LDFLAGS)
@
$(CC)
-o
$(CONFIGBIN)
$(OBJFILES)
$(L
DPATH
)
$(LDFLAGS)
@
echo
"Done."
@
echo
...
...
dbp-cfg/main.c
View file @
c02e0ff6
#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
=
d
esktop_parse_file
(
CONFIG_FILE_PATH
)))
{
fprintf
(
stderr
,
_
(
"Unable to open config file %s
\n
"
),
CONFIG_FILE_PATH
);
if
(
!
(
df
=
d
bp_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
=
d
bp_d
esktop_lookup
(
df
,
argv
[
1
],
""
,
"Package Daemon Config"
)))
{
fprintf
(
stderr
,
_
(
"Key '%s' doesn't exist in config
\n
"
),
argv
[
1
]);
return
-
1
;
}
...
...
dbp-cmd/Makefile
View file @
c02e0ff6
...
...
@@ -7,7 +7,7 @@ OBJFILES = $(SRCFILES:.c=.o)
all
:
$(OBJFILES) $(DEPENDS)
@
echo
" [ LD ]
$(CMDBIN)
"
@
$(CC)
$(LDPATH)
-o
$(CMDBIN)
$(OBJFILES)
$(L
IB)
$(LDFLAGS)
-ldbpmgr
@
$(CC)
$(LDPATH)
-o
$(CMDBIN)
$(OBJFILES)
$(L
DFLAGS)
-ldbpbase
-ldbpmgr
@
echo
"Done."
@
echo
...
...
dbp-cmd/dbp-cmd.c
View file @
c02e0ff6
#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
++
)
...
...
dbp-common/desktop.h
deleted
100644 → 0
View file @
76c86373
#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
dbp-common/loop.h
deleted
100644 → 0
View file @
76c86373
#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
dbp-desktopd/Makefile
View file @
c02e0ff6
...
...
@@ -8,7 +8,7 @@ CFLAGS += -D_GNU_SOURCE
all
:
$(OBJFILES) $(DEPENDS)
@
echo
" [ LD ]
$(DESKTOPBIN)
"
@
$(CC)
$(LDPATH)
-o
$(DESKTOPBIN)
$(OBJFILES)
$(L
IB)
$(LDFLAGS)
-ldbpmgr
@
$(CC)
$(LDPATH)
-o
$(DESKTOPBIN)
$(OBJFILES)
$(L
DFLAGS)
-ldbpbase
-ldbpmgr
@
echo
"Done."
@
echo
...
...
dbp-desktopd/desktopd.c
View file @
c02e0ff6
...
...
@@ -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
);
...
...
dbp-meta/Makefile
View file @
c02e0ff6
...
...
@@ -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)
$(L
IB
)
$(LDFLAGS)
@
$(CC)
-o
$(METABIN)
$(OBJFILES)
$(L
DPATH
)
$(LDFLAGS)
@
echo
"Done."
@
echo
...
...
dbp-meta/dbp-meta.c
View file @
c02e0ff6
#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
=
d
bp_d
esktop_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
=
d
bp_d
esktop_lookup
(
mp
.
df
,
argv
[
3
],
""
,
mp
.
section
);
else
str
=
desktop_lookup
(
mp
.
df
,
argv
[
3
],
argv
[
4
],
mp
.
section
);
str
=
d
bp_d
esktop_lookup
(
mp
.
df
,
argv
[
3
],
argv
[
4
],
mp
.
section
);
if
(
str
)
fprintf
(
stdout
,
"%s
\n
"
,
str
);
return
0
;
...
...
dbp-run/Makefile
View file @
c02e0ff6
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)
$(DEPCHECK
LIBS)
@
$(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/"
dbp-run/common/dbp.vapi
View file @
c02e0ff6
...
...
@@ -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 = "d
bp_d
esktop_parse")]
public Desktop(char[] str);
[CCode (cname = "desktop_parse_file")]
[CCode (cname = "d
bp_d
esktop_parse_file")]
public Desktop.from_file(string path);
[CCode (cname = "desktop_write")]
[CCode (cname = "d
bp_d
esktop_write")]
public void write(string path);
[CCode (cname = "desktop_lookup")]
[CCode (cname = "d
bp_d
esktop_lookup")]
public unowned string? lookup(string key, string locale, string section);
[CCode (cname = "desktop_lookup_section")]
[CCode (cname = "d
bp_d
esktop_lookup_section")]
public int lookup_section(string section);
[CCode (cname = "desktop_lookup_entry")]
[CCode (cname = "d
bp_d
esktop_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_")]
...
...
dbp-run/common/logging.c
deleted
100644 → 0
View file @
76c86373
#include <stdio.h>
FILE
*
dbp_error_log
;
\ No newline at end of file
dbp-run/common/run.vala
View file @
c02e0ff6
...
...
@@ -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