File: snapper.preinst

package info (click to toggle)
snapper 0.10.6-1.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,072 kB
  • sloc: cpp: 24,846; ansic: 1,466; sh: 1,410; makefile: 514; python: 127; ruby: 90
file content (35 lines) | stat: -rw-r--r-- 1,221 bytes parent folder | download | duplicates (4)
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
#!/bin/sh
set -e

action=$1
version=$2

# This is a cleanup script for removing the fallout of bug
# https://github.com/openSUSE/snapper/issues/328
#
# Normally the /etc/cron.daily/snapper item should be a file,
# but due to that bug it was a directory for a while.
#
# We need to handle upgrading from the broken package specifically
# and move the cron files to the correct location.
# 
# TODO: This script can be removed after some time, it is just needed
# to overcome the temporary upgrade issue. The following package upgrades
# will not need this.

if [ "$action" = upgrade ]; then
  # move /etc/cron.daily/snapper/suse.de-snapper to the correct location
  if [ -e /etc/cron.daily/snapper/suse.de-snapper ]; then
    mv /etc/cron.daily/snapper/suse.de-snapper /etc/cron.daily/snapper.cron
    rm -rf /etc/cron.daily/snapper
    mv /etc/cron.daily/snapper.cron /etc/cron.daily/snapper
  fi
  # move /etc/cron.hourly/snapper/suse.de-snapper to the correct location
  if [ -e /etc/cron.hourly/snapper/suse.de-snapper ]; then
    mv /etc/cron.hourly/snapper/suse.de-snapper /etc/cron.hourly/snapper.cron
    rm -rf /etc/cron.hourly/snapper
    mv /etc/cron.hourly/snapper.cron /etc/cron.hourly/snapper
  fi
fi

exit 0