diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-02-27 17:17:36 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-02-27 17:17:36 +0000 |
commit | 8a4435f71a8a47e9cf3050ad6456cd9949da5958 (patch) | |
tree | 04fcc00d75ad0e8a8ad3f369688e6c833621c1b4 | |
parent | c5fc68fa232e88ec3e5e40aaec619280554886a9 (diff) | |
download | morph-8a4435f71a8a47e9cf3050ad6456cd9949da5958.tar.gz |
Make ./check check for long lines (with excptions); fix long lines
-rwxr-xr-x | baserock-bootstrap | 31 | ||||
-rwxr-xr-x | check | 14 | ||||
-rwxr-xr-x | mkimage.sh | 4 | ||||
-rw-r--r-- | morphlib/buildcontroller.py | 2 | ||||
-rw-r--r-- | morphlib/builddependencygraph.py | 8 | ||||
-rw-r--r-- | morphlib/builder.py | 3 | ||||
-rwxr-xr-x | run-bootstrap-in-chroot | 2 | ||||
-rwxr-xr-x | tests/missing-ref.script | 3 | ||||
-rwxr-xr-x | tests/show-dependencies.setup | 7 |
9 files changed, 50 insertions, 24 deletions
diff --git a/baserock-bootstrap b/baserock-bootstrap index b04b9bc3..f2148b5b 100755 --- a/baserock-bootstrap +++ b/baserock-bootstrap @@ -77,10 +77,12 @@ pass1_directories() [ -e "$LFS/sys" ] || $HOST_MKDIR -p "$LFS/sys" [ -e "$LFS/tmp" ] || $HOST_MKDIR -p "$LFS/tmp" [ -e "$LFS/dev" ] || $HOST_MKDIR -p "$LFS/dev" - [ -e "$LFS/dev/console" ] || $HOST_SUDO mknod -m 600 "$LFS/dev/console" c 5 1 + [ -e "$LFS/dev/console" ] || \ + $HOST_SUDO mknod -m 600 "$LFS/dev/console" c 5 1 [ -e "$LFS/dev/null" ] || $HOST_SUDO mknod -m 666 "$LFS/dev/null" c 1 3 [ -e "$LFS/dev/random" ] || $HOST_SUDO mknod -m 644 "$LFS/dev/random" c 1 8 - [ -e "$LFS/dev/urandom" ] || $HOST_SUDO mknod -m 644 "$LFS/dev/urandom" c 1 9 + [ -e "$LFS/dev/urandom" ] || \ + $HOST_SUDO mknod -m 644 "$LFS/dev/urandom" c 1 9 } @@ -169,8 +171,6 @@ pass1_eglibc() $HOST_MKDIR "$sources/eglibc-build" cd "$sources/eglibc-build" - #echo "CFLAGS += -O2 -U_FORTIFY_SOURCE -fno-stack-protector" > configparms - case `uname -m` in i?86) echo "CFLAGS += -march=i486 -mtune=native" >> configparms ;; esac @@ -275,11 +275,12 @@ pass1_gcc_2() patch -Np1 -i ../gcc-4.6.1-startfiles_fix-1.patch cp -v gcc/Makefile.in{,.orig} - $HOST_SED 's@\./fixinc\.sh@-c true@' gcc/Makefile.in.orig > gcc/Makefile.in + $HOST_SED 's@\./fixinc\.sh@-c true@' gcc/Makefile.in.orig \ + > gcc/Makefile.in cp -v gcc/Makefile.in{,.tmp} - $HOST_SED 's/^T_CFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in.tmp \ - > gcc/Makefile.in + $HOST_SED 's/^T_CFLAGS =$/& -fomit-frame-pointer/' \ + gcc/Makefile.in.tmp > gcc/Makefile.in for file in \ $(find gcc/config -name linux64.h -o -name linux.h -o -name sysv4.h) @@ -764,7 +765,8 @@ EOF fi # $HOST_MKDIR -p "$LFS/etc" - [ -e "$LFS/etc/passwd" ] || echo 'root::0:0:root:/root:/bin/bash' > "$LFS/etc/passwd" + [ -e "$LFS/etc/passwd" ] || \ + echo 'root::0:0:root:/root:/bin/bash' > "$LFS/etc/passwd" [ -e "$LFS/etc/group" ] || echo 'root::0:' > "$LFS/etc/group" # [ -e "$LFS/etc/hostname" ] || echo 'baserock-boot' | @@ -774,9 +776,11 @@ EOF # These are needed for #! lines in scripts [ -e "$LFS/bin" ] || $HOST_MKDIR -p "$LFS/bin" [ -e "$LFS/bin/sh" ] || $HOST_SUDO ln -sf ../tools/bin/bash "$LFS/bin/sh" - [ -e "$LFS/bin/bash" ] || $HOST_SUDO ln -sf ../tools/bin/bash "$LFS/bin/bash" + [ -e "$LFS/bin/bash" ] || \ + $HOST_SUDO ln -sf ../tools/bin/bash "$LFS/bin/bash" [ -e "$LFS/bin/pwd" ] || $HOST_SUDO ln -sf ../tools/bin/pwd "$LFS/bin/pwd" - [ -e "$LFS/bin/echo" ] || $HOST_SUDO ln -sf ../tools/bin/echo "$LFS/bin/echo" + [ -e "$LFS/bin/echo" ] || \ + $HOST_SUDO ln -sf ../tools/bin/echo "$LFS/bin/echo" if [ ! -e "$LFS/usr/bin/perl" ]; then $HOST_MKDIR -p $LFS/usr/bin $HOST_SUDO ln -sf ../../tools/bin/perl "$LFS/usr/bin/perl" @@ -903,7 +907,9 @@ pass2_build_devel_system_outside_chroot() $HOST_SUDO parted -s "$img" mkpart primary 0% 100% $HOST_SUDO parted -s "$img" set 1 boot on $HOST_SUDO install-mbr "$img" - part=/dev/mapper/$($HOST_SUDO kpartx -av "$img" | awk '/^add map/ { print $3 }' | head -n1) + part=/dev/mapper/$($HOST_SUDO kpartx -av "$img" | + awk '/^add map/ { print $3 }' | + head -n1) trap "$HOST_SUDO kpartx -dv $img" INT TERM EXIT # mapper may not yet be ready while test ! -e "$part"; do :; done @@ -912,7 +918,8 @@ pass2_build_devel_system_outside_chroot() $HOST_SUDO mount "$part" "$mp" trap "$HOST_SUDO umount $part; $HOST_SUDO kpartx -dv $img" INT TERM EXIT - for stratum in "$LFS"/baserock/cache/*.stratum.{foundation,linux-stratum,devel} + for stratum in \ + "$LFS"/baserock/cache/*.stratum.{foundation,linux-stratum,devel} do $HOST_SUDO tar -C "$mp" -xf "$stratum" done @@ -27,7 +27,7 @@ then echo "Checking copyright statements" git ls-files | xargs scripts/check-copyright-year - echo 'Checking source code for TAB characters' + echo 'Checking source code for silliness' git ls-files | grep -v '\.gz$' | while read x @@ -37,6 +37,18 @@ then echo "ERROR: $x contains TAB characters" 1>&2 errors=1 fi + + case "$x" in + wget-list|baserock-bootstrap) + ;; + *) + if awk 'length > 79' "$x" | grep . > /dev/null + then + echo "ERROR: $x has lines longer than 79 chars" 1>&2 + errors=1 + fi + ;; + esac done fi exit $errors @@ -19,7 +19,9 @@ sudo parted -s "$img" mklabel msdos sudo parted -s "$img" mkpart primary 0% 100% sudo parted -s "$img" set 1 boot on sudo install-mbr "$img" -part=/dev/mapper/$(sudo kpartx -av "$img" | awk '/^add map/ { print $3 }' | head -n1) +part=/dev/mapper/$(sudo kpartx -av "$img" | + awk '/^add map/ { print $3 }' | + head -n1) trap "sudo kpartx -dv $img" EXIT # mapper may not yet be ready while test ! -e "$part"; do :; done diff --git a/morphlib/buildcontroller.py b/morphlib/buildcontroller.py index 091f575f..fdc6c5e0 100644 --- a/morphlib/buildcontroller.py +++ b/morphlib/buildcontroller.py @@ -51,7 +51,7 @@ class BuildController(object): self.workers.add(worker) self.mark_idle(worker) - def wait_for_workers(self, need_idle=False, timeout=0.1): # pragma: no cover + def wait_for_workers(self, need_idle=False,timeout=0.1): # pragma: no cover # first, check if any of the busy workers are finished while all([not x.check_complete(timeout) for x in self.busy_workers]): # wait and repeat if they are all busy and we have no idle workers diff --git a/morphlib/builddependencygraph.py b/morphlib/builddependencygraph.py index 7908c660..b75eab84 100644 --- a/morphlib/builddependencygraph.py +++ b/morphlib/builddependencygraph.py @@ -169,7 +169,8 @@ class BuildDependencyGraph(object): # pragma: no cover chunk = self.get_blob(treeish, filename) chunk.add_parent(stratum) - # store (name -> chunk) association to avoid loading the chunk twice + # store (name -> chunk) association to avoid loading the chunk + # twice name_to_chunk[source['name']] = chunk # read the build-depends information @@ -189,8 +190,9 @@ class BuildDependencyGraph(object): # pragma: no cover dependency = name_to_chunk[depname] chunk.add_dependency(dependency) else: - raise Exception('%s: source %s references %s before it ' - 'is defined' % (stratum.morph.filename, + raise Exception('%s: source %s references %s before ' + 'it is defined' % + (stratum.morph.filename, source['name'], depname)) else: diff --git a/morphlib/builder.py b/morphlib/builder.py index 3a46cf54..9b55e01f 100644 --- a/morphlib/builder.py +++ b/morphlib/builder.py @@ -491,7 +491,8 @@ class SystemBuilder(BlobBuilder): self.ex.runv(['parted', '-s', image_name, 'mklabel', 'msdos']) self.ex.runv(['parted', '-s', image_name, 'mkpart', 'primary', '0%', '100%']) - self.ex.runv(['parted', '-s', image_name, 'set', '1', 'boot', 'on']) + self.ex.runv(['parted', '-s', image_name, + 'set', '1', 'boot', 'on']) # Install first stage boot loader into MBR. with self.build_watch('install-mbr'): diff --git a/run-bootstrap-in-chroot b/run-bootstrap-in-chroot index fe80f3c5..7293e26d 100755 --- a/run-bootstrap-in-chroot +++ b/run-bootstrap-in-chroot @@ -134,8 +134,6 @@ if [ "x$LFS_MIRROR" = x ]; then cp wget-list "$dir/wget-list" else perl -M'Env' -lpe 's|^.*/|$LFS_MIRROR|' wget-list >"$dir/wget-list" - #gawk -v m="$LFS_MIRROR" '{gsub(/^.*\//, m)}; 1' wget-list >"$dir/wget-list" - #sed "s,^.*/,$LFS_MIRROR," wget-list > "$dir/wget-list" fi diff --git a/tests/missing-ref.script b/tests/missing-ref.script index 1b4ed98d..f37caccc 100755 --- a/tests/missing-ref.script +++ b/tests/missing-ref.script @@ -21,7 +21,8 @@ cache="$DATADIR/build-chunk-cache" ./morph --no-default-configs build chunk-repo non-existent-branch hello.morph \ --git-base-url="file://$DATADIR" \ - --cachedir="$cache" --keep-path --no-distcc 2> "$DATADIR/build-chunk-cache.stderr" + --cachedir="$cache" --keep-path --no-distcc \ + 2> "$DATADIR/build-chunk-cache.stderr" err=$? cat "$DATADIR/build-chunk-cache.stderr" | sed "s%$DATADIR%%" 1>&2 exit $err diff --git a/tests/show-dependencies.setup b/tests/show-dependencies.setup index bef69c12..e37a8572 100755 --- a/tests/show-dependencies.setup +++ b/tests/show-dependencies.setup @@ -49,7 +49,8 @@ EOF git add hello.c # Define a couple of chunk morphologies for the GTK stack -gtkcomponents=(freetype fontconfig cairo pango glib gdk-pixbuf gtk dbus-glib dbus) +gtkcomponents=(freetype fontconfig cairo pango glib gdk-pixbuf gtk + dbus-glib dbus) for component in "${gtkcomponents[@]}" do cat <<EOF > $component.morph @@ -168,7 +169,9 @@ EOF git add hello.c # Define a couple of chunk morphologies for the GTK stack -xfcecomponents=(xfce4-dev-tools libxfce4util libxfce4ui exo xfconf garcon thunar tumbler xfce4-panel xfce4-settings xfce4-session xfwm4 xfdesktop xfce4-appfinder gtk-xfce-engine) +xfcecomponents=(xfce4-dev-tools libxfce4util libxfce4ui exo xfconf garcon + thunar tumbler xfce4-panel xfce4-settings xfce4-session + xfwm4 xfdesktop xfce4-appfinder gtk-xfce-engine) for component in "${xfcecomponents[@]}" do cat <<EOF > $component.morph |