summaryrefslogtreecommitdiff
authorclem <clem>2004-09-24 12:39:50 (UTC)
committer clem <clem>2004-09-24 12:39:50 (UTC)
commit478b2ead47a09956cadfacb8f469fb2fdee5531c (patch) (unidiff)
tree2e028e3de22a822d6ae779640e14999030ac3107
parent4761d0610715569c7af83dc68ffc90fea4d35690 (diff)
downloadopie-478b2ead47a09956cadfacb8f469fb2fdee5531c.zip
opie-478b2ead47a09956cadfacb8f469fb2fdee5531c.tar.gz
opie-478b2ead47a09956cadfacb8f469fb2fdee5531c.tar.bz2
Denote the end of the xargs parameters, to avoid "xargs: invalid option -- v"
kind of errors with old xargs.
Diffstat (more/less context) (ignore whitespace changes)
-rwxr-xr-xcore/launcher/opie-taskbar.prerm2
-rwxr-xr-xlibopie2/tools/regen.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/core/launcher/opie-taskbar.prerm b/core/launcher/opie-taskbar.prerm
index 664160b..ae02235 100755
--- a/core/launcher/opie-taskbar.prerm
+++ b/core/launcher/opie-taskbar.prerm
@@ -1,5 +1,5 @@
1#/bin/sh 1#/bin/sh
2 2
3find /etc -name [SK][0-9][0-9]opie | xargs rm -f 3find /etc -name [SK][0-9][0-9]opie | xargs -- rm -f
4 4
5exit 0 5exit 0
diff --git a/libopie2/tools/regen.py b/libopie2/tools/regen.py
index 89385e1..2f53a14 100755
--- a/libopie2/tools/regen.py
+++ b/libopie2/tools/regen.py
@@ -1,78 +1,78 @@
1#!/usr/bin/env python 1#!/usr/bin/env python
2 2
3"""Regenerate C++ mapping classes""" 3"""Regenerate C++ mapping classes"""
4 4
5#---------------------------------------------------------------------------# 5#---------------------------------------------------------------------------#
6# # 6# #
7#---------------------------------------------------------------------------# 7#---------------------------------------------------------------------------#
8 8
9def regenDebugMapper( basename ): 9def regenDebugMapper( basename ):
10 """ 10 """
11 Debug Mapper - maps ioctl numbers to names, e.g. 0x4x5a -> SIOCGIWNAME 11 Debug Mapper - maps ioctl numbers to names, e.g. 0x4x5a -> SIOCGIWNAME
12 """ 12 """
13 13
14 result = os.popen( 'find /usr/include -name "*.h" |xargs grep -h SIOC|grep 0x' ).readlines() 14 result = os.popen( 'find /usr/include -name "*.h" |xargs -- grep -h SIOC|grep 0x' ).readlines()
15 15
16 try: 16 try:
17 tablehfile = file( basename+".h", "w" ) 17 tablehfile = file( basename+".h", "w" )
18 except: 18 except:
19 tablehfile = sys.stdout 19 tablehfile = sys.stdout
20 20
21 try: 21 try:
22 tablecfile = file( basename+".cpp", "w" ) 22 tablecfile = file( basename+".cpp", "w" )
23 except: 23 except:
24 tablecfile = sys.stdout 24 tablecfile = sys.stdout
25 25
26 print >>tablehfile,""" 26 print >>tablehfile,"""
27/* 27/*
28 * debug value mapper - generated by %s - (C) Michael 'Mickey' Lauer <mickey@vanille.de> 28 * debug value mapper - generated by %s - (C) Michael 'Mickey' Lauer <mickey@vanille.de>
29 */ 29 */
30 30
31#ifndef DEBUGMAPPER_H 31#ifndef DEBUGMAPPER_H
32#define DEBUGMAPPER_H 32#define DEBUGMAPPER_H
33 33
34#include <qstring.h> 34#include <qstring.h>
35#include <qintdict.h> 35#include <qintdict.h>
36 36
37typedef QIntDict<QString> IntStringMap; 37typedef QIntDict<QString> IntStringMap;
38 38
39class DebugMapper 39class DebugMapper
40{ 40{
41 public: 41 public:
42 DebugMapper(); 42 DebugMapper();
43 ~DebugMapper(); 43 ~DebugMapper();
44 44
45 const QString& map( int value ) const; 45 const QString& map( int value ) const;
46 private: 46 private:
47 IntStringMap _map; 47 IntStringMap _map;
48}; 48};
49 49
50#endif 50#endif
51""" % sys.argv[0] 51""" % sys.argv[0]
52 52
53 print >>tablecfile,""" 53 print >>tablecfile,"""
54/* 54/*
55 * debug value mapper - generated by %s - (C) Michael 'Mickey' Lauer <mickey@vanille.de> 55 * debug value mapper - generated by %s - (C) Michael 'Mickey' Lauer <mickey@vanille.de>
56 */ 56 */
57 57
58#include <opie2/odebug.h> 58#include <opie2/odebug.h>
59 59
60#include "%s" 60#include "%s"
61 61
62DebugMapper::DebugMapper() 62DebugMapper::DebugMapper()
63{ 63{
64 odebug << "DebugMapper::DebugMapper()" << oendl; 64 odebug << "DebugMapper::DebugMapper()" << oendl;
65 65
66""" % ( sys.argv[0], tablehfile.name ) 66""" % ( sys.argv[0], tablehfile.name )
67 67
68 for line in result: 68 for line in result:
69 l = line.split() 69 l = line.split()
70 if not l[0].startswith( "#define" ) or not l[2].startswith( "0x" ): 70 if not l[0].startswith( "#define" ) or not l[2].startswith( "0x" ):
71 print >>sys.stderr, "can't parse line: %s" % l 71 print >>sys.stderr, "can't parse line: %s" % l
72 continue 72 continue
73 print >>tablecfile, " _map.insert( %s, new QString(\"%s\") );" % ( l[2], l[1] ) 73 print >>tablecfile, " _map.insert( %s, new QString(\"%s\") );" % ( l[2], l[1] )
74 74
75 75
76 print >>tablecfile,""" 76 print >>tablecfile,"""
77}; 77};
78 78
@@ -208,65 +208,65 @@ OManufacturerDB::OManufacturerDB()
208 print >>cpp, ' manufacturersExt.insert( "%s", "%s" );' % ( entries[0], "_".join( entries[3:] ) ) 208 print >>cpp, ' manufacturersExt.insert( "%s", "%s" );' % ( entries[0], "_".join( entries[3:] ) )
209 else: 209 else:
210 assert( false ) 210 assert( false )
211 if not (count % 1000): 211 if not (count % 1000):
212 print >>cpp,""" 212 print >>cpp,"""
213#ifdef OPIE_IMPROVE_GUI_LATENCY 213#ifdef OPIE_IMPROVE_GUI_LATENCY
214 if (qApp) qApp->processEvents(); 214 if (qApp) qApp->processEvents();
215#endif 215#endif
216""" 216"""
217 print "successfully parsed", count, "manufacturer lines" 217 print "successfully parsed", count, "manufacturer lines"
218 print >>cpp,""" 218 print >>cpp,"""
219} 219}
220 220
221 221
222OManufacturerDB::~OManufacturerDB() 222OManufacturerDB::~OManufacturerDB()
223{ 223{
224} 224}
225 225
226 226
227const QString& OManufacturerDB::lookup( const QString& macaddr ) const 227const QString& OManufacturerDB::lookup( const QString& macaddr ) const
228{ 228{
229 return manufacturers[macaddr.upper().left(8)]; 229 return manufacturers[macaddr.upper().left(8)];
230} 230}
231 231
232 232
233const QString& OManufacturerDB::lookupExt( const QString& macaddr ) const 233const QString& OManufacturerDB::lookupExt( const QString& macaddr ) const
234{ 234{
235 QMap<QString,QString>::ConstIterator it = manufacturersExt.find( macaddr.upper().left(8) ); 235 QMap<QString,QString>::ConstIterator it = manufacturersExt.find( macaddr.upper().left(8) );
236 return it == manufacturersExt.end() ? lookup( macaddr ) : *it; 236 return it == manufacturersExt.end() ? lookup( macaddr ) : *it;
237} 237}
238""" 238"""
239 239
240#---------------------------------------------------------------------------# 240#---------------------------------------------------------------------------#
241# # 241# #
242#---------------------------------------------------------------------------# 242#---------------------------------------------------------------------------#
243 243
244#---------------------------------------------------------------------------# 244#---------------------------------------------------------------------------#
245# # 245# #
246#---------------------------------------------------------------------------# 246#---------------------------------------------------------------------------#
247 247
248#---------------------------------------------------------------------------# 248#---------------------------------------------------------------------------#
249# # 249# #
250#---------------------------------------------------------------------------# 250#---------------------------------------------------------------------------#
251 251
252import sys 252import sys
253import os 253import os
254import copy 254import copy
255 255
256if __name__ == "__main__": 256if __name__ == "__main__":
257 if len( sys.argv ) != 3: 257 if len( sys.argv ) != 3:
258 print """ 258 print """
259Usage: %s <table> <basename> 259Usage: %s <table> <basename>
260 260
261Available tables: %s 261Available tables: %s
262""" % ( sys.argv[0], [ str(k)[5:] for k in copy.copy( locals() ) if k.startswith( "regen" ) ] ) 262""" % ( sys.argv[0], [ str(k)[5:] for k in copy.copy( locals() ) if k.startswith( "regen" ) ] )
263 sys.exit( -1 ) 263 sys.exit( -1 )
264 264
265 try: 265 try:
266 func = locals()["regen%s" % sys.argv[1]] 266 func = locals()["regen%s" % sys.argv[1]]
267 except KeyError: 267 except KeyError:
268 print "Table '%s' unknown." % sys.argv[1] 268 print "Table '%s' unknown." % sys.argv[1]
269 sys.exit( -1 ) 269 sys.exit( -1 )
270 else: 270 else:
271 func( sys.argv[2] ) 271 func( sys.argv[2] )
272 sys.exit( 0 ) \ No newline at end of file 272 sys.exit( 0 )