summaryrefslogtreecommitdiff
authortille <tille>2002-05-26 12:55:17 (UTC)
committer tille <tille>2002-05-26 12:55:17 (UTC)
commit5874b68d8447fa355f5034ad0e6c06bb48638f19 (patch) (unidiff)
treec3e3e28ad4b3ee0e42a78bfd9398f62090f3e160
parent602e52f454a3d3a5cd973f3d7957d2d96f86464e (diff)
downloadopie-5874b68d8447fa355f5034ad0e6c06bb48638f19.zip
opie-5874b68d8447fa355f5034ad0e6c06bb48638f19.tar.gz
opie-5874b68d8447fa355f5034ad0e6c06bb48638f19.tar.bz2
fixed makelinks got version in name
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/pmipkg.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp
index 0fa4c61..7b3fa1e 100644
--- a/noncore/unsupported/oipkg/pmipkg.cpp
+++ b/noncore/unsupported/oipkg/pmipkg.cpp
@@ -54,97 +54,97 @@ bool PmIpkg::runIpkg(const QString& args, const QString& dest )
54 if (installDialog && installDialog->_force_depends) 54 if (installDialog && installDialog->_force_depends)
55 { 55 {
56 if (installDialog->_force_depends->isChecked()) 56 if (installDialog->_force_depends->isChecked())
57 cmd += " -force-depends "; 57 cmd += " -force-depends ";
58 if (installDialog->_force_reinstall->isChecked()) 58 if (installDialog->_force_reinstall->isChecked())
59 cmd += " -force-reinstall "; 59 cmd += " -force-reinstall ";
60 if (installDialog->_force_remove->isChecked()) 60 if (installDialog->_force_remove->isChecked())
61 cmd += " -force-removal-of-essential-packages "; 61 cmd += " -force-removal-of-essential-packages ";
62 } 62 }
63 63
64 out( "Starting to "+ args+"\n"); 64 out( "Starting to "+ args+"\n");
65 cmd += args; 65 cmd += args;
66 out( "running:\n"+cmd+"\n" ); 66 out( "running:\n"+cmd+"\n" );
67 pvDebug(2,"running:"+cmd); 67 pvDebug(2,"running:"+cmd);
68 qApp->processEvents(); 68 qApp->processEvents();
69 FILE *fp; 69 FILE *fp;
70 char line[130]; 70 char line[130];
71 QString lineStr, lineStrOld; 71 QString lineStr, lineStrOld;
72 sleep(1); 72 sleep(1);
73 cmd +=" 2>&1"; 73 cmd +=" 2>&1";
74 fp = popen( (const char *) cmd, "r"); 74 fp = popen( (const char *) cmd, "r");
75 if ( !fp ) { 75 if ( !fp ) {
76 qDebug("Could not execute '" + cmd + "'! err=%d", fp); 76 qDebug("Could not execute '" + cmd + "'! err=%d", fp);
77 pclose(fp); 77 pclose(fp);
78 out("\nError while executing "+ cmd+"\n\n"); 78 out("\nError while executing "+ cmd+"\n\n");
79 return false; 79 return false;
80 } else { 80 } else {
81 while ( fgets( line, sizeof line, fp)) { 81 while ( fgets( line, sizeof line, fp)) {
82 lineStr = line; 82 lineStr = line;
83 lineStr=lineStr.left(lineStr.length()-1); 83 lineStr=lineStr.left(lineStr.length()-1);
84 //Configuring opie-oipkg...Done 84 //Configuring opie-oipkg...Done
85 if (lineStr.contains("Done")) 85 if (lineStr.contains("Done"))
86 ret = true; 86 ret = true;
87 if (lineStr!=lineStrOld) 87 if (lineStr!=lineStrOld)
88 out(lineStr); 88 out(lineStr);
89 lineStrOld = lineStr; 89 lineStrOld = lineStr;
90 qApp->processEvents(); 90 qApp->processEvents();
91 } 91 }
92 pclose(fp); 92 pclose(fp);
93 } 93 }
94 //out( "Finished!"); 94 //out( "Finished!");
95 pvDebug(2,QString(ret?"success\n":"failure\n")); 95 pvDebug(2,QString(ret?"success\n":"failure\n"));
96 return ret; 96 return ret;
97} 97}
98 98
99void PmIpkg::makeLinks(Package *pack) 99void PmIpkg::makeLinks(Package *pack)
100{ 100{
101 pvDebug( 2, "PmIpkg::makeLinks "+ pack->name()); 101 pvDebug( 2, "PmIpkg::makeLinks "+ pack->name());
102 linkPackage( pack->name(), pack->dest() ); 102 linkPackage( pack->installName(), pack->dest() );
103} 103}
104 104
105QStringList* PmIpkg::getList( QString packFileName, QString d ) 105QStringList* PmIpkg::getList( QString packFileName, QString d )
106{ 106{
107 QString dest = settings->getDestinationUrlByName( d ); 107 QString dest = settings->getDestinationUrlByName( d );
108 dest = dest==""?d:dest; 108 dest = dest==""?d:dest;
109 if (dest == "/" ) return 0; 109 if (dest == "/" ) return 0;
110 { 110 {
111 Config cfg( "oipkg", Config::User ); 111 Config cfg( "oipkg", Config::User );
112 cfg.setGroup( "Common" ); 112 cfg.setGroup( "Common" );
113 QString statusDir = cfg.readEntry( "statusDir", "" ); 113 QString statusDir = cfg.readEntry( "statusDir", "" );
114 } 114 }
115 packFileName = dest+"/"+statusDir+"/info/"+packFileName+".list"; 115 packFileName = dest+"/"+statusDir+"/info/"+packFileName+".list";
116 QFile f( packFileName ); 116 QFile f( packFileName );
117 if ( ! f.open(IO_ReadOnly) ) 117 if ( ! f.open(IO_ReadOnly) )
118 { 118 {
119 pvDebug(1," Panik! Could not open"); 119 pvDebug(1," Panik! Could not open");
120 out( "Panik!\n Could not open:\n"+packFileName ); 120 out( "Panik!\n Could not open:\n"+packFileName );
121 return (QStringList*)0; 121 return (QStringList*)0;
122 } 122 }
123 QStringList *fileList = new QStringList(); 123 QStringList *fileList = new QStringList();
124 QTextStream t( &f ); 124 QTextStream t( &f );
125 while ( !t.eof() ) 125 while ( !t.eof() )
126 { 126 {
127 *fileList += t.readLine(); 127 *fileList += t.readLine();
128 } 128 }
129 return fileList; 129 return fileList;
130} 130}
131 131
132void PmIpkg::linkPackage( QString packFileName, QString dest ) 132void PmIpkg::linkPackage( QString packFileName, QString dest )
133{ 133{
134 QStringList *fileList = getList( packFileName, dest ); 134 QStringList *fileList = getList( packFileName, dest );
135 processFileList( fileList, dest ); 135 processFileList( fileList, dest );
136 delete fileList; 136 delete fileList;
137} 137}
138 138
139void PmIpkg::processFileList( QStringList *fileList, QString d ) 139void PmIpkg::processFileList( QStringList *fileList, QString d )
140{ 140{
141 if (!fileList) return; 141 if (!fileList) return;
142 for (uint i=0; i < fileList->count(); i++) 142 for (uint i=0; i < fileList->count(); i++)
143 { 143 {
144 QString dest = settings->getDestinationUrlByName( d ); 144 QString dest = settings->getDestinationUrlByName( d );
145 dest = dest==""?d:dest; 145 dest = dest==""?d:dest;
146 processLinkDir( (*fileList)[i], dest ); 146 processLinkDir( (*fileList)[i], dest );
147 } 147 }
148} 148}
149 149
150 150