summaryrefslogtreecommitdiff
authorandyq <andyq>2002-10-16 18:53:28 (UTC)
committer andyq <andyq>2002-10-16 18:53:28 (UTC)
commit3cb6b6fab8d06b1be8f8c39560db9d3d88ce3921 (patch) (unidiff)
tree4136ae8184db883ad4193a0096123889ac6eef93
parent9047650faad7e64e0a36553dfe04dc7ad084f095 (diff)
downloadopie-3cb6b6fab8d06b1be8f8c39560db9d3d88ce3921.zip
opie-3cb6b6fab8d06b1be8f8c39560db9d3d88ce3921.tar.gz
opie-3cb6b6fab8d06b1be8f8c39560db9d3d88ce3921.tar.bz2
removed debug info
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/datamgr.cpp16
1 files changed, 0 insertions, 16 deletions
diff --git a/noncore/settings/aqpkg/datamgr.cpp b/noncore/settings/aqpkg/datamgr.cpp
index b6e6e37..bb86766 100644
--- a/noncore/settings/aqpkg/datamgr.cpp
+++ b/noncore/settings/aqpkg/datamgr.cpp
@@ -62,93 +62,77 @@ Destination *DataManager :: getDestination( const char *name )
62 62
63 return d; 63 return d;
64} 64}
65 65
66void DataManager :: loadServers() 66void DataManager :: loadServers()
67{ 67{
68 // First add our local server - not really a server but 68 // First add our local server - not really a server but
69 // the local config (which packages are installed) 69 // the local config (which packages are installed)
70 serverList.push_back( Server( LOCAL_SERVER, "" ) ); 70 serverList.push_back( Server( LOCAL_SERVER, "" ) );
71 serverList.push_back( Server( LOCAL_IPKGS, "" ) ); 71 serverList.push_back( Server( LOCAL_IPKGS, "" ) );
72 72
73 // Read file from /etc/ipkg.conf 73 // Read file from /etc/ipkg.conf
74 QString ipkg_conf = IPKG_CONF; 74 QString ipkg_conf = IPKG_CONF;
75 FILE *fp; 75 FILE *fp;
76 fp = fopen( ipkg_conf, "r" ); 76 fp = fopen( ipkg_conf, "r" );
77 char line[130]; 77 char line[130];
78 QString lineStr; 78 QString lineStr;
79 if ( fp == NULL ) 79 if ( fp == NULL )
80 { 80 {
81 cout << "Couldn't open " << ipkg_conf << "! err = " << fp << endl; 81 cout << "Couldn't open " << ipkg_conf << "! err = " << fp << endl;
82 return; 82 return;
83 } 83 }
84 else 84 else
85 { 85 {
86 {
87 cout << "Before ipkg.conf read" << endl;
88 vector<Server>::iterator it;
89 for ( it = serverList.begin() ; it != serverList.end() ; ++it )
90 cout << "servername - " << it->getServerName() << endl;
91 }
92
93 while ( fgets( line, sizeof line, fp) != NULL ) 86 while ( fgets( line, sizeof line, fp) != NULL )
94 { 87 {
95 lineStr = line; 88 lineStr = line;
96 if ( lineStr.startsWith( "src" ) || lineStr.startsWith( "#src" ) || lineStr.startsWith( "# src" ) ) 89 if ( lineStr.startsWith( "src" ) || lineStr.startsWith( "#src" ) || lineStr.startsWith( "# src" ) )
97 { 90 {
98 char alias[20]; 91 char alias[20];
99 char url[100]; 92 char url[100];
100 93
101 94
102 // Looks a little wierd but read up to the r of src (throwing it away), 95 // Looks a little wierd but read up to the r of src (throwing it away),
103 // then read up to the next space and throw that away, the alias 96 // then read up to the next space and throw that away, the alias
104 // is next. 97 // is next.
105 // Should Handle #src, # src, src, and combinations of 98 // Should Handle #src, # src, src, and combinations of
106 sscanf( lineStr, "%*[^r]%*[^ ] %s %s", alias, url ); 99 sscanf( lineStr, "%*[^r]%*[^ ] %s %s", alias, url );
107 cout << "Adding alias " << alias << " to list" << endl;
108 cout << lineStr << endl;
109 Server s( alias, url ); 100 Server s( alias, url );
110 serverList.push_back( s ); 101 serverList.push_back( s );
111 102
112 if ( lineStr.startsWith( "src" ) ) 103 if ( lineStr.startsWith( "src" ) )
113 setActiveServer( alias ); 104 setActiveServer( alias );
114 } 105 }
115 else if ( lineStr.startsWith( "dest" ) ) 106 else if ( lineStr.startsWith( "dest" ) )
116 { 107 {
117 char alias[20]; 108 char alias[20];
118 char path[50]; 109 char path[50];
119 sscanf( lineStr, "%*[^ ] %s %s", alias, path ); 110 sscanf( lineStr, "%*[^ ] %s %s", alias, path );
120 Destination d( alias, path ); 111 Destination d( alias, path );
121 destList.push_back( d ); 112 destList.push_back( d );
122 } 113 }
123 } 114 }
124 {
125 cout << "After ipkg.conf read" << endl;
126 vector<Server>::iterator it;
127 for ( it = serverList.begin() ; it != serverList.end() ; ++it )
128 cout << "servername - " << it->getServerName() << endl;
129 }
130
131 } 115 }
132 fclose( fp ); 116 fclose( fp );
133 117
134 // Go through the server destination list and add root, cf and card if they 118 // Go through the server destination list and add root, cf and card if they
135 // don't already exist 119 // don't already exist
136/* AQ - commented out as if you don't have a CF or SD card in then 120/* AQ - commented out as if you don't have a CF or SD card in then
137 * this causes IPKG to try to create directories on non existant devices 121 * this causes IPKG to try to create directories on non existant devices
138 * (which of course fails), gives a nasty error message and can cause ipkg 122 * (which of course fails), gives a nasty error message and can cause ipkg
139 * to seg fault. 123 * to seg fault.
140 * 124 *
141 vector<Destination>::iterator dit; 125 vector<Destination>::iterator dit;
142 bool foundRoot = false; 126 bool foundRoot = false;
143 bool foundCF = false; 127 bool foundCF = false;
144 bool foundCard = false; 128 bool foundCard = false;
145 for ( dit = destList.begin() ; dit != destList.end() ; ++dit ) 129 for ( dit = destList.begin() ; dit != destList.end() ; ++dit )
146 { 130 {
147 if ( dit->getDestinationPath() == "/" ) 131 if ( dit->getDestinationPath() == "/" )
148 foundRoot = true; 132 foundRoot = true;
149 if ( dit->getDestinationPath() == "/mnt/cf" ) 133 if ( dit->getDestinationPath() == "/mnt/cf" )
150 foundCF = true; 134 foundCF = true;
151 if ( dit->getDestinationPath() == "/mnt/card" ) 135 if ( dit->getDestinationPath() == "/mnt/card" )
152 foundCard = true; 136 foundCard = true;
153 } 137 }
154 138