o Update to -> 1.3.5

Changelog: http://amarok.kde.org/content/view/64/66/
o Retire patches that have been comitted upstream
o Add patch to fix "auto scan" with PostgreSQL
This commit is contained in:
Michael Landin 2005-10-25 15:29:07 +00:00
parent 8cc1630ba9
commit 4e91fc74ed
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=146331
12 changed files with 210 additions and 150 deletions

View file

@ -5,8 +5,7 @@
# $FreeBSD$
PORTNAME= amarok
PORTVERSION= 1.3.3
PORTREVISION= 1
PORTVERSION= 1.3.5
CATEGORIES= audio kde
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_EXTENDED}
MASTER_SITE_SUBDIR= ${PORTNAME}

View file

@ -1,2 +1,2 @@
MD5 (amarok-1.3.3.tar.bz2) = 13f02c3cce06d9c1d0511171d736efa3
SIZE (amarok-1.3.3.tar.bz2) = 7665719
MD5 (amarok-1.3.5.tar.bz2) = faac790ea432a784fa7d1ac6a34ee410
SIZE (amarok-1.3.5.tar.bz2) = 8450003

View file

@ -0,0 +1,91 @@
$FreeBSD$
--- amarok/src/collectiondb.cpp.orig
+++ amarok/src/collectiondb.cpp
@@ -290,15 +290,18 @@
QString yearAutoIncrement = "";
if ( m_dbConnPool->getDbConnectionType() == DbConnection::postgresql )
{
- query( QString( "CREATE %1 SEQUENCE album_seq%2;" ).arg( conn ? "TEMPORARY" : "").arg( conn ? "_temp" : ""), conn );
- query( QString( "CREATE %1 SEQUENCE artist_seq%2;" ).arg( conn ? "TEMPORARY" : "").arg( conn ? "_temp" : ""), conn );
- query( QString( "CREATE %1 SEQUENCE genre_seq%2;" ).arg( conn ? "TEMPORARY" : "").arg( conn ? "_temp" : ""), conn );
- query( QString( "CREATE %1 SEQUENCE year_seq%2;" ).arg( conn ? "TEMPORARY" : "").arg( conn ? "_temp" : ""), conn );
+ if(!conn)
+ {
+ query( QString( "CREATE SEQUENCE album_seq;" ), conn );
+ query( QString( "CREATE SEQUENCE artist_seq;" ), conn );
+ query( QString( "CREATE SEQUENCE genre_seq;" ), conn );
+ query( QString( "CREATE SEQUENCE year_seq;" ), conn );
+ }
- albumAutoIncrement = QString("DEFAULT nextval('album_seq%1')").arg( conn ? "_temp" : "");
- artistAutoIncrement = QString("DEFAULT nextval('artist_seq%1')").arg( conn ? "_temp" : "");
- genreAutoIncrement = QString("DEFAULT nextval('genre_seq%1')").arg( conn ? "_temp" : "");
- yearAutoIncrement = QString("DEFAULT nextval('year_seq%1')").arg( conn ? "_temp" : "");
+ albumAutoIncrement = QString("DEFAULT nextval('album_seq')");
+ artistAutoIncrement = QString("DEFAULT nextval('artist_seq')");
+ genreAutoIncrement = QString("DEFAULT nextval('genre_seq')");
+ yearAutoIncrement = QString("DEFAULT nextval('year_seq')");
}
else if ( m_dbConnPool->getDbConnectionType() == DbConnection::mysql )
{
@@ -412,10 +415,12 @@
if ( m_dbConnPool->getDbConnectionType() == DbConnection::postgresql )
{
- query( QString( "DROP SEQUENCE album_seq%1;" ).arg( conn ? "_temp" : ""), conn );
- query( QString( "DROP SEQUENCE artist_seq%1;" ).arg( conn ? "_temp" : ""), conn );
- query( QString( "DROP SEQUENCE genre_seq%1;" ).arg( conn ? "_temp" : ""), conn );
- query( QString( "DROP SEQUENCE year_seq%1;" ).arg( conn ? "_temp" : ""), conn );
+ if (conn == NULL) {
+ query( QString( "DROP SEQUENCE album_seq;" ), conn );
+ query( QString( "DROP SEQUENCE artist_seq;" ), conn );
+ query( QString( "DROP SEQUENCE genre_seq;" ), conn );
+ query( QString( "DROP SEQUENCE year_seq;" ), conn );
+ }
}
}
@@ -1461,10 +1466,26 @@
path = path.left( path.length() - 1 );
if (m_dbConnPool->getDbConnectionType() == DbConnection::postgresql) {
- query( QString( "UPDATE directories%1 SET changedate=%2 WHERE dir='%3';")
- .arg( conn ? "_temp" : "" )
- .arg( datetime )
- .arg( escapeString( path ) ), conn );
+ // REPLACE INTO is not valid SQL for postgres, so we need to check whether we
+ // should UPDATE() or INSERT()
+ QStringList values = query(QString("SELECT * FROM directories%1 WHERE dir='%2';")
+ .arg( conn ? "_temp" : "")
+ .arg( escapeString( path ) ), conn );
+
+ if(values.count() > 0 )
+ {
+ query( QString( "UPDATE directories%1 SET changedate=%2 WHERE dir='%3';")
+ .arg( conn ? "_temp" : "" )
+ .arg( datetime )
+ .arg( escapeString( path ) ), conn );
+ }
+ else
+ {
+ query( QString( "INSERT INTO directories%1 (dir,changedate) VALUES ('%2','%3');")
+ .arg( conn ? "_temp" : "")
+ .arg( escapeString( path ) )
+ .arg( datetime ), conn );
+ }
}
else
{
@@ -2429,9 +2450,7 @@
QString _table = table;
if (table.find("_temp") > 0) _table = table.left(table.find("_temp"));
- /* this does not work with postgres
- curvalSql = QString("SELECT currval('%1_seq');").arg(_table); */
- curvalSql = QString("SELECT last_value FROM %1_seq;").arg(_table);
+ curvalSql = QString("SELECT currval('%1_seq');").arg(_table);
result = PQexec(m_db, curvalSql.utf8());
if (result == NULL)
{

View file

@ -1,54 +0,0 @@
$FreeBSD$
--- amarok/src/smartplaylisteditor.cpp.orig
+++ amarok/src/smartplaylisteditor.cpp
@@ -387,9 +387,9 @@
joins += " INNER JOIN statistics ON statistics.url=tags.url";
}
if ( !criteriaListStr.isEmpty() )
- whereStr = QString(" WHERE (%1) AND %2 = \"(*ExpandString*)\"").arg(criteriaListStr).arg(field);
+ whereStr = QString(" WHERE (%1) AND %2 = '(*ExpandString*)'").arg(criteriaListStr).arg(field);
else
- whereStr = QString("WHERE %1 = \"(*ExpandString*)\"").arg(field);
+ whereStr = QString("WHERE %1 = '(*ExpandString*)'").arg(field);
m_expandQuery = "SELECT album.name, artist.name, genre.name, tags.title, year.name, "
"tags.comment, tags.track, tags.bitrate, tags.length, tags.samplerate, tags.url"
" FROM " + joins + whereStr + orderStr + limitStr + ";";
@@ -614,16 +614,16 @@
if( criteria == i18n("contains") )
- searchCriteria += " LIKE \"%" + value + "%\"";
+ searchCriteria += " LIKE '%" + value + "%'";
else if( criteria == i18n("does not contain") )
- searchCriteria += " NOT LIKE \"%" + value + "%\"";
+ searchCriteria += " NOT LIKE '%" + value + "%'";
else if( criteria == i18n("is") ) {
if( m_currentValueType == Date )
searchCriteria += " BETWEEN ";
else
searchCriteria += " = ";
if( m_currentValueType == String || m_currentValueType == AutoCompletionString )
- value.prepend("\"").append("\"");
+ value.prepend("'").append("'");
searchCriteria += value;
if (field=="statistics.playcounter" && value=="0") {
searchCriteria += " OR statistics.playcounter IS NULL";
@@ -635,13 +635,13 @@
else
searchCriteria += " <> ";
if( m_currentValueType == String || m_currentValueType == AutoCompletionString )
- value.prepend("\"").append("\"");
+ value.prepend("'").append("'");
searchCriteria += value;
}
else if( criteria == i18n("starts with") )
- searchCriteria += " LIKE \"" + value + "%\"";
+ searchCriteria += " LIKE '" + value + "%'";
else if( criteria == i18n("ends with") )
- searchCriteria += " LIKE \"%" + value + "\"";
+ searchCriteria += " LIKE '%" + value + "'";
else if( criteria == i18n("is greater than") || criteria == i18n("is after") )
searchCriteria += " > " + value;
else if( criteria == i18n("is smaller than") || criteria == i18n("is before" ) )

View file

@ -1,16 +0,0 @@
$FreeBSD$
--- amarok/src/socketserver.cpp.orig
+++ amarok/src/socketserver.cpp
@@ -47,8 +47,9 @@
class AmaroKProcess : public KProcess {
public:
virtual int commSetupDoneC() {
+ int i = KProcess::commSetupDoneC();
amaroK::closeOpenFiles(KProcess::out[0],KProcess::in[0], KProcess::err[0]);
- return KProcess::commSetupDoneC();
+ return i;
};
};

View file

@ -92,6 +92,7 @@ share/apps/amarok/images/volumeslider-handle_glow.png
share/apps/amarok/images/wizard_compact.png
share/apps/amarok/images/wizard_xmms.png
share/apps/amarok/images/xine_logo.png
share/apps/amarok/scripts/alarm/COPYING
share/apps/amarok/scripts/alarm/README
share/apps/amarok/scripts/alarm/alarm.py
share/apps/amarok/scripts/amarok_live/README
@ -176,28 +177,37 @@ share/doc/HTML/de/amarok/collection.png
share/doc/HTML/de/amarok/common
share/doc/HTML/de/amarok/config.docbook
share/doc/HTML/de/amarok/config_appearance.png
share/doc/HTML/de/amarok/config_collection.png
share/doc/HTML/de/amarok/config_engine.png
share/doc/HTML/de/amarok/config_general.png
share/doc/HTML/de/amarok/config_osd.png
share/doc/HTML/de/amarok/config_playback.png
share/doc/HTML/de/amarok/config_scrobbler.png
share/doc/HTML/de/amarok/context.png
share/doc/HTML/de/amarok/coverman.png
share/doc/HTML/de/amarok/develop.docbook
share/doc/HTML/de/amarok/dynamic_mode1.png
share/doc/HTML/de/amarok/dynamic_mode2.png
share/doc/HTML/de/amarok/equalizer.png
share/doc/HTML/de/amarok/faq.docbook
share/doc/HTML/de/amarok/file_browser.png
share/doc/HTML/de/amarok/hidden.docbook
share/doc/HTML/de/amarok/index.cache.bz2
share/doc/HTML/de/amarok/index.docbook
share/doc/HTML/de/amarok/logo.png
share/doc/HTML/de/amarok/media_device.png
share/doc/HTML/de/amarok/menubar.png
share/doc/HTML/de/amarok/musicbrainz.png
share/doc/HTML/de/amarok/pl_browser.png
share/doc/HTML/de/amarok/pl_tip1.png
share/doc/HTML/de/amarok/play_list.png
share/doc/HTML/de/amarok/player_window.png
share/doc/HTML/de/amarok/playlist_window.png
share/doc/HTML/de/amarok/queue_manager.png
share/doc/HTML/de/amarok/quick.docbook
share/doc/HTML/de/amarok/requirements.docbook
share/doc/HTML/de/amarok/rmb_menu.png
share/doc/HTML/de/amarok/search.png
share/doc/HTML/de/amarok/script_manager.png
share/doc/HTML/de/amarok/status_bar.png
share/doc/HTML/de/amarok/using.docbook
share/doc/HTML/de/amarok/vis_window.png

View file

@ -5,8 +5,7 @@
# $FreeBSD$
PORTNAME= amarok
PORTVERSION= 1.3.3
PORTREVISION= 1
PORTVERSION= 1.3.5
CATEGORIES= audio kde
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_EXTENDED}
MASTER_SITE_SUBDIR= ${PORTNAME}

View file

@ -1,2 +1,2 @@
MD5 (amarok-1.3.3.tar.bz2) = 13f02c3cce06d9c1d0511171d736efa3
SIZE (amarok-1.3.3.tar.bz2) = 7665719
MD5 (amarok-1.3.5.tar.bz2) = faac790ea432a784fa7d1ac6a34ee410
SIZE (amarok-1.3.5.tar.bz2) = 8450003

View file

@ -0,0 +1,91 @@
$FreeBSD$
--- amarok/src/collectiondb.cpp.orig
+++ amarok/src/collectiondb.cpp
@@ -290,15 +290,18 @@
QString yearAutoIncrement = "";
if ( m_dbConnPool->getDbConnectionType() == DbConnection::postgresql )
{
- query( QString( "CREATE %1 SEQUENCE album_seq%2;" ).arg( conn ? "TEMPORARY" : "").arg( conn ? "_temp" : ""), conn );
- query( QString( "CREATE %1 SEQUENCE artist_seq%2;" ).arg( conn ? "TEMPORARY" : "").arg( conn ? "_temp" : ""), conn );
- query( QString( "CREATE %1 SEQUENCE genre_seq%2;" ).arg( conn ? "TEMPORARY" : "").arg( conn ? "_temp" : ""), conn );
- query( QString( "CREATE %1 SEQUENCE year_seq%2;" ).arg( conn ? "TEMPORARY" : "").arg( conn ? "_temp" : ""), conn );
+ if(!conn)
+ {
+ query( QString( "CREATE SEQUENCE album_seq;" ), conn );
+ query( QString( "CREATE SEQUENCE artist_seq;" ), conn );
+ query( QString( "CREATE SEQUENCE genre_seq;" ), conn );
+ query( QString( "CREATE SEQUENCE year_seq;" ), conn );
+ }
- albumAutoIncrement = QString("DEFAULT nextval('album_seq%1')").arg( conn ? "_temp" : "");
- artistAutoIncrement = QString("DEFAULT nextval('artist_seq%1')").arg( conn ? "_temp" : "");
- genreAutoIncrement = QString("DEFAULT nextval('genre_seq%1')").arg( conn ? "_temp" : "");
- yearAutoIncrement = QString("DEFAULT nextval('year_seq%1')").arg( conn ? "_temp" : "");
+ albumAutoIncrement = QString("DEFAULT nextval('album_seq')");
+ artistAutoIncrement = QString("DEFAULT nextval('artist_seq')");
+ genreAutoIncrement = QString("DEFAULT nextval('genre_seq')");
+ yearAutoIncrement = QString("DEFAULT nextval('year_seq')");
}
else if ( m_dbConnPool->getDbConnectionType() == DbConnection::mysql )
{
@@ -412,10 +415,12 @@
if ( m_dbConnPool->getDbConnectionType() == DbConnection::postgresql )
{
- query( QString( "DROP SEQUENCE album_seq%1;" ).arg( conn ? "_temp" : ""), conn );
- query( QString( "DROP SEQUENCE artist_seq%1;" ).arg( conn ? "_temp" : ""), conn );
- query( QString( "DROP SEQUENCE genre_seq%1;" ).arg( conn ? "_temp" : ""), conn );
- query( QString( "DROP SEQUENCE year_seq%1;" ).arg( conn ? "_temp" : ""), conn );
+ if (conn == NULL) {
+ query( QString( "DROP SEQUENCE album_seq;" ), conn );
+ query( QString( "DROP SEQUENCE artist_seq;" ), conn );
+ query( QString( "DROP SEQUENCE genre_seq;" ), conn );
+ query( QString( "DROP SEQUENCE year_seq;" ), conn );
+ }
}
}
@@ -1461,10 +1466,26 @@
path = path.left( path.length() - 1 );
if (m_dbConnPool->getDbConnectionType() == DbConnection::postgresql) {
- query( QString( "UPDATE directories%1 SET changedate=%2 WHERE dir='%3';")
- .arg( conn ? "_temp" : "" )
- .arg( datetime )
- .arg( escapeString( path ) ), conn );
+ // REPLACE INTO is not valid SQL for postgres, so we need to check whether we
+ // should UPDATE() or INSERT()
+ QStringList values = query(QString("SELECT * FROM directories%1 WHERE dir='%2';")
+ .arg( conn ? "_temp" : "")
+ .arg( escapeString( path ) ), conn );
+
+ if(values.count() > 0 )
+ {
+ query( QString( "UPDATE directories%1 SET changedate=%2 WHERE dir='%3';")
+ .arg( conn ? "_temp" : "" )
+ .arg( datetime )
+ .arg( escapeString( path ) ), conn );
+ }
+ else
+ {
+ query( QString( "INSERT INTO directories%1 (dir,changedate) VALUES ('%2','%3');")
+ .arg( conn ? "_temp" : "")
+ .arg( escapeString( path ) )
+ .arg( datetime ), conn );
+ }
}
else
{
@@ -2429,9 +2450,7 @@
QString _table = table;
if (table.find("_temp") > 0) _table = table.left(table.find("_temp"));
- /* this does not work with postgres
- curvalSql = QString("SELECT currval('%1_seq');").arg(_table); */
- curvalSql = QString("SELECT last_value FROM %1_seq;").arg(_table);
+ curvalSql = QString("SELECT currval('%1_seq');").arg(_table);
result = PQexec(m_db, curvalSql.utf8());
if (result == NULL)
{

View file

@ -1,54 +0,0 @@
$FreeBSD$
--- amarok/src/smartplaylisteditor.cpp.orig
+++ amarok/src/smartplaylisteditor.cpp
@@ -387,9 +387,9 @@
joins += " INNER JOIN statistics ON statistics.url=tags.url";
}
if ( !criteriaListStr.isEmpty() )
- whereStr = QString(" WHERE (%1) AND %2 = \"(*ExpandString*)\"").arg(criteriaListStr).arg(field);
+ whereStr = QString(" WHERE (%1) AND %2 = '(*ExpandString*)'").arg(criteriaListStr).arg(field);
else
- whereStr = QString("WHERE %1 = \"(*ExpandString*)\"").arg(field);
+ whereStr = QString("WHERE %1 = '(*ExpandString*)'").arg(field);
m_expandQuery = "SELECT album.name, artist.name, genre.name, tags.title, year.name, "
"tags.comment, tags.track, tags.bitrate, tags.length, tags.samplerate, tags.url"
" FROM " + joins + whereStr + orderStr + limitStr + ";";
@@ -614,16 +614,16 @@
if( criteria == i18n("contains") )
- searchCriteria += " LIKE \"%" + value + "%\"";
+ searchCriteria += " LIKE '%" + value + "%'";
else if( criteria == i18n("does not contain") )
- searchCriteria += " NOT LIKE \"%" + value + "%\"";
+ searchCriteria += " NOT LIKE '%" + value + "%'";
else if( criteria == i18n("is") ) {
if( m_currentValueType == Date )
searchCriteria += " BETWEEN ";
else
searchCriteria += " = ";
if( m_currentValueType == String || m_currentValueType == AutoCompletionString )
- value.prepend("\"").append("\"");
+ value.prepend("'").append("'");
searchCriteria += value;
if (field=="statistics.playcounter" && value=="0") {
searchCriteria += " OR statistics.playcounter IS NULL";
@@ -635,13 +635,13 @@
else
searchCriteria += " <> ";
if( m_currentValueType == String || m_currentValueType == AutoCompletionString )
- value.prepend("\"").append("\"");
+ value.prepend("'").append("'");
searchCriteria += value;
}
else if( criteria == i18n("starts with") )
- searchCriteria += " LIKE \"" + value + "%\"";
+ searchCriteria += " LIKE '" + value + "%'";
else if( criteria == i18n("ends with") )
- searchCriteria += " LIKE \"%" + value + "\"";
+ searchCriteria += " LIKE '%" + value + "'";
else if( criteria == i18n("is greater than") || criteria == i18n("is after") )
searchCriteria += " > " + value;
else if( criteria == i18n("is smaller than") || criteria == i18n("is before" ) )

View file

@ -1,16 +0,0 @@
$FreeBSD$
--- amarok/src/socketserver.cpp.orig
+++ amarok/src/socketserver.cpp
@@ -47,8 +47,9 @@
class AmaroKProcess : public KProcess {
public:
virtual int commSetupDoneC() {
+ int i = KProcess::commSetupDoneC();
amaroK::closeOpenFiles(KProcess::out[0],KProcess::in[0], KProcess::err[0]);
- return KProcess::commSetupDoneC();
+ return i;
};
};

View file

@ -92,6 +92,7 @@ share/apps/amarok/images/volumeslider-handle_glow.png
share/apps/amarok/images/wizard_compact.png
share/apps/amarok/images/wizard_xmms.png
share/apps/amarok/images/xine_logo.png
share/apps/amarok/scripts/alarm/COPYING
share/apps/amarok/scripts/alarm/README
share/apps/amarok/scripts/alarm/alarm.py
share/apps/amarok/scripts/amarok_live/README
@ -176,28 +177,37 @@ share/doc/HTML/de/amarok/collection.png
share/doc/HTML/de/amarok/common
share/doc/HTML/de/amarok/config.docbook
share/doc/HTML/de/amarok/config_appearance.png
share/doc/HTML/de/amarok/config_collection.png
share/doc/HTML/de/amarok/config_engine.png
share/doc/HTML/de/amarok/config_general.png
share/doc/HTML/de/amarok/config_osd.png
share/doc/HTML/de/amarok/config_playback.png
share/doc/HTML/de/amarok/config_scrobbler.png
share/doc/HTML/de/amarok/context.png
share/doc/HTML/de/amarok/coverman.png
share/doc/HTML/de/amarok/develop.docbook
share/doc/HTML/de/amarok/dynamic_mode1.png
share/doc/HTML/de/amarok/dynamic_mode2.png
share/doc/HTML/de/amarok/equalizer.png
share/doc/HTML/de/amarok/faq.docbook
share/doc/HTML/de/amarok/file_browser.png
share/doc/HTML/de/amarok/hidden.docbook
share/doc/HTML/de/amarok/index.cache.bz2
share/doc/HTML/de/amarok/index.docbook
share/doc/HTML/de/amarok/logo.png
share/doc/HTML/de/amarok/media_device.png
share/doc/HTML/de/amarok/menubar.png
share/doc/HTML/de/amarok/musicbrainz.png
share/doc/HTML/de/amarok/pl_browser.png
share/doc/HTML/de/amarok/pl_tip1.png
share/doc/HTML/de/amarok/play_list.png
share/doc/HTML/de/amarok/player_window.png
share/doc/HTML/de/amarok/playlist_window.png
share/doc/HTML/de/amarok/queue_manager.png
share/doc/HTML/de/amarok/quick.docbook
share/doc/HTML/de/amarok/requirements.docbook
share/doc/HTML/de/amarok/rmb_menu.png
share/doc/HTML/de/amarok/search.png
share/doc/HTML/de/amarok/script_manager.png
share/doc/HTML/de/amarok/status_bar.png
share/doc/HTML/de/amarok/using.docbook
share/doc/HTML/de/amarok/vis_window.png