Преглед изворни кода

Now using app-shells/dash as /bin/sh. Fixed all scripts accordingly.
Build scripts should now work with any POSIX-compliant /bin/sh.

Removed gedit-plugins, as a progress towards removing python.
The only remaining packages that rely on python are wicd and youtube-dl.

Maxim Kammerer пре 14 година
родитељ
комит
4ae8209cda

+ 1 - 1
build

@@ -1,7 +1,7 @@
 #!/bin/sh -e
 
 sinfo() {
-    echo -e "\033[1;37;43m$@\033[0m"
+    echo ${BASH:+-e} "\033[1;37;43m$@\033[0m"
 }
 
 

+ 2 - 2
check

@@ -1,7 +1,7 @@
 #!/bin/sh
 
 sinfo() {
-    echo -e "\033[1;33;41m$@\033[0m"
+    echo ${BASH:+-e} "\033[1;33;41m$@\033[0m"
 }
 
 
@@ -29,7 +29,7 @@ if [ -n "${BASH}" ]; then
         done
     }
 else
-    check_shlib() { true; }
+    check_shlib() { :; }
 fi
 
 

+ 3 - 3
dist/setup.sh

@@ -19,7 +19,7 @@ You need the following installed.
     udev + sysfs  (Gentoo: sys-fs/udev)
 
 Run setup.sh as:
- 
+
     setup.sh /dev/XXX [nombr]
 
 If the optional <nombr> parameter is specified, and /dev/XXX
@@ -44,14 +44,14 @@ fi
 
 
 # Check for pre-4.x Syslinux (without the -v switch)
-if ! syslinux -v >& /dev/null; then
+if ! syslinux -v 1>/dev/null 2>&1; then
     echo "Unsupported Syslinux version detected"
     exit 1
 fi
 
 
 # Check for wrong Syslinux version (exact match required)
-havesysver=`syslinux -v |& cut -d' ' -f2`
+havesysver=`syslinux -v 2>&1 | cut -d' ' -f2`
 if [ "${havesysver}" != ${sysver} ]; then
     echo "Syslinux v${havesysver} detected, need v${sysver}"
     exit 1

+ 4 - 2
enter

@@ -1,7 +1,7 @@
 #!/bin/sh -e
 
 sinfo() {
-    echo -e "\033[1;33;41m$@\033[0m"
+    echo ${BASH:+-e} "\033[1;33;41m$@\033[0m"
 }
 
 
@@ -39,7 +39,9 @@ else
 
     # Specify permissions completely, to be independent from ${SRC}/* chmods
     sinfo "Copying configuration files:"
-    rsync -aHS -O --no-o --no-g --chmod=u=rwX,go=rX -i --exclude={/root/,/home/anon/,/mnt/hidden/,/etc/{sudoers,.auto.lock},/etc/portage/gnupg/} -C ${SRC}/ ${LIVECD}
+    rsync -aHS -O --no-o --no-g --chmod=u=rwX,go=rX -i \
+        --exclude=/root/ --exclude=/home/anon/ --exclude=/mnt/hidden/ --exclude=/etc/sudoers \
+        --exclude=/etc/.auto.lock --exclude=/etc/portage/gnupg/ -C ${SRC}/ ${LIVECD}
     rsync -aHS -O --no-o --no-g --chmod=u=rwX,go=   -i --delete-excluded -C ${SRC}/root              ${LIVECD}
     rsync -aHS -O --no-o --no-g --chmod=u=rwX,go=   -i                   -C ${SRC}/etc/portage/gnupg ${LIVECD}/etc/portage
     rsync -aHS -O --no-o --no-g --chmod=u=rwX,go=   -i --delete-excluded -C ${SRC}/mnt/hidden        ${LIVECD}/mnt

+ 1 - 1
mkdist

@@ -1,7 +1,7 @@
 #!/bin/sh -e
 
 sinfo() {
-    echo -e "\033[1;33;41m$@\033[0m"
+    echo ${BASH:+-e} "\033[1;33;41m$@\033[0m"
 }
 
 

+ 2 - 2
mkimage

@@ -1,7 +1,7 @@
 #!/bin/sh -e
 
 sinfo() {
-    echo -e "\033[1;33;41m$@\033[0m"
+    echo ${BASH:+-e} "\033[1;33;41m$@\033[0m"
 }
 
 
@@ -24,7 +24,7 @@ distname=liberte-${version}
 vfatflags=noatime,noexec,flush,iocharset=iso8859-1,utf8,umask=0133,dmask=022
 
 
