-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathclonejug
31 lines (23 loc) · 1001 Bytes
/
clonejug
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
# Usage: clonejug JUGNAME
# Clones a master jug for a wineprefix containing zero or more wine applications.
# The wineprefix is cloned to $WINEPREFIX or ~/.wine-jug-$JUGNAME if that's not set.
# The clone links readonly files from the master, and copies files that must be read-write.
set -x
set -e
JUGNAME=$1
WINEPREFIX=${WINEPREFIX:-$HOME/.wine-jug-$JUGNAME}
WINEJUGS=${WINEJUGS:-/usr/lib/wine/jugs}
JUG="${WINEJUGS}/${JUGNAME}"
# Create all directories from $JUG in $WINEPREFIX
mkdir $WINEPREFIX
cd $JUG
find . -type d -print0 | (cd $WINEPREFIX; xargs -0 mkdir -p )
# Create symlinks for all non-user files
find drive_c -type d -iname users -prune -o -type f -exec ln -s "$JUG/{}" "$WINEPREFIX/{}" \;
# Copy all user files
find .update-timestamp *.reg drive_c/users -type f -exec cp -a "{}" "$WINEPREFIX/{}" \;
# Make user's temp directory (some apps crash without this)
mkdir "$WINEPREFIX/drive_c/users/$LOGNAME/Temp"
# Create drives
ln -s ../drive_c "$WINEPREFIX/dosdevices/c:"