summaryrefslogtreecommitdiff
authorar <ar>2004-05-02 17:43:05 (UTC)
committer ar <ar>2004-05-02 17:43:05 (UTC)
commit43bd7d72643e2ee3bc4d830c6927def392bc9c7f (patch) (unidiff)
tree7693b81c5a37032f81a720ea299b98bbccb94bda
parenta210b9a597ba0c929d95c38ffbaf972916c7b8a7 (diff)
downloadopie-43bd7d72643e2ee3bc4d830c6927def392bc9c7f.zip
opie-43bd7d72643e2ee3bc4d830c6927def392bc9c7f.tar.gz
opie-43bd7d72643e2ee3bc4d830c6927def392bc9c7f.tar.bz2
- convert qDebug to odebug
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/symlinker/main.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/symlinker/main.cpp b/core/symlinker/main.cpp
index 96e7f3c..bf53a82 100644
--- a/core/symlinker/main.cpp
+++ b/core/symlinker/main.cpp
@@ -49,78 +49,78 @@ static void createSymlinks( const QString &location, const QString &package )
49// odebug << "Read after: " << s.ascii() << "" << oendl; 49// odebug << "Read after: " << s.ascii() << "" << oendl;
50 50
51 // for s, do link/mkdir. 51 // for s, do link/mkdir.
52 if ( s.right(1) == "/" ) { 52 if ( s.right(1) == "/" ) {
53// odebug << "do mkdir for " << s.ascii() << "" << oendl; 53// odebug << "do mkdir for " << s.ascii() << "" << oendl;
54 mkdir( s.ascii(), 0777 ); 54 mkdir( s.ascii(), 0777 );
55 //possible optimization: symlink directories 55 //possible optimization: symlink directories
56 //that don't exist already. -- Risky. 56 //that don't exist already. -- Risky.
57 } else { 57 } else {
58// odebug << "do symlink for " << s.ascii() << "" << oendl; 58// odebug << "do symlink for " << s.ascii() << "" << oendl;
59 QFileInfo ffi( s ); 59 QFileInfo ffi( s );
60 //Don't try to symlink if a regular file exists already 60 //Don't try to symlink if a regular file exists already
61 if ( !ffi.exists() || ffi.isSymLink() ) { 61 if ( !ffi.exists() || ffi.isSymLink() ) {
62 if (symlink( (location+s).ascii(), s.ascii() ) != 0){ 62 if (symlink( (location+s).ascii(), s.ascii() ) != 0){
63 if (errno == ENOENT){ 63 if (errno == ENOENT){
64// perror("Symlink Failed! "); 64// perror("Symlink Failed! ");
65 QString e=s.ascii(); 65 QString e=s.ascii();
66 e = e.replace(ffi.fileName(),""); 66 e = e.replace(ffi.fileName(),"");
67// odebug << "DirName : " << e.ascii() << "" << oendl; 67// odebug << "DirName : " << e.ascii() << "" << oendl;
68 system ( QString("mkdir -p ")+e.ascii() ); 68 system ( QString("mkdir -p ")+e.ascii() );
69 if (symlink( (location+s).ascii(), s.ascii() ) != 0) 69 if (symlink( (location+s).ascii(), s.ascii() ) != 0)
70 odebug << "Big problem creating symlink and directory" << oendl; 70 odebug << "Big problem creating symlink and directory" << oendl;
71 } 71 }
72 } 72 }
73// qDebug ( "Created %s" ,s.ascii() ); 73// odebug << "Created << s.ascii() << oendl;
74 out << s << "\n"; 74 out << s << "\n";
75 } else { 75 } else {
76 odebug << "" << s.ascii() << " exists already, not symlinked" << oendl; 76 odebug << "" << s.ascii() << " exists already, not symlinked" << oendl;
77 } 77 }
78 } 78 }
79 } 79 }
80 inFile.close(); 80 inFile.close();
81 outFile.close(); 81 outFile.close();
82 } 82 }
83} 83}
84 84
85 85
86 86
87static void removeSymlinks( const QString &package ) 87static void removeSymlinks( const QString &package )
88{ 88{
89 QFile inFile( listDir + package + ".list" ); 89 QFile inFile( listDir + package + ".list" );
90 90
91 if ( inFile.open(IO_ReadOnly) ) { 91 if ( inFile.open(IO_ReadOnly) ) {
92 QTextStream in(&inFile); 92 QTextStream in(&inFile);
93 93
94 QString s; 94 QString s;
95 while ( !in.eof() ) { // until end of file... 95 while ( !in.eof() ) { // until end of file...
96 s = in.readLine(); // line of text excluding '\n' 96 s = in.readLine(); // line of text excluding '\n'
97// odebug << "remove symlink " << s.ascii() << "" << oendl; 97// odebug << "remove symlink " << s.ascii() << "" << oendl;
98 QFileInfo ffi( s ); 98 QFileInfo ffi( s );
99 //Confirm that it's still a symlink. 99 //Confirm that it's still a symlink.
100 if ( ffi.isSymLink() ){ 100 if ( ffi.isSymLink() ){
101 unlink( s.ascii() ); 101 unlink( s.ascii() );
102// qDebug ( "Removed %s", s.ascii() );} 102// odebug << "Removed " << s.ascii() << oendl; }
103// else 103// else
104// odebug << "Not removed " << s.ascii() << "" << oendl; 104// odebug << "Not removed " << s.ascii() << "" << oendl;
105 } 105 }
106 } 106 }
107 inFile.close(); 107 inFile.close();
108 inFile.remove(); 108 inFile.remove();
109 } 109 }
110} 110}
111 111
112 112
113 113
114/* 114/*
115 Slightly hacky: we can't use StorageInfo, since we don't have a 115 Slightly hacky: we can't use StorageInfo, since we don't have a
116 QApplication. We look for filesystems that have the directory 116 QApplication. We look for filesystems that have the directory
117 /usr/lib/ipkg/info, and assume that they are removable media 117 /usr/lib/ipkg/info, and assume that they are removable media
118 with packages installed. This is safe even if eg. /usr is on a 118 with packages installed. This is safe even if eg. /usr is on a
119 separate filesystem, since then we would be testing for 119 separate filesystem, since then we would be testing for
120 /usr/usr/lib/ipkg/info, which should not exist. (And if it 120 /usr/usr/lib/ipkg/info, which should not exist. (And if it
121 does they deserve to have it treated as removable.) 121 does they deserve to have it treated as removable.)
122 */ 122 */
123 123
124static void updateSymlinks() 124static void updateSymlinks()
125{ 125{
126 QDir lists( listDir ); 126 QDir lists( listDir );