summaryrefslogtreecommitdiff
authordrw <drw>2005-02-22 22:25:39 (UTC)
committer drw <drw>2005-02-22 22:25:39 (UTC)
commit504c5f59c082106028e3dbc9126d7b655908224f (patch) (side-by-side diff)
tree2cf4465cb2a46b0d13f909d073225585ad4e5092
parenta2eea1c6273acd16fed2406493923c52fba19ebc (diff)
downloadopie-504c5f59c082106028e3dbc9126d7b655908224f.zip
opie-504c5f59c082106028e3dbc9126d7b655908224f.tar.gz
opie-504c5f59c082106028e3dbc9126d7b655908224f.tar.bz2
Add support for lists_dir ipkg configuration option, optimize ipkg configuration file read routine, update version to 0.6.2
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 @@
+2005-02-22 Dan Williams <drw@handhelds.org>
+
+ * Released version 0.6.2
+ * Added support for ipkg configuration option, 'lists_dir'
+ * Make app depend on libipkg-0.99.143, or greater
+ * Optimize ipkg configuration file read routine
+
2005-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 @@
/* ========================
-/* Version 0.6.0
+/* Version 0.6.2
/*
@@ -11,3 +11,3 @@
-------------------------------------------------------
- Release Notes for Opie-PackageManager - January, 2004
+ Release Notes for Opie-PackageManager - February, 2004
-------------------------------------------------------
@@ -46,3 +46,3 @@ the build system along with the appropriate headers.
-- Opie-PackageManager is (C) 2003-2004 Dan Williams
+- Opie-PackageManager is (C) 2003-2005 Dan Williams
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 @@
/* ========================
-/* Version 0.6.1
+/* Version 0.6.2
/*
@@ -11,5 +11,3 @@
-----------------------------------------------
- To-do for Opie-PackageManager - January, 2005
+ To-do for Opie-PackageManager - February, 2005
-----------------------------------------------
-
-1. 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
public:
- enum Type { Source, Destination, Option, Arch, NotDefined };
+ enum Type { Source, Destination, Option, Arch, Other, NotDefined };
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 )
QString confLine;
+ QString name = item->name();
if ( !item->active() )
@@ -170,2 +171,12 @@ void OIpkg::setConfigItems( OConfItemList *configList )
case OConfItem::Arch : confLine.append( "arch " ); break;
+ case OConfItem::Other :
+ {
+ // For options w/type = Other, the mapping is as follows:
+ // name = typeStr (e.g. "lists_dir")
+ // value = value
+ // features = name (from configuration file)
+ confLine.append( item->name() );
+ name = item->features();
+ }
+ break;
default : break;
@@ -173,3 +184,3 @@ void OIpkg::setConfigItems( OConfItemList *configList )
- confStream << confLine << " " << item->name() << " " << item->value() << "\n";
+ confStream << confLine << " " << name << " " << item->value() << "\n";
}
@@ -547,17 +558,38 @@ void OIpkg::loadConfiguration()
{
- if ( !line.startsWith( "#" ) ||
- line.startsWith( "#src" ) ||
- line.startsWith( "#dest" ) ||
- line.startsWith( "#arch" ) ||
- line.startsWith( "#option" ) )
+ // Strip leading comment marker if exists
+ bool comment = false;
+ if ( line.startsWith( "#" ) )
{
- int pos = line.find( ' ', 1 );
+ line.remove( 0, 1 );
+ line = line.simplifyWhiteSpace();
+ comment = true;
+ }
+
+ bool recognizedOption = true;
+ int pos = line.find( ' ', 1 ) + 1;
+ int endpos = line.find( ' ', pos );
+
+ // Name
+ QString name = line.mid( pos, endpos - pos );
+
+ // Value
+ QString value = "";
+ if ( endpos > -1 )
+ value = line.right( line.length() - endpos - 1 );
+
+ // Active
+ bool active = !comment;
// Type
- QString typeStr = line.left( pos );
+ // For options w/type = Other, the mapping is as follows:
+ // name = typeStr (e.g. "lists_dir")
+ // value = value
+ // features = name (from configuration file)
+
+ QString typeStr = line.left( pos - 1 );
OConfItem::Type type;
QString features;
- if ( typeStr == "src" || typeStr == "#src" )
+ if ( typeStr == "src" )
type = OConfItem::Source;
- else if ( typeStr == "src/gz" || typeStr == "#src/gz" )
+ else if ( typeStr == "src/gz" )
{
@@ -566,25 +598,19 @@ void OIpkg::loadConfiguration()
}
- else if ( typeStr == "dest" || typeStr == "#dest" )
+ else if ( typeStr == "dest" )
type = OConfItem::Destination;
- else if ( typeStr == "option" || typeStr == "#option" )
+ else if ( typeStr == "option" )
type = OConfItem::Option;
- else if ( typeStr == "arch" || typeStr == "#arch" )
+ else if ( typeStr == "arch" )
type = OConfItem::Arch;
+ else if ( typeStr == "lists_dir" )
+ {
+ type = OConfItem::Other;
+ features = name;
+ name = typeStr;
+ }
else
- type = OConfItem::NotDefined;
- ++pos;
- int endpos = line.find( ' ', pos );
-
- // Name
- QString name = line.mid( pos, endpos - pos );
-
- // Value
- QString value = "";
- if ( endpos > -1 )
- value = line.right( line.length() - endpos - 1 );
-
- // Active
- bool active = !line.startsWith( "#" );
+ recognizedOption = false;
// Add to list
+ if ( recognizedOption )
m_confInfo->append( new OConfItem( type, name, value, features, active ) );
@@ -592,3 +618,2 @@ void OIpkg::loadConfiguration()
}
- }
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()
+ confItem = m_ipkg->findConfItem( OConfItem::Other, "lists_dir" );
+ if ( confItem )
+ confItem->setValue( m_optSourceLists->text() );
+ else
+ m_configs->append( new OConfItem( OConfItem::Other, "lists_dir",
+ m_optSourceLists->text(), "name" ) );
+
m_ipkg->setConfigItems( m_configs );
@@ -299,3 +306,3 @@ void OIpkgConfigDlg::initOptionsWidget()
sv->addChild( container );
- QVBoxLayout *layout = new QVBoxLayout( container, 2, 4 );
+ QGridLayout *layout = new QGridLayout( container, 8, 2, 2, 4 );
@@ -303,3 +310,3 @@ void OIpkgConfigDlg::initOptionsWidget()
QWhatsThis::add( m_optForceDepends, tr( "Tap here to enable or disable the '-force-depends' option for Ipkg." ) );
- layout->addWidget( m_optForceDepends );
+ layout->addMultiCellWidget( m_optForceDepends, 0, 0, 0, 1 );
@@ -307,3 +314,3 @@ void OIpkgConfigDlg::initOptionsWidget()
QWhatsThis::add( m_optForceReinstall, tr( "Tap here to enable or disable the '-force-reinstall' option for Ipkg." ) );
- layout->addWidget( m_optForceReinstall );
+ layout->addMultiCellWidget( m_optForceReinstall, 1, 1, 0, 1 );
@@ -311,3 +318,3 @@ void OIpkgConfigDlg::initOptionsWidget()
QWhatsThis::add( m_optForceRemove, tr( "Tap here to enable or disable the '-force-removal-of-dependent-packages' option for Ipkg." ) );
- layout->addWidget( m_optForceRemove );
+ layout->addMultiCellWidget( m_optForceRemove, 2, 2, 0, 1 );
@@ -315,7 +322,7 @@ void OIpkgConfigDlg::initOptionsWidget()
QWhatsThis::add( m_optForceOverwrite, tr( "Tap here to enable or disable the '-force-overwrite' option for Ipkg." ) );
- layout->addWidget( m_optForceOverwrite );
+ layout->addMultiCellWidget( m_optForceOverwrite, 3, 3, 0, 1 );
- QLabel *l = new QLabel( tr( "Information Level" ), container );
+ QLabel *l = new QLabel( tr( "Information level:" ), container );
QWhatsThis::add( l, tr( "Select information level for Ipkg." ) );
- layout->addWidget( l );
+ layout->addMultiCellWidget( l, 4, 4, 0, 1 );
@@ -327,3 +334,16 @@ void OIpkgConfigDlg::initOptionsWidget()
m_optVerboseIpkg->insertItem( tr( "Troubleshooting output" ) );
- layout->addWidget( m_optVerboseIpkg );
+ layout->addMultiCellWidget( m_optVerboseIpkg, 5, 5, 0, 1 );
+
+ l = new QLabel( tr( "Package source lists directory:" ), container );
+ QWhatsThis::add( l, tr( "Enter the directory where package source feed information is stored." ) );
+ layout->addMultiCellWidget( l, 6, 6, 0, 1 );
+
+ m_optSourceLists = new QLineEdit( container );
+ QWhatsThis::add( m_optSourceLists, tr( "Enter the directory where package source feed information is stored." ) );
+ layout->addWidget( m_optSourceLists, 7, 0 );
+ QPushButton *btn = new QPushButton( Resource::loadPixmap( "folder" ), QString::null, container );
+ btn->setMaximumWidth( btn->height() );
+ QWhatsThis::add( btn, tr( "Tap here to select the directory where package source feed information is stored." ) );
+ connect( btn, SIGNAL(clicked()), this, SLOT(slotOptSelectSourceListsPath()) );
+ layout->addWidget( btn, 7, 1 );
@@ -347,11 +367,7 @@ void OIpkgConfigDlg::initData()
{
- if ( config->type() == OConfItem::Source )
- {
- m_serverList->insertItem( config->name() );
- }
- else if ( config->type() == OConfItem::Destination )
+ switch ( config->type() )
{
- m_destList->insertItem( config->name() );
- }
- else if ( config->type() == OConfItem::Option )
+ case OConfItem::Source : m_serverList->insertItem( config->name() ); break;
+ case OConfItem::Destination : m_destList->insertItem( config->name() ); break;
+ case OConfItem::Option :
{
@@ -376,2 +392,13 @@ void OIpkgConfigDlg::initData()
}
+ break;
+ case OConfItem::Other :
+ {
+ if ( config->name() == "lists_dir" )
+ m_optSourceLists->setText( config->value() );
+ else // TODO - use proper libipkg define
+ m_optSourceLists->setText( "/usr/lib/ipkg/lists" );
+ }
+ break;
+ default : break;
+ };
}
@@ -515,2 +542,11 @@ void OIpkgConfigDlg::slotDestDelete()
+void OIpkgConfigDlg::slotOptSelectSourceListsPath()
+{
+ QString path = Opie::Ui::OFileDialog::getDirectory( 0, m_optSourceLists->text() );
+ if ( path.at( path.length() - 1 ) == '/' )
+ path.truncate( path.length() - 1 );
+ if ( !path.isNull() )
+ m_optSourceLists->setText( path );
+}
+
OIpkgServerDlg::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:
QComboBox *m_optVerboseIpkg; // Ipkg verbosity option selection
+ QLineEdit *m_optSourceLists; // Ipkg source lists destination directory
@@ -119,2 +120,4 @@ private slots:
void slotDestDelete();
+
+ void slotOptSelectSourceListsPath();
};
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)
Description: Opie package management client
-Version: 0.6.1$EXTRAVERSION
+Version: 0.6.2$EXTRAVERSION