summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/packagemanager/ChangeLog7
-rw-r--r--noncore/settings/packagemanager/README6
-rw-r--r--noncore/settings/packagemanager/TODO6
-rw-r--r--noncore/settings/packagemanager/oconfitem.h2
-rw-r--r--noncore/settings/packagemanager/oipkg.cpp81
-rw-r--r--noncore/settings/packagemanager/oipkgconfigdlg.cpp68
-rw-r--r--noncore/settings/packagemanager/oipkgconfigdlg.h3
-rw-r--r--noncore/settings/packagemanager/opie-packagemanager.control2
8 files changed, 122 insertions, 53 deletions
diff --git a/noncore/settings/packagemanager/ChangeLog b/noncore/settings/packagemanager/ChangeLog
index 38756b1..92b542c 100644
--- a/noncore/settings/packagemanager/ChangeLog
+++ b/noncore/settings/packagemanager/ChangeLog
@@ -1 +1,8 @@
12005-02-22 Dan Williams <drw@handhelds.org>
2
3 * Released version 0.6.2
4 * Added support for ipkg configuration option, 'lists_dir'
5 * Make app depend on libipkg-0.99.143, or greater
6 * Optimize ipkg configuration file read routine
7
12005-02-16 Dan Williams <drw@handhelds.org> 82005-02-16 Dan Williams <drw@handhelds.org>
diff --git a/noncore/settings/packagemanager/README b/noncore/settings/packagemanager/README
index ff6d113..9720cb4 100644
--- a/noncore/settings/packagemanager/README
+++ b/noncore/settings/packagemanager/README
@@ -4,3 +4,3 @@
4/* ======================== 4/* ========================
5/* Version 0.6.0 5/* Version 0.6.2
6/* 6/*
@@ -11,3 +11,3 @@
11------------------------------------------------------- 11-------------------------------------------------------
12 Release Notes for Opie-PackageManager - January, 2004 12 Release Notes for Opie-PackageManager - February, 2004
13------------------------------------------------------- 13-------------------------------------------------------
@@ -46,3 +46,3 @@ the build system along with the appropriate headers.
46 46
47- Opie-PackageManager is (C) 2003-2004 Dan Williams 47- Opie-PackageManager is (C) 2003-2005 Dan Williams
48 48
diff --git a/noncore/settings/packagemanager/TODO b/noncore/settings/packagemanager/TODO
index 2512624..dd70b11 100644
--- a/noncore/settings/packagemanager/TODO
+++ b/noncore/settings/packagemanager/TODO
@@ -4,3 +4,3 @@
4/* ======================== 4/* ========================
5/* Version 0.6.1 5/* Version 0.6.2
6/* 6/*
@@ -11,5 +11,3 @@
11----------------------------------------------- 11-----------------------------------------------
12 To-do for Opie-PackageManager - January, 2005 12 To-do for Opie-PackageManager - February, 2005
13----------------------------------------------- 13-----------------------------------------------
14
151. Re-work package download dialog
diff --git a/noncore/settings/packagemanager/oconfitem.h b/noncore/settings/packagemanager/oconfitem.h
index 9972c00..b306e93 100644
--- a/noncore/settings/packagemanager/oconfitem.h
+++ b/noncore/settings/packagemanager/oconfitem.h
@@ -40,3 +40,3 @@ class OConfItem
40public: 40public:
41 enum Type { Source, Destination, Option, Arch, NotDefined }; 41 enum Type { Source, Destination, Option, Arch, Other, NotDefined };
42 42
diff --git a/noncore/settings/packagemanager/oipkg.cpp b/noncore/settings/packagemanager/oipkg.cpp
index e7e292e..3d2c621 100644
--- a/noncore/settings/packagemanager/oipkg.cpp
+++ b/noncore/settings/packagemanager/oipkg.cpp
@@ -154,2 +154,3 @@ void OIpkg::setConfigItems( OConfItemList *configList )
154 QString confLine; 154 QString confLine;
155 QString name = item->name();
155 if ( !item->active() ) 156 if ( !item->active() )
@@ -170,2 +171,12 @@ void OIpkg::setConfigItems( OConfItemList *configList )
170 case OConfItem::Arch : confLine.append( "arch " ); break; 171 case OConfItem::Arch : confLine.append( "arch " ); break;
172 case OConfItem::Other :
173 {
174 // For options w/type = Other, the mapping is as follows:
175 // name = typeStr (e.g. "lists_dir")
176 // value = value
177 // features = name (from configuration file)
178 confLine.append( item->name() );
179 name = item->features();
180 }
181 break;
171 default : break; 182 default : break;
@@ -173,3 +184,3 @@ void OIpkg::setConfigItems( OConfItemList *configList )
173 184
174 confStream << confLine << " " << item->name() << " " << item->value() << "\n"; 185 confStream << confLine << " " << name << " " << item->value() << "\n";
175 } 186 }
@@ -547,17 +558,38 @@ void OIpkg::loadConfiguration()
547 { 558 {
548 if ( !line.startsWith( "#" ) || 559 // Strip leading comment marker if exists
549 line.startsWith( "#src" ) || 560 bool comment = false;
550 line.startsWith( "#dest" ) || 561 if ( line.startsWith( "#" ) )
551 line.startsWith( "#arch" ) ||
552 line.startsWith( "#option" ) )
553 { 562 {
554 int pos = line.find( ' ', 1 ); 563 line.remove( 0, 1 );
564 line = line.simplifyWhiteSpace();
565 comment = true;
566 }
567
568 bool recognizedOption = true;
569 int pos = line.find( ' ', 1 ) + 1;
570 int endpos = line.find( ' ', pos );
571
572 // Name
573 QString name = line.mid( pos, endpos - pos );
574
575 // Value
576 QString value = "";
577 if ( endpos > -1 )
578 value = line.right( line.length() - endpos - 1 );
579
580 // Active
581 bool active = !comment;
555 582
556 // Type 583 // Type
557 QString typeStr = line.left( pos ); 584 // For options w/type = Other, the mapping is as follows:
585 // name = typeStr (e.g. "lists_dir")
586 // value = value
587 // features = name (from configuration file)
588
589 QString typeStr = line.left( pos - 1 );
558 OConfItem::Type type; 590 OConfItem::Type type;
559 QString features; 591 QString features;
560 if ( typeStr == "src" || typeStr == "#src" ) 592 if ( typeStr == "src" )
561 type = OConfItem::Source; 593 type = OConfItem::Source;
562 else if ( typeStr == "src/gz" || typeStr == "#src/gz" ) 594 else if ( typeStr == "src/gz" )
563 { 595 {
@@ -566,25 +598,19 @@ void OIpkg::loadConfiguration()
566 } 598 }
567 else if ( typeStr == "dest" || typeStr == "#dest" ) 599 else if ( typeStr == "dest" )
568 type = OConfItem::Destination; 600 type = OConfItem::Destination;
569 else if ( typeStr == "option" || typeStr == "#option" ) 601 else if ( typeStr == "option" )
570 type = OConfItem::Option; 602 type = OConfItem::Option;
571 else if ( typeStr == "arch" || typeStr == "#arch" ) 603 else if ( typeStr == "arch" )
572 type = OConfItem::Arch; 604 type = OConfItem::Arch;
605 else if ( typeStr == "lists_dir" )
606 {
607 type = OConfItem::Other;
608 features = name;
609 name = typeStr;
610 }
573 else 611 else
574 type = OConfItem::NotDefined; 612 recognizedOption = false;
575 ++pos;
576 int endpos = line.find( ' ', pos );
577
578 // Name
579 QString name = line.mid( pos, endpos - pos );
580
581 // Value
582 QString value = "";
583 if ( endpos > -1 )
584 value = line.right( line.length() - endpos - 1 );
585
586 // Active
587 bool active = !line.startsWith( "#" );
588 613
589 // Add to list 614 // Add to list
615 if ( recognizedOption )
590 m_confInfo->append( new OConfItem( type, name, value, features, active ) ); 616 m_confInfo->append( new OConfItem( type, name, value, features, active ) );
@@ -592,3 +618,2 @@ void OIpkg::loadConfiguration()
592 } 618 }
593 }
594 619
diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.cpp b/noncore/settings/packagemanager/oipkgconfigdlg.cpp
index e6d6a81..7ee2d74 100644
--- a/noncore/settings/packagemanager/oipkgconfigdlg.cpp
+++ b/noncore/settings/packagemanager/oipkgconfigdlg.cpp
@@ -130,2 +130,9 @@ void OIpkgConfigDlg::accept()
130 130
131 confItem = m_ipkg->findConfItem( OConfItem::Other, "lists_dir" );
132 if ( confItem )
133 confItem->setValue( m_optSourceLists->text() );
134 else
135 m_configs->append( new OConfItem( OConfItem::Other, "lists_dir",
136 m_optSourceLists->text(), "name" ) );
137
131 m_ipkg->setConfigItems( m_configs ); 138 m_ipkg->setConfigItems( m_configs );
@@ -299,3 +306,3 @@ void OIpkgConfigDlg::initOptionsWidget()
299 sv->addChild( container ); 306 sv->addChild( container );
300 QVBoxLayout *layout = new QVBoxLayout( container, 2, 4 ); 307 QGridLayout *layout = new QGridLayout( container, 8, 2, 2, 4 );
301 308
@@ -303,3 +310,3 @@ void OIpkgConfigDlg::initOptionsWidget()
303 QWhatsThis::add( m_optForceDepends, tr( "Tap here to enable or disable the '-force-depends' option for Ipkg." ) ); 310 QWhatsThis::add( m_optForceDepends, tr( "Tap here to enable or disable the '-force-depends' option for Ipkg." ) );
304 layout->addWidget( m_optForceDepends ); 311 layout->addMultiCellWidget( m_optForceDepends, 0, 0, 0, 1 );
305 312
@@ -307,3 +314,3 @@ void OIpkgConfigDlg::initOptionsWidget()
307 QWhatsThis::add( m_optForceReinstall, tr( "Tap here to enable or disable the '-force-reinstall' option for Ipkg." ) ); 314 QWhatsThis::add( m_optForceReinstall, tr( "Tap here to enable or disable the '-force-reinstall' option for Ipkg." ) );
308 layout->addWidget( m_optForceReinstall ); 315 layout->addMultiCellWidget( m_optForceReinstall, 1, 1, 0, 1 );
309 316
@@ -311,3 +318,3 @@ void OIpkgConfigDlg::initOptionsWidget()
311 QWhatsThis::add( m_optForceRemove, tr( "Tap here to enable or disable the '-force-removal-of-dependent-packages' option for Ipkg." ) ); 318 QWhatsThis::add( m_optForceRemove, tr( "Tap here to enable or disable the '-force-removal-of-dependent-packages' option for Ipkg." ) );
312 layout->addWidget( m_optForceRemove ); 319 layout->addMultiCellWidget( m_optForceRemove, 2, 2, 0, 1 );
313 320
@@ -315,7 +322,7 @@ void OIpkgConfigDlg::initOptionsWidget()
315 QWhatsThis::add( m_optForceOverwrite, tr( "Tap here to enable or disable the '-force-overwrite' option for Ipkg." ) ); 322 QWhatsThis::add( m_optForceOverwrite, tr( "Tap here to enable or disable the '-force-overwrite' option for Ipkg." ) );
316 layout->addWidget( m_optForceOverwrite ); 323 layout->addMultiCellWidget( m_optForceOverwrite, 3, 3, 0, 1 );
317 324
318 QLabel *l = new QLabel( tr( "Information Level" ), container ); 325 QLabel *l = new QLabel( tr( "Information level:" ), container );
319 QWhatsThis::add( l, tr( "Select information level for Ipkg." ) ); 326 QWhatsThis::add( l, tr( "Select information level for Ipkg." ) );
320 layout->addWidget( l ); 327 layout->addMultiCellWidget( l, 4, 4, 0, 1 );
321 328
@@ -327,3 +334,16 @@ void OIpkgConfigDlg::initOptionsWidget()
327 m_optVerboseIpkg->insertItem( tr( "Troubleshooting output" ) ); 334 m_optVerboseIpkg->insertItem( tr( "Troubleshooting output" ) );
328 layout->addWidget( m_optVerboseIpkg ); 335 layout->addMultiCellWidget( m_optVerboseIpkg, 5, 5, 0, 1 );
336
337 l = new QLabel( tr( "Package source lists directory:" ), container );
338 QWhatsThis::add( l, tr( "Enter the directory where package source feed information is stored." ) );
339 layout->addMultiCellWidget( l, 6, 6, 0, 1 );
340
341 m_optSourceLists = new QLineEdit( container );
342 QWhatsThis::add( m_optSourceLists, tr( "Enter the directory where package source feed information is stored." ) );
343 layout->addWidget( m_optSourceLists, 7, 0 );
344 QPushButton *btn = new QPushButton( Resource::loadPixmap( "folder" ), QString::null, container );
345 btn->setMaximumWidth( btn->height() );
346 QWhatsThis::add( btn, tr( "Tap here to select the directory where package source feed information is stored." ) );
347 connect( btn, SIGNAL(clicked()), this, SLOT(slotOptSelectSourceListsPath()) );
348 layout->addWidget( btn, 7, 1 );
329 349
@@ -347,11 +367,7 @@ void OIpkgConfigDlg::initData()
347 { 367 {
348 if ( config->type() == OConfItem::Source ) 368 switch ( config->type() )
349 {
350 m_serverList->insertItem( config->name() );
351 }
352 else if ( config->type() == OConfItem::Destination )
353 { 369 {
354 m_destList->insertItem( config->name() ); 370 case OConfItem::Source : m_serverList->insertItem( config->name() ); break;
355 } 371 case OConfItem::Destination : m_destList->insertItem( config->name() ); break;
356 else if ( config->type() == OConfItem::Option ) 372 case OConfItem::Option :
357 { 373 {
@@ -376,2 +392,13 @@ void OIpkgConfigDlg::initData()
376 } 392 }
393 break;
394 case OConfItem::Other :
395 {
396 if ( config->name() == "lists_dir" )
397 m_optSourceLists->setText( config->value() );
398 else // TODO - use proper libipkg define
399 m_optSourceLists->setText( "/usr/lib/ipkg/lists" );
400 }
401 break;
402 default : break;
403 };
377 } 404 }
@@ -515,2 +542,11 @@ void OIpkgConfigDlg::slotDestDelete()
515 542
543void OIpkgConfigDlg::slotOptSelectSourceListsPath()
544{
545 QString path = Opie::Ui::OFileDialog::getDirectory( 0, m_optSourceLists->text() );
546 if ( path.at( path.length() - 1 ) == '/' )
547 path.truncate( path.length() - 1 );
548 if ( !path.isNull() )
549 m_optSourceLists->setText( path );
550}
551
516OIpkgServerDlg::OIpkgServerDlg( OConfItem *server, QWidget *parent ) 552OIpkgServerDlg::OIpkgServerDlg( OConfItem *server, QWidget *parent )
diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.h b/noncore/settings/packagemanager/oipkgconfigdlg.h
index 0fb2e16..9e23b62 100644
--- a/noncore/settings/packagemanager/oipkgconfigdlg.h
+++ b/noncore/settings/packagemanager/oipkgconfigdlg.h
@@ -101,2 +101,3 @@ private:
101 QComboBox *m_optVerboseIpkg; // Ipkg verbosity option selection 101 QComboBox *m_optVerboseIpkg; // Ipkg verbosity option selection
102 QLineEdit *m_optSourceLists; // Ipkg source lists destination directory
102 103
@@ -119,2 +120,4 @@ private slots:
119 void slotDestDelete(); 120 void slotDestDelete();
121
122 void slotOptSelectSourceListsPath();
120}; 123};
diff --git a/noncore/settings/packagemanager/opie-packagemanager.control b/noncore/settings/packagemanager/opie-packagemanager.control
index 5da7a84..94348dd 100644
--- a/noncore/settings/packagemanager/opie-packagemanager.control
+++ b/noncore/settings/packagemanager/opie-packagemanager.control
@@ -9,2 +9,2 @@ Maintainer: Dan Williams (drw@handhelds.org)
9Description: Opie package management client 9Description: Opie package management client
10Version: 0.6.1$EXTRAVERSION 10Version: 0.6.2$EXTRAVERSION