Since I would like to skip an export if “the database was already the latest version,” I wanted to be able to use the non-zero exit code to do so…
Either the documentation is incorrect or there’s something wrong with location or I’m failing to understand what “[location update] will terminate with a return code of … 3 if the database was already the latest version” means:
$ man location|grep 'update the local database' -A3 -B1
update
This command will try to update the local database.
It will terminate with a return code of zero if the database has been
successfully updated. 1 on error, 2 on invalid call and 3 if the database was
already the latest version.
$ printf \\n;
sudo lla /var/lib/location/database.db;
sudo location --debug verify;
sudo location --debug update;
printf '\nec=%s\n\n' "$?";
sudo location --debug update;
printf '\nec=%s\n' "$?";
location --version;
uname -s -o -v -r
.r--r--r-- 49,532,297 root root 3 Sep 12:27 /var/lib/location/database.db
Database successfully verified
Already on the latest version
ec=0
Already on the latest version
ec=0
location 0.9.19
Linux 6.12.96-1-MANJARO #1 SMP PREEMPT_DYNAMIC Sat, 18 Jul 2026 20:22:19 +0000 GNU/Linux
$ printf \\n;
sudo ls -la /var/lib/location/database.db;
sudo location --debug verify;
sudo location --debug update;
printf '\nec=%s\n\n' "$?";
sudo location --debug update;
printf '\nec=%s\n' "$?";
location --version;
uname -s -o -v -r
-r--r--r-- 1 root root 49532297 Sep 3 10:26 /var/lib/location/database.db
Database successfully verified
Already on the latest version
ec=0
Already on the latest version
ec=0
location 0.9.19
Linux 6.17.0-1020-oracle #20-Ubuntu SMP Sat Jul 25 00:58:05 UTC 2026 GNU/Linux
Thanks!