~ubuntu-branches/ubuntu/lucid/cvsd/lucid

« back to all changes in this revision

Viewing changes to cvsd-buildroot.in

  • Committer: Bazaar Package Importer
  • Author(s): Arthur de Jong
  • Date: 2010-01-14 22:00:00 UTC
  • Revision ID: james.westby@ubuntu.com-20100114220000-ydt3odkvl82bu28y
Tags: 1.0.18
* use simpler shell semantics in cvsd-buildroot to fix a problem with bash 4
  (LP: #474666)
* fix call to uname in the cvsd-buginfo script

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /bin/sh
2
2
 
3
3
# cvsd-buildroot - build a usable root-filesystem for cvsd
4
 
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008 Arthur de Jong
 
4
# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2010 Arthur de Jong
5
5
#
6
6
# This program is free software; you can redistribute it and/or modify
7
7
# it under the terms of the GNU General Public License as published by
107
107
ls "$ROOT/usr/bin" > /dev/null 2>&1 || \
108
108
  ( cd "$ROOT/usr" ; ln -s ../bin ./bin )
109
109
# also create $ROOT/usr/libexec on systems that have such a thing
110
 
ls /usr/libexec > /dev/null 2>&1 && \
111
 
  ( ls "$ROOT/usr/libexec" > /dev/null 2>&1 || \
112
 
    ( cd "$ROOT/usr" ; ln -s ../lib ./libexec ) )
 
110
if ls /usr/libexec > /dev/null 2>&1
 
111
then
 
112
  ls "$ROOT/usr/libexec" > /dev/null 2>&1 || \
 
113
    ( cd "$ROOT/usr" ; ln -s ../lib ./libexec )
 
114
fi
113
115
# also create $ROOT/libexec on systems that have such a thing
114
 
ls /libexec > /dev/null 2>&1 && \
115
 
  ( ls "$ROOT/libexec" > /dev/null 2>&1 || \
116
 
    ( cd "$ROOT/" ; ln -s lib ./libexec ) )
 
116
if ls /libexec > /dev/null 2>&1
 
117
then
 
118
  ls "$ROOT/libexec" > /dev/null 2>&1 || \
 
119
    ( cd "$ROOT/" ; ln -s lib ./libexec )
 
120
fi
117
121
# remove old $ROOT/usr/lib64 and $ROOT/lib64 symlinks
118
122
[ -h "$ROOT/usr/lib64" ] && rm -f "$ROOT/usr/lib64"
119
123
[ -h "$ROOT/lib64" ] && rm -f "$ROOT/lib64"
120
124
# also create $ROOT/usr/lib64 on systems that have such a thing
121
 
ls /usr/lib64 > /dev/null 2>&1 && \
122
 
  ( ls "$ROOT/usr/lib64" > /dev/null 2>&1 || \
 
125
if ls /usr/lib64 > /dev/null 2>&1
 
126
then
 
127
  ls "$ROOT/usr/lib64" > /dev/null 2>&1 || \
123
128
    ( cd "$ROOT/usr" ; ln -s ../lib64 ./lib64 ;
124
 
      mkdir -p "$ROOT/lib64" ; chmod 755 "$ROOT/lib64" ) )
 
129
      mkdir -p "$ROOT/lib64" ; chmod 755 "$ROOT/lib64" )
 
130
fi
125
131
# also create $ROOT/lib64 on systems that have such a thing
126
 
ls /lib64 > /dev/null 2>&1 && \
127
 
  ( ls "$ROOT/lib64" > /dev/null 2>&1 || \
128
 
    ( mkdir -p "$ROOT/lib64" ; chmod 755 "$ROOT/lib64" ) )
 
132
if ls /lib64 > /dev/null 2>&1
 
133
then
 
134
  ls "$ROOT/lib64" > /dev/null 2>&1 || \
 
135
    ( mkdir -p "$ROOT/lib64" ; chmod 755 "$ROOT/lib64" )
 
136
fi
129
137
# remove $ROOT/lib/tls if it's no longer outside the chroot
130
 
ls /lib/tls >/dev/null 2>&1 || ls /usr/lib/tls >/dev/null 2>&1 || \
131
 
  ( ls "$ROOT/lib/tls" >/dev/null 2>&1 && \
132
 
    ( ls "$ROOT/lib/tls.movedbycvsd" >/dev/null 2>&1 || \
 
138
if ls "$ROOT/lib/tls" >/dev/null 2>&1
 
139
then
 
140
  ls /lib/tls >/dev/null 2>&1 || ls /usr/lib/tls >/dev/null 2>&1 || \
 
141
    ls "$ROOT/lib/tls.movedbycvsd" >/dev/null 2>&1 || \
133
142
      ( mv "$ROOT/lib/tls" "$ROOT/lib/tls.movedbycvsd" && \
134
 
        chmod -R go-rwx "$ROOT/lib/tls.movedbycvsd" ) ) )
 
143
        chmod -R go-rwx "$ROOT/lib/tls.movedbycvsd" )
 
144
fi
135
145
# remove $ROOT/lib64/tls if it's no longer outside the chroot
136
 
ls /lib64/tls >/dev/null 2>&1 || ls /usr/lib64/tls >/dev/null 2>&1 || \
137
 
  ( ls "$ROOT/lib64/tls" >/dev/null 2>&1 && \
138
 
    ( ls "$ROOT/lib64/tls.movedbycvsd" >/dev/null 2>&1 || \
 
146
if ls "$ROOT/lib64/tls" >/dev/null 2>&1
 
147
then
 
148
  ls /lib64/tls >/dev/null 2>&1 || ls /usr/lib64/tls >/dev/null 2>&1 || \
 
149
    ls "$ROOT/lib64/tls.movedbycvsd" >/dev/null 2>&1 || \
139
150
      ( mv "$ROOT/lib64/tls" "$ROOT/lib64/tls.movedbycvsd" && \
140
 
        chmod -R go-rwx "$ROOT/lib64/tls.movedbycvsd" ) ) )
 
151
        chmod -R go-rwx "$ROOT/lib64/tls.movedbycvsd" )
 
152
fi
141
153
echo "done."
142
154
 
143
155
# populate /bin