#!/bin/sh . ScriptFunctions Import GoboLinux.sh #Verify_Superuser "$@" root="$goboPrefix/" root="$(pwd)/" create() { Parameters "$@" real fake Log_Normal "Translating $real into $fake..." dir="$(dirname "$fake")" if [ ! -e "$dir" ] then mkdir -p "$(dirname "$fake")" echo "! $dir" >&7 fi ln -s "$root$real" "$root$fake" echo "$real $fake" >&7 } remove() { Parameters "$@" real fake if [ "!" = "$real" ] then Log_Normal "Removing directory $fake..." rmdir "$fake" else Log_Normal "Reverting $fake to $real..." rm -f "$fake" fi } hide() { Parameters "$@" real fake gobohide -h "$fake" } show() { Parameters "$@" real fake gobohide -u "$fake" } apply() { Parameters "$@" locfile action ORIGIFS="$IFS" IFS=" " while read real fake do $action "$real" "$fake" done < $locfile IFS="$ORIGIFS" } reset() { if [ ! -e "$root/.Localise_Journal" ] then Die "No localisation journal found. Cannot reset." fi apply "$root/.Localise_Journal" remove rm -f "$root/.Localise_Journal" } loc="$1" if [ "x$1" = "x--reset" ] then reset elif [ "x$1" = "x--hide" ] then apply "$root/.Localise_Journal" hide elif [ "x$1" = "x--show" ] then apply "$root/.Localise_Journal" show elif [ "$1" ] then exec 7>"$root/.Localise_Journal-progress" apply "$1" create tac "$root/.Localise_Journal-progress" > "$root/.Localise_Journal" rm -f "$root/.Localise_Journal-progress" else Log_Normal "Usage: LocaliseDirs " Log_Normal "Use --reset to return to the default paths." fi