summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdebootstrap.sh19
1 files changed, 13 insertions, 6 deletions
diff --git a/debootstrap.sh b/debootstrap.sh
index 28b0c31..c0554ad 100755
--- a/debootstrap.sh
+++ b/debootstrap.sh
@@ -14,7 +14,7 @@ Usage:
14 $0 chroot <suite> <name> 14 $0 chroot <suite> <name>
15 $0 list 15 $0 list
16 $0 show unpackaged <suite> <name> 16 $0 show unpackaged <suite> <name>
17 $0 show unpackaged-du <suite> <name> 17 $0 show unpackaged-du <suite> <name> ["filtered"]
18 18
19EOF 19EOF
20 printf "Currently running suite:\n %s\n" "$(lsb_release -cs)" 20 printf "Currently running suite:\n %s\n" "$(lsb_release -cs)"
@@ -106,7 +106,7 @@ suite_name_to_imagename()
106 printf '%s/%s-%s-%s.%s.btrfs\n' "$imgdir" "$suite" "$variant" "$arch" "$name" 106 printf '%s/%s-%s-%s.%s.btrfs\n' "$imgdir" "$suite" "$variant" "$arch" "$name"
107} 107}
108 108
109show_unpackaged() 109show_unpackaged_helper()
110{ 110{
111 suite=$1 111 suite=$1
112 name=$2 112 name=$2
@@ -114,16 +114,23 @@ show_unpackaged()
114 114
115 sh_image "$suite" "$name" find -type f | sed 's?^\./??' | sort > ${imagename}.find.txt 115 sh_image "$suite" "$name" find -type f | sed 's?^\./??' | sort > ${imagename}.find.txt
116 sh_image "$suite" "$name" sh -c 'sort -u var/lib/dpkg/info/*.list' | sed -e 's?^/??' -e 's?^\.$/??' > ${imagename}.dpkg-list.txt 116 sh_image "$suite" "$name" sh -c 'sort -u var/lib/dpkg/info/*.list' | sed -e 's?^/??' -e 's?^\.$/??' > ${imagename}.dpkg-list.txt
117 comm -23 ${imagename}.find.txt ${imagename}.dpkg-list.txt | tee ${imagename}.unpackaged.txt 117 comm -23 ${imagename}.find.txt ${imagename}.dpkg-list.txt > ${imagename}.unpackaged.txt
118}
119
120show_unpackaged()
121{
122 show_unpackaged_helper "$@"
123 cat "${imagename}.unpackaged.txt"
118} 124}
119 125
120show_unpackaged_du() 126show_unpackaged_du()
121{ 127{
128 show_unpackaged_helper "$@"
122 if [ "$3" = filtered ]; then 129 if [ "$3" = filtered ]; then
123 filter='var/lib/dpkg/|var/lib/apt/|var/log/' 130 filter='var/lib/dpkg/|var/lib/apt/|var/log/|var/cache/apt/archives'
124 show_unpackaged "$@" | egrep -v "^($filter)" | sh_image "$1" "$2" xargs du -csh 131 cat "${imagename}.unpackaged.txt" | egrep -v "^($filter)" | sh_image "$1" "$2" xargs du -csh
125 else 132 else
126 show_unpackaged "$@" | sh_image "$1" "$2" xargs du -csh 133 cat "${imagename}.unpackaged.txt" | sh_image "$1" "$2" xargs du -csh
127 fi 134 fi
128} 135}
129 136