-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmkpatch-roonapi
More file actions
executable file
·36 lines (32 loc) · 907 Bytes
/
mkpatch-roonapi
File metadata and controls
executable file
·36 lines (32 loc) · 907 Bytes
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
32
33
34
35
36
#!/bin/bash
# Check Python's global directories
have_python3=`type -p python3`
if [ "${have_python3}" ]
then
SITES=($(python3 -c 'import site; print(site.getsitepackages())' | tr -d '[],'))
else
SITES=($(python -c 'import site; print(site.getsitepackages())' | tr -d '[],'))
fi
for site in ${SITES[@]}
do
site=`echo $site | sed -e "s/\'//g"`
[ -d "${site}/roonapi" ] && {
PYDIR=`echo ${site} | awk -F "/dist-packages/" ' { print $1 } '`
USERSITE=$PYDIR/dist-packages
break
}
done
[ -d $USERSITE/roonapi ] || {
echo "Roon API Python module not found. Exiting."
exit 1
}
cd $PYDIR
[ -d ~/src/RoonCommandLine/patches ] || mkdir ~/src/RoonCommandLine/patches
OUT=$HOME/src/RoonCommandLine/patches/roonapi-listmedia.patch
rm -f $OUT
touch $OUT
for i in dist-packages/roonapi/*.orig
do
j=`echo $i | sed -e "s/.orig//"`
diff -Naur $i $j >> $OUT
done