mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 09:21:57 -05:00
Ports: Rename packages.db => installed.db
The /usr/Ports/packages.db will be used later for tracking available ports by the upcoming package manager, which will use it to do search queries, providing metadata on available ports, etc. Ports that are installed will be registered from now on in the file of /usr/Ports/installed.db, so that file will be used later on to allow further management of what is actually installed on the system.
This commit is contained in:
parent
c53b1360d7
commit
fcc3497803
3 changed files with 15 additions and 15 deletions
|
@ -80,7 +80,7 @@ host_env() {
|
|||
enable_ccache
|
||||
}
|
||||
|
||||
packagesdb="${DESTDIR}/usr/Ports/packages.db"
|
||||
installedpackagesdb="${DESTDIR}/usr/Ports/installed.db"
|
||||
|
||||
makeopts=("-j${MAKEJOBS}")
|
||||
installopts=()
|
||||
|
@ -454,27 +454,27 @@ addtodb() {
|
|||
return
|
||||
fi
|
||||
if [ "${1:-}" = "--auto" ]; then
|
||||
echo "auto $port $version" >> "$packagesdb"
|
||||
echo "auto $port $version" >> "$installedpackagesdb"
|
||||
else
|
||||
echo "manual $port $version" >> "$packagesdb"
|
||||
echo "manual $port $version" >> "$installedpackagesdb"
|
||||
fi
|
||||
if [ "${#depends[@]}" -gt 0 ]; then
|
||||
echo "dependency $port ${depends[@]}" >> "$packagesdb"
|
||||
echo "dependency $port ${depends[@]}" >> "$installedpackagesdb"
|
||||
fi
|
||||
echo "Successfully installed $port $version."
|
||||
}
|
||||
ensure_packagesdb() {
|
||||
if [ ! -f "$packagesdb" ]; then
|
||||
mkdir -p "$(dirname $packagesdb)"
|
||||
touch "$packagesdb"
|
||||
ensure_installedpackagesdb() {
|
||||
if [ ! -f "$installedpackagesdb" ]; then
|
||||
mkdir -p "$(dirname $installedpackagesdb)"
|
||||
touch "$installedpackagesdb"
|
||||
fi
|
||||
}
|
||||
package_install_state() {
|
||||
local port=$1
|
||||
local version=${2:-}
|
||||
|
||||
ensure_packagesdb
|
||||
grep -E "^(auto|manual) $port $version" "$packagesdb" | cut -d' ' -f1
|
||||
ensure_installedpackagesdb
|
||||
grep -E "^(auto|manual) $port $version" "$installedpackagesdb" | cut -d' ' -f1
|
||||
}
|
||||
installdepends() {
|
||||
for depend in "${depends[@]}"; do
|
||||
|
@ -514,8 +514,8 @@ uninstall() {
|
|||
esac
|
||||
done
|
||||
# Without || true, mv will not be executed if you are uninstalling your only remaining port.
|
||||
grep -v "^manual $port " "$packagesdb" > packages.db.tmp || true
|
||||
mv packages.db.tmp "$packagesdb"
|
||||
grep -v "^manual $port " "$installedpackagesdb" > installed.db.tmp || true
|
||||
mv installed.db.tmp "$installedpackagesdb"
|
||||
}
|
||||
do_installdepends() {
|
||||
buildstep_intro "Installing dependencies of $port..."
|
||||
|
|
|
@ -37,7 +37,7 @@ configuration/compilation options, and some other things (see
|
|||
script in this directory. This is sometimes required when LibC changes, for
|
||||
example. Pass `clean` as first argument to remove old build files beforehand.
|
||||
|
||||
Installed ports are being tracked in `Build/x86_64/Root/usr/Ports/packages.db` (a simple text file).
|
||||
Installed ports are being tracked in `Build/x86_64/Root/usr/Ports/installed.db` (a simple text file).
|
||||
You can delete this file at any time, in fact it must be edited or removed
|
||||
when clearing the build directory as port dependencies may not be installed
|
||||
again otherwise.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
. ".hosted_defs.sh"
|
||||
|
||||
packagesdb="${SERENITY_INSTALL_ROOT}/usr/Ports/packages.db"
|
||||
installedpackagesdb="${SERENITY_INSTALL_ROOT}/usr/Ports/installed.db"
|
||||
|
||||
clean=false
|
||||
case "$1" in
|
||||
|
@ -33,7 +33,7 @@ while IFS= read -r line; do
|
|||
echo "ERROR: Previously installed port $port doesn't exist!"
|
||||
some_failed=true
|
||||
fi
|
||||
done < <(grep -E "^(auto|manual)" "$packagesdb")
|
||||
done < <(grep -E "^(auto|manual)" "$installedpackagesdb")
|
||||
|
||||
if [ "$some_failed" == false ]; then
|
||||
exit 0
|
||||
|
|
Loading…
Reference in a new issue