mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 17:31:58 -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
|
enable_ccache
|
||||||
}
|
}
|
||||||
|
|
||||||
packagesdb="${DESTDIR}/usr/Ports/packages.db"
|
installedpackagesdb="${DESTDIR}/usr/Ports/installed.db"
|
||||||
|
|
||||||
makeopts=("-j${MAKEJOBS}")
|
makeopts=("-j${MAKEJOBS}")
|
||||||
installopts=()
|
installopts=()
|
||||||
|
@ -454,27 +454,27 @@ addtodb() {
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
if [ "${1:-}" = "--auto" ]; then
|
if [ "${1:-}" = "--auto" ]; then
|
||||||
echo "auto $port $version" >> "$packagesdb"
|
echo "auto $port $version" >> "$installedpackagesdb"
|
||||||
else
|
else
|
||||||
echo "manual $port $version" >> "$packagesdb"
|
echo "manual $port $version" >> "$installedpackagesdb"
|
||||||
fi
|
fi
|
||||||
if [ "${#depends[@]}" -gt 0 ]; then
|
if [ "${#depends[@]}" -gt 0 ]; then
|
||||||
echo "dependency $port ${depends[@]}" >> "$packagesdb"
|
echo "dependency $port ${depends[@]}" >> "$installedpackagesdb"
|
||||||
fi
|
fi
|
||||||
echo "Successfully installed $port $version."
|
echo "Successfully installed $port $version."
|
||||||
}
|
}
|
||||||
ensure_packagesdb() {
|
ensure_installedpackagesdb() {
|
||||||
if [ ! -f "$packagesdb" ]; then
|
if [ ! -f "$installedpackagesdb" ]; then
|
||||||
mkdir -p "$(dirname $packagesdb)"
|
mkdir -p "$(dirname $installedpackagesdb)"
|
||||||
touch "$packagesdb"
|
touch "$installedpackagesdb"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
package_install_state() {
|
package_install_state() {
|
||||||
local port=$1
|
local port=$1
|
||||||
local version=${2:-}
|
local version=${2:-}
|
||||||
|
|
||||||
ensure_packagesdb
|
ensure_installedpackagesdb
|
||||||
grep -E "^(auto|manual) $port $version" "$packagesdb" | cut -d' ' -f1
|
grep -E "^(auto|manual) $port $version" "$installedpackagesdb" | cut -d' ' -f1
|
||||||
}
|
}
|
||||||
installdepends() {
|
installdepends() {
|
||||||
for depend in "${depends[@]}"; do
|
for depend in "${depends[@]}"; do
|
||||||
|
@ -514,8 +514,8 @@ uninstall() {
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
# Without || true, mv will not be executed if you are uninstalling your only remaining port.
|
# Without || true, mv will not be executed if you are uninstalling your only remaining port.
|
||||||
grep -v "^manual $port " "$packagesdb" > packages.db.tmp || true
|
grep -v "^manual $port " "$installedpackagesdb" > installed.db.tmp || true
|
||||||
mv packages.db.tmp "$packagesdb"
|
mv installed.db.tmp "$installedpackagesdb"
|
||||||
}
|
}
|
||||||
do_installdepends() {
|
do_installdepends() {
|
||||||
buildstep_intro "Installing dependencies of $port..."
|
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
|
script in this directory. This is sometimes required when LibC changes, for
|
||||||
example. Pass `clean` as first argument to remove old build files beforehand.
|
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
|
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
|
when clearing the build directory as port dependencies may not be installed
|
||||||
again otherwise.
|
again otherwise.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
. ".hosted_defs.sh"
|
. ".hosted_defs.sh"
|
||||||
|
|
||||||
packagesdb="${SERENITY_INSTALL_ROOT}/usr/Ports/packages.db"
|
installedpackagesdb="${SERENITY_INSTALL_ROOT}/usr/Ports/installed.db"
|
||||||
|
|
||||||
clean=false
|
clean=false
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
@ -33,7 +33,7 @@ while IFS= read -r line; do
|
||||||
echo "ERROR: Previously installed port $port doesn't exist!"
|
echo "ERROR: Previously installed port $port doesn't exist!"
|
||||||
some_failed=true
|
some_failed=true
|
||||||
fi
|
fi
|
||||||
done < <(grep -E "^(auto|manual)" "$packagesdb")
|
done < <(grep -E "^(auto|manual)" "$installedpackagesdb")
|
||||||
|
|
||||||
if [ "$some_failed" == false ]; then
|
if [ "$some_failed" == false ]; then
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Reference in a new issue