changeset 5171:810a8bd66964

librestrict:stat: Remove exceptions for awk, grep, sed; add packages instead.
author Jan Nieuwenhuizen <janneke@gnu.org>
date Wed, 18 Feb 2009 09:17:49 +0100
parents 33891ef910ac
children 7116c09cb3b9
files gub/cross.py gub/misc.py gub/specs/gawk.py gub/specs/grep.py gub/specs/sed.py
diffstat 5 files changed, 22 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/gub/cross.py	Tue Feb 17 16:39:10 2009 +0100
+++ b/gub/cross.py	Wed Feb 18 09:17:49 2009 +0100
@@ -65,7 +65,8 @@
 def set_cross_dependencies (package_object_dict):
     if 'stat' in misc.librestrict ():
         global bootstrap_names
-        bootstrap_names += ['tools::dash', 'tools::coreutils']
+        bootstrap_names += ['tools::coreutils', 'tools::dash', 'tools::gawk',
+                            'tools::grep', 'tools::sed']
 
     packs = list (package_object_dict.values ())
 
--- a/gub/misc.py	Tue Feb 17 16:39:10 2009 +0100
+++ b/gub/misc.py	Wed Feb 18 09:17:49 2009 +0100
@@ -633,18 +633,20 @@
 ac_cv_path_GREP=${ac_cv_path_GREP=/bin/grep}
     '''
     # Let's not change the dict between relaxed/restricted builds
-    if False and not 'stat' in librestrict ():
+    if not 'stat' in librestrict ():
         return ''
     bin = ['egrep', 'fgrep', 'grep', 'sed']
-    usr_bin = ['awk', 'mawk', 'nawk']
+    usr_bin = ['awk', 'gawk', 'mawk', 'nawk']
     # URG, GUB's cross gcc's STAT here.  GUB may break in
     # interesting ways if there are cross compilers installed
     # here.
     gcc = ['/usr/lib/gcc', '/usr/libexec/gcc']
-    return (' LIBRESTRICT_ALLOW='
-            + ':'.join (['/bin/' + x for x in bin]
-                        + ['/usr/bin/' + x for x in usr_bin]
-                        + gcc)
+    # Better install awk, grep, sed
+    bin = []
+    usr_bin = []
+    return (':'.join (['/bin/' + x for x in bin]
+                      + ['/usr/bin/' + x for x in usr_bin]
+                      + gcc)
             + ':${LIBRESTRICT_ALLOW-/foo} ')
 
 def test ():
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gub/specs/gawk.py	Wed Feb 18 09:17:49 2009 +0100
@@ -0,0 +1,4 @@
+from gub import tools
+
+class Gawk__tools (tools.AutoBuild):
+    source = 'ftp://ftp.gnu.org/pub/gnu/gawk/gawk-3.1.6.tar.gz'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gub/specs/grep.py	Wed Feb 18 09:17:49 2009 +0100
@@ -0,0 +1,4 @@
+from gub import tools
+
+class Grep__tools (tools.AutoBuild):
+    source = 'ftp://ftp.gnu.org/pub/gnu/grep/grep-2.5.4.tar.gz'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gub/specs/sed.py	Wed Feb 18 09:17:49 2009 +0100
@@ -0,0 +1,4 @@
+from gub import tools
+
+class Sed__tools (tools.AutoBuild):
+    source = 'ftp://ftp.gnu.org/pub/gnu/sed/sed-4.1.5.tar.gz'