# HG changeset patch # User Aleksej Bobylev # Date 1443841882 -10800 # Node ID 27d55e263e2d59bd30cc2825b35349b68820cb0d # Parent b8e624e9b721258b0ac4707ef96f0126c3648c0a bash: fix ~/.bashrc creation, etc.; dia: fix icons packaging (thanks llev for reports) diff -r b8e624e9b721 -r 27d55e263e2d bash/receipt --- a/bash/receipt Fri Oct 02 13:31:38 2015 +0200 +++ b/bash/receipt Sat Oct 03 06:11:22 2015 +0300 @@ -14,6 +14,7 @@ BASHCHECK="$(basename $BASHCHECKURL)" BASHPATCHES="$(for i in $(seq 1 ${VERSION##*.}); do printf "bash${BASEVERSION/./}-%03d " $i; done)" EXTRA_SOURCE_FILES="$BASHCHECK $BASHPATCHES" +TAGS="shell" DEPENDS="readline" BUILD_DEPENDS="readline bison wget texinfo" @@ -89,32 +90,32 @@ post_install() { - echo "Processing post-install commands..." - echo -n "Do you want to set Bash to default (y/N) ? : " - read -t 30 anser - if [ "$anser" == "y" ]; then - echo "" - echo "Setting bash as default for all users" - sed -i "s/:\/bin\/sh$/:\/bin\/bash/g" $1/etc/passwd - sed -i "s/:\/bin\/ksh$/:\/bin\/bash/g" $1/etc/passwd - sed -i "s/:\/bin\/zsh$/:\/bin\/bash/g" $1/etc/passwd - sed -i "s/:\/bin\/csh$/:\/bin\/bash/g" $1/etc/passwd - echo "Creating .bashrc file for all users" - for i in `ls -d $1/home/*` - do - cp $1/etc/bashrc $1$i/.bashrc - done - cp $1/etc/bashrc $1/root/.bashrc - cp $1/etc/bashrc $1/etc/skel/.bashrc - fi + cp -a "$1/etc/bashrc" "$1/etc/skel/.bashrc" + + # Exit function in non-interactive mode (when user can't answer question) + tty -s || return + + echo -n 'Do you want to set Bash to default (y/N) ? : ' + read -t 30 answer + [ "$answer" == 'y' ] || return + + echo + echo 'Setting bash as default shell for all users' + sed -i 's|:/bin/[ckz]*sh$|:/bin/bash|' "$1/etc/passwd" + + echo 'Creating ~/.bashrc file for all users' + for i in $(awk -F: '$7=="/bin/bash"{print $6}' "$1/etc/passwd"); do + [ -e "$1$i/.bashrc" ] && continue + cp "$1/etc/bashrc" "$1$i/.bashrc" + chown $(stat -c%U:%G "$1$i") "$1$i/.bashrc" + done } pre_remove() { - echo "Setting back sh as default for all users" - sed -i "s/:\/bin\/bash$/:\/bin\/sh/g" $1/etc/passwd - if [ -f $1/etc/skel/.bashrc ]; then - rm $1/etc/skel/.bashrc - fi + echo + echo 'Setting sh as default shell for all users' + sed -i 's|:/bin/bash$|:/bin/sh|' "$1/etc/passwd" + [ -f "$1/etc/skel/.bashrc" ] && rm "$1/etc/skel/.bashrc" } diff -r b8e624e9b721 -r 27d55e263e2d dia/receipt --- a/dia/receipt Fri Oct 02 13:31:38 2015 +0200 +++ b/dia/receipt Sat Oct 03 06:11:22 2015 +0300 @@ -20,7 +20,6 @@ # Rules to configure and make the package. compile_rules() { - cd $src find . -name '*.[ch]*' | xargs sed -i 's||&\n#include |' plug-ins/vdx/vdx-export.c patch -Np1 -i $stuff/dia-overflow-fix.patch @@ -35,17 +34,15 @@ # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { - mkdir -p $fs/usr/lib $fs/usr/share/locale - cp -a $install/usr/lib/dia $fs/usr/lib + mkdir -p $fs/usr/lib/dia $fs/usr/share + + cp -a $install/usr/bin $fs/usr + cp -a $install/usr/lib/dia/*.so $fs/usr/lib/dia + cp -a $install/usr/share/applications $fs/usr/share cp -a $install/usr/share/dia $fs/usr/share + cp -a $install/usr/share/icons $fs/usr/share + rm -r $fs/usr/share/icons/hicolor/scalable +# cp -a $install/usr/share/locale $fs/usr/share + cp -a $install/usr/share/mime-info $fs/usr/share cp -a $install/usr/share/oaf $fs/usr/share - #cp -a $install/usr/share/omf $fs/usr/share - cp -a $install/usr/share/locale/de $fs/usr/share/locale - cp -a $install/usr/share/locale/fr $fs/usr/share/locale - #cp -a $install/usr/share/help $fs/usr/share - cp -a $install/usr/share/applications $fs/usr/share - cp -a $install/usr/share/mime-info $fs/usr/share - cp -a $install/usr/share/icons/hicolor/16x16/apps/dia.png $fs/usr/share/pixmaps - cp -a $install/usr/bin $fs/usr } -