浏览代码

link into ODBC also on upgrades and do not configure an additional ODBC data-source as this is useless without a particular 'Database' (filename)

Ralf S. Engelschall 17 年之前
父节点
当前提交
8bce633d84
共有 1 个文件被更改,包括 4 次插入8 次删除
  1. 4 8
      sqlite/sqlite.spec

+ 4 - 8
sqlite/sqlite.spec

@@ -37,7 +37,7 @@ Class:        BASE
 Group:        Database
 License:      PD
 Version:      %{V_sqlite}
-Release:      20080318
+Release:      20080323
 
 #   package options
 %option       with_assert          no
@@ -253,27 +253,23 @@ AutoReqProv:  no
     rm -rf $RPM_BUILD_ROOT
 
 %post
-    if [ $1 -eq 1 ]; then : ;
-        #   optionally link into ODBC
+    #   optionally link into ODBC
 %if "%{with_odbc}" == "yes"
+    if ! $RPM_INSTALL_PREFIX/bin/odbcinst -q -d -n "SQLite3" >/dev/null 2>&1; then
         ( echo "[SQLite3]"
           echo "Description     = SQLite 3 ODBC Driver"
           echo "Driver          = $RPM_INSTALL_PREFIX/lib/libsqlite3odbc.so"
           echo "Setup           = $RPM_INSTALL_PREFIX/lib/libsqlite3odbc.so"
           echo "FileUsage       = 1"
         ) | $RPM_INSTALL_PREFIX/bin/odbcinst -i -d -n "SQLite3" -r >/dev/null 2>&1 || true
-        ( echo "[SQLite3 DataSource]"
-          echo "Driver          = SQLite3"
-        ) | $RPM_INSTALL_PREFIX/bin/odbcinst -i -s -l -n "SQLite3 DataSource" -r >/dev/null 2>&1 || true
-%endif
     fi
+%endif
 
 %preun
     if [ $1 -eq 1 ]; then : ;
         #   optionally unlink from ODBC
 %if "%{with_odbc}" == "yes"
         $RPM_INSTALL_PREFIX/bin/odbcinst -u -s -l -n "SQLite3 DataSource" >/dev/null 2>&1 || true
-        $RPM_INSTALL_PREFIX/bin/odbcinst -u -d    -n "SQLite3"            >/dev/null 2>&1 || true
 %endif
     fi