[Gelistirici] Gnome ActionAPI

S.Çağlar Onur caglar at pardus.org.tr
30 Haz 2007 Cmt 23:37:28 EEST


Selamlar;

30 Haz 2007 Cts tarihinde, Eren Türkay şunları yazmıştı: 
> Bu arada autotools.py'de bir şey dikkatimi çekti. fixInfoDir() install
> işlemi başarılı olsa da, olmasa da çalışıyor, install işlemi başarılı
> olduktan sonra çalıştırılması lazım.

Bu doğru bir değişiklik, test edip depoya göndereceğim, teşekkürler.

> Autotools'a (ve gnome'a) fixIconCache() methodu ekledim, icon-cache
> güncellenip install dizinine atılınca conflict oluşuyor, sadece gnome'a
> özgür bir şey olmadığı için autotoolsda da yer alması mantıklı gibi
> geldi. Bkz.: Xfce, autotools ile kurulum gerçekleşiyor ve bazı
> uygulamaları icon-cache güncelliyor.

NAK, autotools autotools ailesinin modeli, autotools kullanan uygulamaların 
yaptıkları şeylerin bulunduğu yer değil. 

Bu bir yere eklenecekse GNOME içine olmalı bu, hicolor gayet GNOME'a özgü 
birşey :) ve evet fixInfoDir kardeşde aslında buraya ait değil.

> Ayrıca libgnome paketine PackageHandler gelecek. Eğer /etc/gconf'da
> şema varsa gconf şemasını yükleyecek. /usr/share/omf'de dosya varsa
> scrollkeeper-databaseini güncelleycek, /usr/share/icons/hicolor'da icon
> varsa "gtk-update-icon-cache" çağıracak.

Okke

> Yorumlar, öneriler, görüşler?

gnome.py'ye gelince (keşke inline yollasaydın [İleti menüsü, Dosya ekle 
seçeneği ile]), yorumlar aralarda;

Index: gnome.py
===================================================================
--- gnome.py	(revision 0)
+++ gnome.py	(revision 0)
@@ -0,0 +1,147 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2005 - 2007, TUBITAK/UEKAE
+#
+# This program is free software; you can redistribute it and/or modify it 
under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# Please read the COPYING file.
+
+# Standard Python Modules
+import os
+
+import gettext
+__trans = gettext.translation('pisi', fallback=True)
+_ = __trans.ugettext
+
+# Pisi Modules
+import pisi.context as ctx
+
+# ActionsAPI Modules
+import pisi.actionsapi
+import pisi.actionsapi.get as get
+from pisi.actionsapi.shelltools import system
+from pisi.actionsapi.shelltools import can_access_file
+from pisi.actionsapi.shelltools import unlink
+from pisi.actionsapi.shelltools import export
+from pisi.actionsapi.pisitools import dosed
+from pisi.actionsapi.autotools import automake
+from pisi.actionsapi.libtools import gnuconfig_update
+
+class ConfigureError(pisi.actionsapi.Error):
+    def __init__(self, value=''):
+        pisi.actionsapi.Error.__init__(self, value)
+        self.value = value
+        ctx.ui.error(value)
+        if can_access_file('config.log'):
+            ctx.ui.error(_('Please attach the config.log to your bug report:
\n%s/config.log') % os.getcwd())
+
+class MakeError(pisi.actionsapi.Error):
+    def __init__(self, value=''):
+        pisi.actionsapi.Error.__init__(self, value)
+        self.value = value
+        ctx.ui.error(value)
+
+class InstallError(pisi.actionsapi.Error):
+    def __init__(self, value=''):
+        pisi.actionsapi.Error.__init__(self, value)
+        self.value = value
+        ctx.ui.error(value)
+
+class RunTimeError(pisi.actionsapi.Error):
+    def __init__(self, value=''):
+        pisi.actionsapi.Error.__init__(self, value)
+        self.value = value
+        ctx.ui.error(value)
+
+def configure(parameters = ''):
+    '''configure source with given parameters 
= "--with-nls --with-libusb --with-something-usefull"'''
+    if can_access_file('configure'):
+        gnuconfig_update()
+
+        # sed all scrollkeeper-update commands, it may cause scrollkeeper 
database updating even if we set --disable-scrollkeeper
+        for root, dirs, files in os.walk(get.workDIR()):
+            if "gnome-doc-utils.make" in files:
+                
dosed(os.path.join(root, "gnome-doc-utils.make"), "scrollkeeper-update", "echo")


Bu çok acayip neden silmiyoruz da echo ile değiştiriyoruz?


+        automake()

Neden her paket için automake çağırıyoruz? Tamam yukarda make arkadaşı 
değiştirdiğimiz için geçerli ama eski bir libtools ile oluşturulmuş bir paket 
libtoolize isteyecek v.s v.s. ve bu durumu actionsAPI ile kontrol etmek 
olanaksıza yakın (libtool.sh aç parse et versiyonunu bul v.s)

Bu takla yerine ilgili paketlere bu değişiklikler yama ile eklenmeli, bu kısma 
NACK


+        export("GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL", "1")
+
+        args = './configure \
+                --prefix=/%s \
+                --host=%s \
+                --mandir=/%s \
+                --infodir=/%s \
+                --datadir=/%s \
+                --sysconfdir=/%s \
+                --localstatedir=/%s \
+                --with-x \
+                --disable-scrollkeeper \
+                --disable-schemas-install \
+                %s' % (get.defaultprefixDIR(), \
+                       get.HOST(), get.manDIR(), \
+                       get.infoDIR(), get.dataDIR(), \
+                       get.confDIR(), get.localstateDIR(), parameters)
+
+        if system(args):
+            raise ConfigureError(_('Configure failed.'))
+    else:
+        raise ConfigureError(_('No configure script found.'))

GNOME'u da KDE gibi /usr/gnome altına mı koysak acaba? 

+def make(parameters = ''):
+    '''make source with given parameters = "all" || "doc" etc.'''
+    if system('make %s %s' % (get.makeJOBS(), parameters)):
+            raise MakeError(_('Make failed.'))
+
+def fixInfoDir():
+    infoDir = "%s/usr/share/info/dir" % get.installDIR()
+    if can_access_file(infoDir):
+        unlink(infoDir)

Tekrar yazma autotoolsdakini kullan demek ister gönül ama şu anki hali ile 
actionsAPI güzel durumda değil, ilerde düzelecek diyelim :)

+def fixIconCache():
+    if can_access_file("%s/usr/share/icons/hicolor/icon-theme.cache" % 
get.installDIR()):
+        unlink("%s/usr/share/icons/hicolor/icon-theme.cache" % 
get.installDIR())

autotools yerine burda olması doğru.

Bu hali ile baktığımda autotools.py ile arasında fark göremiyorum (bir 
değişken export etmek, configure'e 2 ek parametre vermek ve olmaması gereken 
bir dosed/automake serisi dışında), gerçekten bir gnome.py'ye ihtiyacımız var 
mı?

Saygılar
-- 
S.Çağlar Onur <caglar at pardus.org.tr>
http://cekirdek.pardus.org.tr/~caglar/

Linux is like living in a teepee. No Windows, no Gates and an Apache in house!
-------------- sonraki bölüm --------------
A non-text attachment was scrubbed...
Name: kullanılamıyor
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://liste.pardus.org.tr/gelistirici/attachments/20070630/8a4a8a09/attachment-0002.pgp>


Gelistirici mesaj listesiyle ilgili daha fazla bilgi