diff options
-rwxr-xr-x | bin/pkglist2preseed | 4 | ||||
-rw-r--r-- | tweaks/base | 89 | ||||
-rw-r--r-- | tweaks/desktop | 21 |
3 files changed, 74 insertions, 40 deletions
diff --git a/bin/pkglist2preseed b/bin/pkglist2preseed index b0d7902..0ff94c5 100755 --- a/bin/pkglist2preseed +++ b/bin/pkglist2preseed @@ -32,9 +32,9 @@ foreach (@tweakfiles) { grep { chomp } @tweaklines; grep { s/^[#]{1} (.*)/# * $1/ } @tweaklines; grep { s/^[#]{2} (.*)/# $1/ } @tweaklines; +grep { /^[^#]/ and s/(?<!;)$/ / } @tweaklines; $tweakdesc = join "\n", grep { /^[#] / } @tweaklines; -$tweaklist = join ";", grep { s/^(?!#)\s*(.+)/$1/ } @tweaklines; -$tweaklist .= ';'; +$tweaklist = join "\\\n", grep { /^[^#]/ } @tweaklines; my $pkglist = join( ' ', @pkg ); diff --git a/tweaks/base b/tweaks/base index 9c2811d..2e2ceee 100644 --- a/tweaks/base +++ b/tweaks/base @@ -1,38 +1,67 @@ ## tidy loose ends -set -e +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;s/^\|//;s/([.+-])/\\\1/g;s/\|$//'; } -_pkgreal(){ set -e - chroot /target dpkg-query -Wf='${Package},${Provides},\n'|sed -r "/,,/d;s/^([a-z0-9.+-]+).*[,|] *($(_pkg2re $*))[ :,]/\1/;/,/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 's/\s+/\n/g'|sort -u; } -essentials=$(chroot /target dpkg-query -Wf='${Package}%${Essential}\n'|sed -r 's/(.*)%yes/\1/;/%/d') -chroot /target apt-mark auto $(_pkganddeepdeps $essentials apt linux-image-*) + _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 + 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 - [ -e "$1.orig" ] || if [ -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"; } + _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 + _setvar /target/etc/default/rcS FSCKFIX yes; diff --git a/tweaks/desktop b/tweaks/desktop index 5cfd3a8..816ca23 100644 --- a/tweaks/desktop +++ b/tweaks/desktop @@ -1,18 +1,23 @@ ## power management # sleep when lid is closed, and modernize logic of radio on/off button -_setvar /target/etc/default/acpi-support LID_SLEEP true -_setvar /target/etc/default/acpi-support WIRELESS_BLUETOOTH_SYNC true + _setvar /target/etc/default/acpi-support LID_SLEEP true; + _setvar /target/etc/default/acpi-support WIRELESS_BLUETOOTH_SYNC true; ## Xfce -cd /target/etc/xdg/xfce4/xfconf/xfce-perchannel-xml + cd /target/etc/xdg/xfce4/xfconf/xfce-perchannel-xml; # silence confusing panel question at initial login -_clone ../../panel/default.xml xfce4-panel.xml + _clone ../../panel/default.xml xfce4-panel.xml; # replace appfinder with mail-reader in default panel -sed -i -r -e 's,xfce4-appfinder,exo-mail-reader,' xfce4-panel.xml + sed -i -r + -e 's,xfce4-appfinder,exo-mail-reader,' + xfce4-panel.xml; # disable storing session at logout by default -_backup xfce4-session.xml -sed -i -r -e 's,(<property name="general"[^>]*>),\1\n <property name="SaveOnExit" type="bool" value="false"/>,' xfce4-session.xml + _backup xfce4-session.xml; + sed -i -r + -e 's,(<property name="general"[^>]*>),\1\n <property name="SaveOnExit" type="bool" value="false"/>,' + xfce4-session.xml; ## upgrade cleanup # fix mark auto-installed recommended packages previously excluded -chroot /target apt-mark auto evolution-data-server gvfs libvisual-0.4-plugins libwebkitgtk-1.0-0 + chroot /target apt-mark auto + evolution-data-server gvfs libvisual-0.4-plugins libwebkitgtk-1.0-0; |