File: glance-store-common.preinst

package info (click to toggle)
python-glance-store 4.1.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,872 kB
  • sloc: python: 17,197; sh: 231; makefile: 33
file content (25 lines) | stat: -rw-r--r-- 977 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
#!/bin/sh

set -e

if [ "${1}" = "install" ] || [ "${1}" = "upgrade" ] ; then
	# The file /etc/glance/rootwrap.conf in buster was copied from
	# /usr/share/glance-common/rootwrap.conf from the glance-common
	# package during postinst. In Bullseye, it becomes a CONFFILE
	# owned by the glance-store-common package. To avoid prompting
	# during upgrade from Buster to Bullseye, we therefore need to
	# get the file away before installing glance-store-common,
	# otherwise dpkg will prompt the user interactively.
	#
	# Of course, this wont be needed in Bookworms anymore.
	if [ -e /etc/glance/rootwrap.conf ] ; then
		# We only remove the file if it wasn't manually modified
		# by the user (in which case dpkg prompting is the correct
		# thing to do). So we just use the MD5 to see if it's the
		# same file.
		MD5=$(md5sum /etc/glance/rootwrap.conf | awk '{print $1}')
		if [ "${MD5}" = "38f96ec95f09ffb192ee2febc6f771a1" ] ; then
			rm /etc/glance/rootwrap.conf
		fi
	fi
fi