diff options
author | Jonas Smedegaard <dr@jones.dk> | 2014-08-08 01:14:09 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2014-08-08 01:14:09 +0200 |
commit | dc1e411a26c1d568bd73713f33abbef45eb064f7 (patch) | |
tree | b4cc7969a3cc9f030100d40dc01a8646d3d7c569 /tweaks/base | |
parent | 41658484af4e5f548356d4c3024857ebd156241d (diff) |
Fix drop old-style tweaks.
Diffstat (limited to 'tweaks/base')
-rw-r--r-- | tweaks/base | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/tweaks/base b/tweaks/base deleted file mode 100644 index 2e2ceee..0000000 --- a/tweaks/base +++ /dev/null @@ -1,67 +0,0 @@ -## tidy loose ends -set -e; -# fix mark auto-installed essential packages + dependencies (bug#742977) - _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'; }; - chroot /target apt-mark auto - $(_pkganddeepdeps $(_pkgessentials) apt linux-image-*); -# fix mark auto-installed misc. packages relevant only as dependencies - chroot /target apt-mark auto - apt-utils aptitude-common grub-common isc-dhcp-common tasksel-data vim-common; - -# keep backup of any tweaked (i.e. edited or created) config file - _backup(){ set -e; - if [ -e "$1.orig" ]; then - :; - elif [ -e "$1" ]; then - cp -a "$1" "$1.orig"; - else - touch "$1.orig"; - fi; }; - _clone(){ set -e; - _backup "$2"; - cp -a "$1" "$2"; }; - _setvar(){ set -e; - _backup "$1"; - sed -i -r - -e "s,^#?($2)=.*,\\1=$3," "$1"; }; - -## improve autonomy -# auto-repair inconsistent filesystems during boot - _setvar /target/etc/default/rcS FSCKFIX yes; |