api.spaceplanner.app

Spaceplanner API
git clone git://jacobedwards.org/api.spaceplanner.app
Log | Files | Refs

updatedb (274B)


      1 #!/bin/sh
      2 # List unapplied database updates
      3 
      4 set -e
      5 
      6 dir="$1"
      7 last="$dir"/last
      8 
      9 if test -f "$last"; then
     10 	last="$(<"$last")" 
     11 else
     12 	last=""
     13 fi
     14 
     15 find "$dir" -type f | sort | awk -vdir="$dir" -vl="$last" 'BEGIN {
     16 	if(l=="")
     17 		p=1
     18 }
     19 
     20 p && $0 != "last"
     21 
     22 l == dir $0 {
     23 	p = 1
     24 }'