浏览代码

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.
Liav A 2 年之前
父节点
当前提交
fcc3497803
共有 3 个文件被更改,包括 15 次插入15 次删除
  1. 12 12
      Ports/.port_include.sh
  2. 1 1
      Ports/README.md
  3. 2 2
      Ports/build_installed.sh

+ 12 - 12
Ports/.port_include.sh

@@ -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..."

+ 1 - 1
Ports/README.md

@@ -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.

+ 2 - 2
Ports/build_installed.sh

@@ -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