summaryrefslogtreecommitdiffstats
path: root/utils/lxc/patches/025-remove-unsupported-option.patch
blob: 70eb12bbe60fc3d4f9c1d4b8b1908631684f5913 (plain)
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
--- a/templates/lxc-download.in
+++ b/templates/lxc-download.in
@@ -375,32 +375,7 @@ fi
 # Unpack the rootfs
 echo "Unpacking the rootfs"
 
-IS_BSD_TAR="false"
-if tar --version | grep -sq "bsdtar"; then
-    IS_BSD_TAR="true"
-fi
-
-EXCLUDES=""
-excludelist=$(relevant_file excludes)
-if [ -f "${excludelist}" ]; then
-  while read -r line; do
-    if [ ${IS_BSD_TAR} = "true" ]; then
-      line="^${line}"
-    fi
-    EXCLUDES="${EXCLUDES} --exclude=${line}"
-  done < "${excludelist}"
-fi
-
-# Do not surround ${EXCLUDES} by quotes. This does not work. The solution could
-# use array but this is not POSIX compliant. The only POSIX compliant solution
-# is to use a function wrapper, but the latter can't be used here as the args
-# are dynamic. We thus need to ignore the warning brought by shellcheck.
-# shellcheck disable=SC2086
-if [ "${IS_BSD_TAR}" = "true" ]; then
-  tar ${EXCLUDES} --numeric-owner -xpJf "${LXC_CACHE_PATH}/rootfs.tar.xz" -C "${LXC_ROOTFS}"
-else
-  tar --anchored ${EXCLUDES} --numeric-owner --xattrs-include='*' -xpJf "${LXC_CACHE_PATH}/rootfs.tar.xz" -C "${LXC_ROOTFS}"
-fi
+tar --absolute-names --numeric-owner --xattrs-include='*' -xpJf "${LXC_CACHE_PATH}/rootfs.tar.xz" -C "${LXC_ROOTFS}"
 
 mkdir -p "${LXC_ROOTFS}/dev/pts/"