Lastore Daemon developed by golang, github.com/linuxdeepin/go-lib/dbus and the command line apt tools (not libapt).
The golang project layout is ruled under gb.
It has four group packages
- src/internal/system
This is the Interface package. It defined the interface lastore programs can use. And define the minimal interface need be implement by system package manager backend.
- src/internal/system/apt
The system package manager backend. Currently only apt backend is implemented. This package shouldn’t be used directly by lastore main programs.
- src/lastore-main-programs
The main programs of this project.
- vendor/
The vendor codes.
The directories of etc, usr and var are store static files, like
- dbus configuration files
- autostart desktop files
- systemd service files
- apt conf files
- lastore-daemon.h the Qt dbus export header
- var/lib/lastore the meta data of lastore
- locales and locale_categories store the po file pulled from transifex
Main structs
- Manager
- Updater
- Job
- System
- Apt
We have implement the smart mirrors. So why we still using old way to choosing mirror server by user ?
Just detect all mirror servers per download. By this, we got.
- choosing best server to download by real time detecting.
- ensure consistency between mirror and official server.
- Server is always workable.
We have to reduce the official pressure when it just push update. We can notify the update after the mirrors has been synchronized.
The traditional xdg autostart is not suitable for running service.
We should only get user language info from com.deepin.Accounts services. But there has two prerequisite
- com.deepin.Accounts need implement user language support. Currently lastore-daemon actually use the org.freedesktop.Accounts
- DDE or other component need setup the user language information.
write tools to analyze the score of desktop in debs which has two or more desktop files. So we can know whether it is a reliable way to detect right desktop file.
lastore-daemon heavy dependent local package manager status. So we have to build a clean root system by tools like debootstrap with chroot or docker.
Currently it using apt-get -o Debug::NoLocking to download package.
This change need more design. The basic idea is write a download manager
Only the internal/system/apt package can known about dpkg/apt. We need hide the package manager system under internal/system package.
See also https://cr.deepin.io/#/c/9797/
Dpkg may be in dirty status when abort some important operations. This status can be fixed by run
dpkg --configure -a
There has a quick way to detect the dirty status (See debsystem.cc:CheckUpdates in apt project. And CheckDpkgDirtyJournal in system_apt.go)
We use the apt-get -o Debug::NoLocking to download package. It’s simple and workable. But when parallel download packagesq which has some partial same dependencies, then it may be failed when apt try moving the completed packages from /var/cache/apt/archives/partial to /var/cache/apt/archives. Because this completed packages has been moved by the first packages.
Workaround by simply retry three times before change notify the failed job status.
- How Deepin improve debian repository ? (zh-cn only now)