lgp: hooks cleanup (closes: #77358)

Hooks: * new D10tmp hook which correct TMPDIR assignment * remove unecessary hooks (B01ls, F20x11, D70results, C00msg) * enable verbose mode (B89diffstat, B90lintian, B91debc) * install decent editor when logging in (F01shell) * quiet some uninformative output (F99apt, E01logilab)

Pbuilder config: * drop useless BUILDPLACE redefinition (because pbuilder will always define it)

authorJulien Jehannet <julien.jehannet@logilab.fr>
changesetb66df1a66004
branchdefault
phasepublic
hiddenno
parent revision#59f17b849c01 lgp: set APTCACHEHARDLINK to "no" if BUILDPLACE is a mountpoint (closes: #76639)
child revision#fa8bb2c8077a backport stable
files modified by this revision
etc/lgp/hooks/B01ls
etc/lgp/hooks/B89diffstat
etc/lgp/hooks/B90lintian
etc/lgp/hooks/B91debc
etc/lgp/hooks/C00msg
etc/lgp/hooks/D10tmp
etc/lgp/hooks/D70results
etc/lgp/hooks/E01logilab
etc/lgp/hooks/F00env
etc/lgp/hooks/F01shell
etc/lgp/hooks/F20x11
etc/lgp/hooks/F99apt
etc/lgp/pbuilderrc.sh
# HG changeset patch
# User Julien Jehannet <julien.jehannet@logilab.fr>
# Date 1308330108 -7200
# Fri Jun 17 19:01:48 2011 +0200
# Node ID b66df1a6600456e332f0de0024e7f7486edf15ba
# Parent 59f17b849c016752bd4cf8c900b89596c5841372
lgp: hooks cleanup (closes: #77358)

Hooks:
* new D10tmp hook which correct TMPDIR assignment
* remove unecessary hooks (B01ls, F20x11, D70results, C00msg)
* enable verbose mode (B89diffstat, B90lintian, B91debc)
* install decent editor when logging in (F01shell)
* quiet some uninformative output (F99apt, E01logilab)

Pbuilder config:
* drop useless BUILDPLACE redefinition (because pbuilder will always define it)

diff --git a/etc/lgp/hooks/B01ls b/etc/lgp/hooks/B01ls
@@ -1,3 +0,0 @@
1 -#!/bin/sh
2 -
3 -ls -la $HOME/
diff --git a/etc/lgp/hooks/B89diffstat b/etc/lgp/hooks/B89diffstat
@@ -1,6 +1,6 @@
4 -#!/bin/sh
5 +#!/bin/sh -x
6 
7  # Debian specific diff statistics
8  apt-get install -y --force-yes diffstat >/dev/null 2>&1
9 
10  diffstat $HOME/*.diff.gz 2>/dev/null
diff --git a/etc/lgp/hooks/B90lintian b/etc/lgp/hooks/B90lintian
@@ -1,6 +1,6 @@
11 -#!/bin/sh
12 +#!/bin/sh -x
13 
14  # run lintian on generated changes files
15  apt-get install -y --force-yes lintian >/dev/null 2>&1
16 
17  # hardcoded here since it's a current practise to build for different releases (as codenames)
diff --git a/etc/lgp/hooks/B91debc b/etc/lgp/hooks/B91debc
@@ -1,6 +1,6 @@
18 -#!/bin/sh
19 +#!/bin/sh -x
20 
21  # raise an error if a file is missing
22  set -e
23 
24  # run debc on generated changes files
diff --git a/etc/lgp/hooks/C00msg b/etc/lgp/hooks/C00msg
@@ -1,8 +0,0 @@
25 -#!/bin/bash
26 -
27 -. /tmp/hooks/lgp.functions
28 -
29 -printf "\a"
30 -echo
31 -eprint_hook "Sorry, the build process failed for '$(basename "$SUDO_COMMAND" .dsc)' in '$DIST/$ARCH' image !"
32 -echo
diff --git a/etc/lgp/hooks/D10tmp b/etc/lgp/hooks/D10tmp
@@ -0,0 +1,17 @@
33 +#!/bin/bash
34 +
35 +# Notes on usage of $TMPDIR
36 +# http://www.netfort.gr.jp/~dancer/software/pbuilder-doc/pbuilder-doc.html#tmpdir
37 +
38 +# If you are setting $TMPDIR to an unusual value, of other than /tmp, you will
39 +# find that some errors may occur inside the chroot, such as dpkg-source
40 +# failing.
41 +
42 +# There are two options, you may install a hook to create that directory, or
43 +# set 'export TMPDIR=/tmp' in pbuilderrc. Take your pick.
44 +
45 +# from example script provided as examples/D10tmp with pbuilder
46 +# create $TMP and $TMPDIR
47 +[ -n "$TMP" -a ! -d "$TMP" ] && mkdir -p "$TMP" || true
48 +[ -n "$TMPDIR" -a ! -d "$TMPDIR" ] && mkdir -p "$TMPDIR" || true
49 +
diff --git a/etc/lgp/hooks/D70results b/etc/lgp/hooks/D70results
@@ -1,6 +0,0 @@
50 -#!/bin/sh
51 -
52 -# See http://www.netfort.gr.jp/~dancer/software/pbuilder-doc/pbuilder-doc.html#usingspecialaptsources
53 -
54 -#cd $RESULTDIR
55 -#/usr/bin/dpkg-scanpackages . /dev/null > $RESULTDIR/Packages
diff --git a/etc/lgp/hooks/E01logilab b/etc/lgp/hooks/E01logilab
@@ -3,6 +3,6 @@
56  # repository is not always existing for all images
57  # consider index files as optional and exit with error status
58  set +e
59 
60  apt-get install -y --force-yes wget >/dev/null 2>&1
61 -wget -q http://download.logilab.org/logilab-dists-key.asc  -O - | apt-key add -
62 +wget -q http://download.logilab.org/logilab-dists-key.asc  -O - | apt-key add - > /dev/null
diff --git a/etc/lgp/hooks/F00env b/etc/lgp/hooks/F00env
@@ -1,5 +1,3 @@
63  #!/bin/sh
64 
65 -echo
66  env | sort
67 -echo
diff --git a/etc/lgp/hooks/F01shell b/etc/lgp/hooks/F01shell
@@ -0,0 +1,3 @@
68 +#!/bin/sh
69 +
70 +apt-get install -y --force-yes vim >/dev/null 2>&1
diff --git a/etc/lgp/hooks/F20x11 b/etc/lgp/hooks/F20x11
@@ -1,5 +0,0 @@
71 -#!/bin/sh
72 -
73 -if [ -f "$RESULTDIR/.Xauthority" ]; then
74 -	export XAUTHORITY="$RESULTDIR/.Xauthority"
75 -fi
diff --git a/etc/lgp/hooks/F99apt b/etc/lgp/hooks/F99apt
@@ -1,3 +1,3 @@
76 -#!/bin/sh
77 +#!/bin/sh -x
78 
79 -apt-get update || true
80 +apt-get update >/dev/null || true
diff --git a/etc/lgp/pbuilderrc.sh b/etc/lgp/pbuilderrc.sh
@@ -112,11 +112,10 @@
81  if mountpoint $BUILDPLACE >/dev/null; then
82  	APTCACHEHARDLINK="no"
83  else
84  	: ${APTCACHEHARDLINK:="yes"}
85  fi
86 -: ${BUILDPLACE:="/var/cache/pbuilder/build/${DIST}/dists/"}
87 
88  # BINDMOUNTS is a space separated list of things to mount inside the chroot.
89  BINDMOUNTS="${BINDMOUNTS} /sys /dev"
90 
91  # "debconf: delaying package configuration, since apt-utils is not installed"
@@ -146,12 +145,10 @@
92  PKGNAME_LOGFILE=yes
93 
94  # No debconf interaction with user by default
95  export DEBIAN_FRONTEND=${DEBIAN_FRONTEND:="noninteractive"}
96 
97 -# Set the PATH I am going to use inside pbuilder
98 +# Set PATH used inside pbuilder image
99  #export PATH="/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin"
100 -# Set informative prompt
101 -#export PS1="(lgp) ${DIST}/${ARCH} \$ "
102  # SHELL variable is used inside pbuilder by commands like 'su'; and they need sane values
103  export SHELL="/bin/sh"
104  export TERM=linux