-if which mksquashfs 1>/dev/null 2>&1; then
+if type mksquashfs 1>/dev/null 2>&1; then
     mksquashfs=mksquashfs
 else
     echo "SquashFS Tools not found"

+ 12 - 9
mkroot

@@ -1,7 +1,7 @@
 #!/bin/sh -e
 
 sinfo() {
-    echo -e "\033[1;33;41m$@\033[0m"
+    echo ${BASH:+-e} "\033[1;33;41m$@\033[0m"
 }
 
 
@@ -52,7 +52,7 @@ fi
 # Extract stage3 + portage snapshot to fresh directory
 if [ "$2" = fresh  -o  ! -d ${LIVECD}/src ]; then
     # Download stage3 + portage snapshot
-    mkdir -p ${LIVECD}/mirror/{stage3,portage,keys}
+    mkdir -p ${LIVECD}/mirror/stage3 ${LIVECD}/mirror/portage ${LIVECD}/mirror/keys
     mkdir -p -m 700 ${LIVECD}/mirror/gnupg
 
     # latest-stage3.txt contains YYYYMMDD/stage3-i686-YYYYMMDD.tar.bz2
@@ -63,24 +63,25 @@ if [ "$2" = fresh  -o  ! -d ${LIVECD}/src ]; then
 
     # If a new stage3 is available, remove old mirrors
     if [ ! -e ${LIVECD}/mirror/stage3/${stage3file} ]; then
-        rm -f ${LIVECD}/mirror/stage3/stage3-i686-*.tar.bz2{,.CONTENTS{,.actual},.DIGESTS.asc}
+        rm -f ${LIVECD}/mirror/stage3/stage3-i686-*.tar.bz2*
     fi
 
 
     sinfo "Downloading ${stage3file}"
-    wget -N -nv -P ${LIVECD}/mirror/stage3 ${stage3base}/${stage3}{.DIGESTS.asc,.CONTENTS,}
+    wget -N -nv -P ${LIVECD}/mirror/stage3 ${stage3base}/${stage3}.DIGESTS.asc \
+        ${stage3base}/${stage3}.CONTENTS ${stage3base}/${stage3}
 
     sinfo "Downloading portage-latest.tar.bz2"
-    wget -N -nv -P ${LIVECD}/mirror/portage ${portage}{.gpgsig,}
+    wget -N -nv -P ${LIVECD}/mirror/portage ${portage}.gpgsig ${portage}
 
 
-    if which gpg 1>/dev/null 2>&1; then
+    if type gpg 1>/dev/null 2>&1; then
         # Don't rely on the HKP outbounding port being open
         sinfo "Fetching PGP public keys and verifying fingerprints"
         for key in ${gpg_keys}; do
             org=`echo ${key} | cut -d: -f1`
             fpr=`echo ${key} | cut -d: -f2`
-            keyid=`echo ${fpr} | sed 's/.*\(.\{8,8\}\)$/\1/'`
+            keyid=`echo -n ${fpr} | tail -c 8`
 
             if [ ! -e ${LIVECD}/mirror/keys/${org}-${keyid}.asc ]; then
                 eval wget -nv -O ${LIVECD}/mirror/keys/${org}-${keyid}.asc \"${gpg_wwwserver}\"
@@ -99,7 +100,8 @@ if [ "$2" = fresh  -o  ! -d ${LIVECD}/src ]; then
         gpg -q --homedir ${LIVECD}/mirror/gnupg --trust-model always \
             --verify ${LIVECD}/mirror/stage3/${stage3file}.DIGESTS.asc
         gpg -q --homedir ${LIVECD}/mirror/gnupg --trust-model always \
-            --verify ${LIVECD}/mirror/portage/portage-latest.tar.bz2{.gpgsig,}
+            --verify ${LIVECD}/mirror/portage/portage-latest.tar.bz2.gpgsig \
+                     ${LIVECD}/mirror/portage/portage-latest.tar.bz2
     else
         sinfo "GnuPG not found, skipping signatures verification"
     fi
@@ -113,7 +115,8 @@ if [ "$2" = fresh  -o  ! -d ${LIVECD}/src ]; then
     if tar --version | grep -q '(GNU tar)'; then
         sinfo "Verifying stage3 files list"
         LC_ALL=C tar --utc -tjvf ${LIVECD}/mirror/stage3/${stage3file} > ${LIVECD}/mirror/stage3/${stage3file}.CONTENTS.actual
-        cmp -s ${LIVECD}/mirror/stage3/${stage3file}.CONTENTS{,.actual}
+        cmp -s ${LIVECD}/mirror/stage3/${stage3file}.CONTENTS \
+               ${LIVECD}/mirror/stage3/${stage3file}.CONTENTS.actual
     else
         sinfo "GNU tar not found, skipping stage3 files list verification"
     fi

