diff options
author | Jonas Smedegaard <dr@jones.dk> | 2014-07-30 23:46:14 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2014-07-30 23:46:14 +0200 |
commit | c1dc844a8f09b52bb4c22960115a1640f255a213 (patch) | |
tree | c36855d0d890515b1c6b01b0c73237269d149e93 /profiles/wheezy/classes/Admin/apt/auto | |
parent | bf22f5b0a420a961d032a0529079b8ca092788b7 (diff) |
Major rewrite: Use reclass.
Diffstat (limited to 'profiles/wheezy/classes/Admin/apt/auto')
-rw-r--r-- | profiles/wheezy/classes/Admin/apt/auto/all.yml | 13 | ||||
-rw-r--r-- | profiles/wheezy/classes/Admin/apt/auto/core.yml | 23 | ||||
-rw-r--r-- | profiles/wheezy/classes/Admin/apt/auto/functions.yml | 49 |
3 files changed, 85 insertions, 0 deletions
diff --git a/profiles/wheezy/classes/Admin/apt/auto/all.yml b/profiles/wheezy/classes/Admin/apt/auto/all.yml new file mode 100644 index 0000000..1e8a8ba --- /dev/null +++ b/profiles/wheezy/classes/Admin/apt/auto/all.yml @@ -0,0 +1,13 @@ +classes: + - Admin.apt.auto.core +parameters: + doc: + admin: + tweak: + - fix mark auto-installed misc. packages relevant only as dependencies + pkg-auto: + - vim-common + tweak: + - > + chroot /target apt-mark auto \ + __PKGAUTOLIST__ diff --git a/profiles/wheezy/classes/Admin/apt/auto/core.yml b/profiles/wheezy/classes/Admin/apt/auto/core.yml new file mode 100644 index 0000000..76d0827 --- /dev/null +++ b/profiles/wheezy/classes/Admin/apt/auto/core.yml @@ -0,0 +1,23 @@ +#TODO: Stop install bash-completion or uuid-runtime when bug fixed in stable +#FIXME: File bugreport about bash-completion and uuid-runtime not installed +classes: + - Admin.apt.auto.functions +parameters: + doc: + admin: + tweak: + - fix mark auto-installed essential packages + dependencies (bug#742977) + pkg: + - bash-completion + - uuid-runtime + pkg-auto: + - aptitude-common + - bash-completion + - grub-common + - isc-dhcp-common + - tasksel-data + - uuid-runtime + tweak: + - > + chroot /target apt-mark auto \ + $(_pkganddeepdeps $(_pkgessentials) apt linux-image-*) diff --git a/profiles/wheezy/classes/Admin/apt/auto/functions.yml b/profiles/wheezy/classes/Admin/apt/auto/functions.yml new file mode 100644 index 0000000..2f1a935 --- /dev/null +++ b/profiles/wheezy/classes/Admin/apt/auto/functions.yml @@ -0,0 +1,49 @@ +parameters: + doc: + admin: + tweak: + - define routines to resolve package dependencies + tweak: + - > + _pkgdeps(){ set -e;\ + chroot /target dpkg-query \ + -Wf=',$''{Pre-Depends},$''{Depends},$''{Recommends}\n' $* 2>/dev/null \ + | sed -r \ + -e 's/[,|] *([a-z0-9.+-]+)?(:\s+)?( *[^|,]*)?/\1\n/g' \ + | sed '/^$/d'|sort -u; } + - > + _pkg2re(){ set -e;\ + echo $* \ + | sed -r \ + -e 's/\s+/\|/g;' \ + -e 's/^\|//;' \ + -e 's/([.+-])/\\\1/g;' \ + -e 's/\|$//'; } + - > + _pkgreal(){ set -e;\ + chroot /target dpkg-query \ + -Wf='$''{Package},$''{Provides},\n' \ + | sed -r \ + -e '/,,/d;' \ + -e 's/^([a-z0-9.+-]+).*[,|] *('"$(_pkg2re $*)"')[ :,]/\1/;' \ + -e '/,/d'; } + - > + _pkganddeepdeps(){ set -e;\ + rest=$*;\ + all=$rest;\ + for i in 1 2 3 4 5; do \ + deps=$(_pkgdeps $rest);\ + rest="$deps $(_pkgreal $deps)";\ + all="$all $rest";\ + done;\ + echo $all \ + | sed -r \ + -e 's/\s+/\n/g' \ + | sort -u; } + - > + _pkgessentials(){ set -e;\ + chroot /target dpkg-query \ + -Wf='$''{Package}%$''{Essential}\n' \ + | sed -r \ + -e 's/(.*)%yes/\1/;' \ + -e '/%/d'; } |