Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 97cbce00c3
Fetching contributors…

Cannot retrieve contributors at this time

executable file 51 lines (44 sloc) 1.1 kb
#!/bin/sh
log() {
echo $1
}
stripslash() {
echo $1 | tail -c +2
}
update_files() {
for file in `cat tracked-files`; do
mkdir -p "`dirname $(stripslash $file)`"
log "Updating $file..."
cp "$file" "`stripslash $file`"
done
}
restore_files() {
backup_dir=backups/backup-`date +%Y-%m-%d-%H-%M-%S`
mkdir -p "$backup_dir"
for file in `cat tracked-files`; do
fname="$backup_dir/`stripslash $file`"
log "Backing up $file to $fname..."
mkdir -p "`dirname $fname`"
cp "$file" "$fname"
done
for file in `cat tracked-files`; do
log "Restoring$file..."
cp "`stripslash $file`" "$file"
done
echo '---------------------------------------'
echo ' ' Remember to set the right architecture \
in pacman.d/mirrorlist and makepkg.conf
echo '---------------------------------------'
}
main() {
case $1 in
update)
update_files;;
restore)
restore_files;;
*)
echo "unknown action $1"
exit 1
esac
}
main $@
Jump to Line
Something went wrong with that request. Please try again.