+ 1 - 0
rootfs.excludes

@@ -115,6 +115,7 @@
 /etc/sgml/
 /var/run/bootstrap-progress
 /usr/lib/cracklib_dict.*
+/usr/sbin/libpng-*-update.sh
 /mnt/floppy/
 /mnt/cdrom/
 # (GeoIP is not used in Tor setup)

+ 2 - 1
src/etc/conf.d/smartd

@@ -1,2 +1,3 @@
+# -q never: don't fail if no SMART-capable devices
 # -i [s]: check interval (low, but have -n standby in smartd.conf)
-SMARTD_OPTS="-i 300"
+SMARTD_OPTS="-q never -i 300"

+ 2 - 2
src/etc/init.d/liberte

@@ -83,8 +83,8 @@ start() {
     eend $?
 
 
-    # Limit console logging
-    ebegin Reducing console logging level
+    # Limit dmesg console logging
+    ebegin Reducing kernel console logging level
     dmesg -n 4  &&  truncate -s 0 /var/log/dmesg
     eend $?
 

+ 2 - 2
src/etc/make.conf

@@ -38,8 +38,8 @@ USE="aac acpi alsa archive aspell bidi bluetooth bs2b caps cdda charmap cjk
 
 USE="${USE} -berkdb -cddb -cracklib -cups -cxx -dirac -encode -fts3 -gdbm
      -git -hunspell -lcms -live -lvm1 -mng -mudflap -openmp -pcre -perl
-     -pm-utils -python -recode -schroedinger -sqlite -ssl -static -tcpd
-     -tremor -xpdf-headers -xscreensaver -zeroconf"
+     -pm-utils -python -recode -schroedinger -session -sqlite -ssl -static
+     -tcpd -tremor -xpdf-headers -xscreensaver -zeroconf"
 
 # X11
 INPUT_DEVICES="${INPUT_DEVICES} synaptics"

+ 0 - 1
src/etc/portage/package.use

@@ -56,7 +56,6 @@ gnome-base/librsvg              tools                # (used by bin/gen-wallpape
 app-text/poppler                cairo
 app-arch/p7zip                  rar
 app-office/abiword              plugins
-app-editors/gedit               python               # gedit-plugins
 # app-portage/eix               sqlite
 
 # Internationalization

+ 2 - 2
src/home/anon/bin/gen-anon-hostname

@@ -18,8 +18,8 @@ mkdir ${tordir}
 
 
 # Key generation can be lengthy, set some traps
-trap 'rm -f ${HOME}/.rnd' EXIT
-trap 'rm -r ${tordir}'    ERR INT QUIT TERM SEGV
+trap 'if [ $? != 0 ]; then rm -r ${tordir}; fi;  rm -f ${HOME}/.rnd' 0
+trap : INT QUIT TERM SEGV
 
 
 # Generate RSA-1024 with exponent 65537, as per spec

+ 2 - 2
src/home/anon/bin/gen-anon-username

@@ -25,8 +25,8 @@ mkdir ${certdir} ${keysdir}
 
 
 # Key generation can be lengthy, set some traps
-trap 'rm -f ${HOME}/.rnd'          EXIT
-trap 'rm -r ${certdir} ${keysdir}' ERR INT QUIT TERM SEGV
+trap 'if [ $? != 0 ]; then rm -r ${certdir} ${keysdir}; fi;  rm -f ${HOME}/.rnd' 0
+trap : INT QUIT TERM SEGV
 
 
 # Generate RSA key + X.509 self-signed root CA certificate

+ 5 - 4
src/home/anon/bin/gen-wallpaper

@@ -1,17 +1,18 @@
-#!/bin/sh
+#!/bin/sh -e
 
 dir=${HOME}/config/images
 
-height=$(xwininfo -root | grep '^  Height:' | sed 's/^  Height: //')
+height=`xwininfo -root | sed -n 's/^  Height: //p'`
 wheight=${height}
 
 # Wait for the taskbar to come up
 while [ ${height} = ${wheight} ]; do
     sleep 1
     if xprop -root _NET_WORKAREA | grep -q =; then
-        wheight=$(xprop -root '=$3' _NET_WORKAREA | sed 's/.*=//')
+        wheight=`xprop -root '=$3' _NET_WORKAREA | cut -d= -f2`
     fi
 done
 
-size=$(qalc -t "$(xprop -root '=round(min($2-$0, $3-$1\) * 2/3\)\n' _NET_WORKAREA | sed 's/.*=//')")
+calc=`xprop -root '=round(min($2-$0, $3-$1\) * 2/3\)' _NET_WORKAREA | cut -d= -f2`
+size=`qalc -t "${calc}"`
 rsvg-convert -h ${size} -o ${dir}/liberte-logo-wallpaper.png ${dir}/liberte-logo-nofont.svg

+ 0 - 6
src/home/anon/config/gtk-2.0/gconf/apps/gedit-2/plugins/%gconf.xml

@@ -4,9 +4,6 @@
 		<li type="string">
 			<stringvalue>changecase</stringvalue>
 		</li>
-		<li type="string">
-			<stringvalue>charmap</stringvalue>
-		</li>
 		<li type="string">
 			<stringvalue>docinfo</stringvalue>
 		</li>
@@ -19,9 +16,6 @@
 		<li type="string">
 			<stringvalue>quickopen</stringvalue>
 		</li>
-		<li type="string">
-			<stringvalue>showtabbar</stringvalue>
-		</li>
 		<li type="string">
 			<stringvalue>sort</stringvalue>
 		</li>

+ 0 - 4
src/home/anon/config/gtk-2.0/gconf/apps/gedit-2/preferences/editor/bracket_matching/%gconf.xml

@@ -1,4 +0,0 @@
-<?xml version="1.0"?>
-<gconf>
-	<entry name="bracket_matching" mtime="1263298818" type="bool" value="true"/>
-</gconf>

+ 1 - 1
src/root/bin/poweroff-watchdog

@@ -26,7 +26,7 @@ fi
 # Copy the executables to RAM
 # (the executables depend only on libc)
 ramdir=`mktemp -d --tmpdir=/dev/shm`
-cp --preserve=all /sbin/poweroff ${ramdir}
+cp -aH /sbin/poweroff ${ramdir}
 
 # Prevent possible access to locale files
 export LC_ALL=C

+ 1 - 1
src/root/setup

@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/bash -e
 
 hsversion=`cat ${HOME}/config/kversion`
 kversion=`echo ${hsversion} | sed s/-/-hardened-/`

+ 7 - 1
src/root/setup-copy

@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/bash -e
 
 sinfo() {
     echo -e "\033[1;33;41m$@\033[0m"
@@ -216,6 +216,7 @@ rm /etc/env.d/05gcc-i686-pc-linux-gnu
 rm -rf /etc/env.d/{binutils,gcc}
 
 rm /usr/bin/{{i686-pc-linux-gnu-,}{gcc,g++,c++,cpp},cc,gcov}
+rm /sbin/fix_libtool_files.sh
 
 rm /usr/bin/{kernel,profile}-config
 rm /usr/share/eselect/modules/{binutils,kernel,news,profile}.eselect
@@ -230,6 +231,11 @@ sinfo "Updating init scripts dependencies cache"
 depscan.sh
 
 
+sinfo "Setting dash as /bin/sh"
+ln -sf dash /bin/sh
+sed -i 's:^#!/bin/sh$:#!/bin/bash:' /lib/udev/move_tmp_persistent_rules.sh
+
+
 sinfo "Saving current packages list in /tmp/packages-list"
 find /var/db/pkg/ -mindepth 2 -maxdepth 2 -type d \
     | sed 's:^/var/db/pkg/::'| sort > /tmp/packages-list

+ 1 - 1
src/sbin/iwconfig.wrapper

@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/bin/bash -e
 
 # The reason for this wrapper is that
 # /usr/share/laptop-mode-tools/modules/wireless-*-power

+ 3 - 2
src/var/lib/portage/world

@@ -55,7 +55,8 @@ sys-fs/ntfsprogs
 sys-fs/dosfstools
 net-fs/autofs
 
-# Security utilities
+# System / security utilities
+app-shells/dash
 app-admin/metalog
 app-admin/sudo
 sys-apps/paxctl
@@ -113,7 +114,7 @@ media-sound/aumix
 media-sound/audacious
 media-video/gnome-mplayer
 media-gfx/gpicview
-app-editors/gedit-plugins
+app-editors/gedit
 app-text/epdfview
 app-office/abiword
 app-office/gnumeric

+ 1 - 1
src/var/tmp/ebuilds/udev-watchdog.c

@@ -46,7 +46,7 @@ static int print_device(struct udev_device *device, const char *f_action, const
 {
 	struct timeval  tv;
 	struct timezone tz;
-    
+
     const  char *action  = udev_device_get_action(device);
     const  char *devpath = udev_device_get_devpath(device);
     size_t f_len, d_len;