mid-kid
8 years ago
2 changed files with 86 additions and 0 deletions
@ -0,0 +1,65 @@ |
|||
diff --git a/common/profile-sync-daemon.in b/common/profile-sync-daemon.in
|
|||
index 4e83af6..3a8d5d7 100644
|
|||
--- a/common/profile-sync-daemon.in
|
|||
+++ b/common/profile-sync-daemon.in
|
|||
@@ -310,14 +310,18 @@ cleanup() {
|
|||
load_env_for "$browser" |
|||
for item in "${DIRArr[@]}"; do |
|||
DIR="$item" |
|||
- CRASHArr=( $(find "${DIR%/*}" -type d -name '*crashrecovery*'|sort -r) )
|
|||
+
|
|||
+ local CRASHArr=()
|
|||
+ while IFS= read -d '' -r backup; do
|
|||
+ CRASHArr=("${CRASHArr[@]}" "$backup")
|
|||
+ done < <(find "${DIR%/*}" -type d -name '*crashrecovery*' -print0 | sort -r -z)
|
|||
+
|
|||
if [[ ${#CRASHArr[@]} -gt 0 ]]; then |
|||
echo -e "${BLD}Deleting ${#CRASHArr[@]} crashrecovery dir(s) for profile ${BLU}$DIR${NRM}" |
|||
for backup in "${CRASHArr[@]}"; do |
|||
echo -e "${BLD}${RED} $backup${NRM}" |
|||
rm -rf "$backup" |
|||
done |
|||
- unset CRASHArr
|
|||
else |
|||
echo -e "${BLD}Found no crashrecovery dirs for: ${BLU}$DIR${NRM}${BLD}${NRM}" |
|||
fi |
|||
@@ -526,13 +530,16 @@ done
|
|||
enforce() { |
|||
local browser |
|||
for browser in "${BROWSERS[@]}"; do |
|||
- CRASHArr=( $(find "${DIR%/*}" -type d -name '*crashrecovery*'|sort -r) )
|
|||
+ local CRASHArr=()
|
|||
+ while IFS= read -d '' -r backup; do
|
|||
+ CRASHArr=("${CRASHArr[@]}" "$backup")
|
|||
+ done < <(find "${DIR%/*}" -type d -name '*crashrecovery*' -print0 | sort -r -z)
|
|||
+
|
|||
if [[ ${#CRASHArr[@]} -gt $BACKUP_LIMIT ]]; then |
|||
for remove in "${CRASHArr[@]:$BACKUP_LIMIT}"; do |
|||
rm -rf "$remove" |
|||
done |
|||
fi |
|||
- unset CRASHArr
|
|||
done |
|||
} |
|||
|
|||
@@ -603,7 +610,11 @@ parse() {
|
|||
fi |
|||
UPPER="$VOLATILE/$user-$browser${suffix}-rw" |
|||
if [[ -d "$DIR" ]]; then |
|||
- CRASHArr=( $(find "${DIR%/*}" -type d -name '*crashrecovery*'|sort -r) )
|
|||
+ local CRASHArr=()
|
|||
+ while IFS= read -d '' -r backup; do
|
|||
+ CRASHArr=("${CRASHArr[@]}" "$backup")
|
|||
+ done < <(find "${DIR%/*}" -type d -name '*crashrecovery*' -print0 | sort -r -z)
|
|||
+
|
|||
# get permissions on profile dir and be smart about it since symlinks are all 777 |
|||
[[ -f $PID_FILE ]] && TRUEP=$(stat -c %a "$BACKUP") || TRUEP=$(stat -c %a "$DIR") |
|||
# since $XDG_RUNTIME_DIR is 700 by default so pass on by |
|||
@@ -646,7 +657,6 @@ parse() {
|
|||
echo -e "$(tput cr)$(tput cuf 17) ${BLU}$backup ${NRM}${BLD}($psize)${NRM}" |
|||
done |
|||
fi |
|||
- unset CRASHArr
|
|||
echo |
|||
fi |
|||
done |
@ -0,0 +1,21 @@ |
|||
name=profile-sync-daemon |
|||
version=6.31 |
|||
update_url="https://github.com/graysky2/$name/releases" |
|||
|
|||
dlextract "https://github.com/graysky2/$name/archive/v$version.tar.gz" \ |
|||
'159cabc39972be8d72e760a0025b5cd9' |
|||
extrafile 'profile-sync-daemon-6.31-fix-filenames-with-spaces.patch' |
|||
header_end |
|||
|
|||
cd "$name-$version" |
|||
patch -p1 -i ../profile-sync-daemon-6.31-fix-filenames-with-spaces.patch |
|||
|
|||
make install-bin install-man COMPRESS_MAN=0 \ |
|||
DESTDIR="$dir_install" \ |
|||
PREFIX="/$dir_prefix" \ |
|||
BINDIR="/$dir_prefix/$dir_bindir" \ |
|||
SHAREDIR="/$dir_prefix/$dir_datadir/psd" \ |
|||
MANDIR="/$dir_prefix/$dir_mandir/man1" \ |
|||
ZSHDIR="/$dir_prefix/$dir_datadir/zsh/site-functions" |
|||
|
|||
# vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab: |
Loading…
Reference in new issue