Monday, August 8, 2011

upgrade Fedora 14 to Fedora 15

Since Fedora 15 was released for some time already, I upgraded my development server from Fedora 14 to Fedora 15 recently. Below is the command set I used to upgrade to Fedora 15. Before run those commands, I backup my virtual machine files in case.

# change account to Root account
[yyjia@jiaFedora14 ~]$ su
Password: 

# upgrade to latest rpm version
[root@jiaFedora14 yyjia]# yum upgrade rpm
Loaded plugins: langpacks, presto, refresh-packagekit
Adding en_US to language list
Zend                                       |  951 B     00:00     
Zend_noarch                                |  951 B     00:00     
fedora/metalink                            |  21 kB     00:00     
jenkins                                    |  951 B     00:00     
jenkins/primary                            | 1.3 kB     00:00     
jenkins                                                                     1/1
updates/metalink                           |  13 kB     00:00     
updates                                    | 4.7 kB     00:00     
updates/primary_db                         | 6.5 MB     00:07     
Setting up Upgrade Process
No Packages marked for Update
[root@jiaFedora14 yyjia]# 

#make sure I have latest packages installed.
[root@jiaFedora14 yyjia]# yum -y update

#clean up yum cache.
[root@jiaFedora14 yyjia]# yum clean all

#insall preupgrade package.
[root@jiaFedora14 yyjia]# yum install preupgrade

#running preupgrade
[root@jiaFedora14 yyjia]# preupgrade

After running preupgrade, we have below screen. I don't want to try Fedora 16 beta version. So, I selected Fedora 15.

I followed instructions shown on the screen. Then, I have a below screen to ask for reboot.

After reboot, the upgrade process starts.


Here is upgrade manual from Fedora web site: http://fedoraproject.org/wiki/YumUpgradeFaq

Thursday, July 28, 2011

how Ext JS 4 deals with postprocessors and preprocessors?

I looked into source code of Ext.ClassManager recently. But, I found that I can not understand it. Actually, I think it is a bug?

According to the signature of Ext.ClassManager.create function, It seems that developer can pass in postprocessors in configuration data. However, I think the postprocessors in configuration data will overwrite ClassManager's default postProcessors.

I put sample code to show what happen once we apply "||" operator to two JavaScript arrays. I cited the source code as below and add several lines comments there. Similar things happen to preprocessors in Class.js .

code snippet to show || operator on JavaScript arrays

The output of above code is:
Array is:
0
1
Another array is:
2
3
4
Now, let's see what happens in ClassManager.js: Code snippet cited from ClassManager.js
return new Class(data, function() {
                //If I pass in data having postprocessors,
                //all default postprocessors is going to ignored? 
                var postprocessorStack = data.postprocessors || manager.defaultPostprocessors,
                    registeredPostprocessors = manager.postprocessors,
                    index = 0,
                    postprocessors = [],
                    postprocessor, postprocessors, process, i, ln;

                delete data.postprocessors;

                //if my data has just one postprocessor, 
                //doesn't postprocessorStack.length only equal to 1?  
                for (i = 0, ln = postprocessorStack.length; i < ln; i++) {
                    postprocessor = postprocessorStack[i];

                    if (typeof postprocessor === 'string') {
                        postprocessor = registeredPostprocessors[postprocessor];

                        if (!postprocessor.always) {
                            if (data[postprocessor.name] !== undefined) {
                                postprocessors.push(postprocessor.fn);
                            }
                        }
                        else {
                            postprocessors.push(postprocessor.fn);
                        }
                    }
                    else {
                        postprocessors.push(postprocessor);
                    }
                }

                process = function(clsName, cls, clsData) {
                    postprocessor = postprocessors[index++];

                    if (!postprocessor) {
                        manager.set(className, cls);

                        Ext.Loader.historyPush(className);

                        if (createdFn) {
                            createdFn.call(cls, cls);
                        }

                        return;
                    }

                    if (postprocessor.call(this, clsName, cls, clsData, process) !== false) {
                        process.apply(this, arguments);
                    }
                };

                process.call(manager, className, this, data);
            }

I reported a bug here to see if I am right or it is just because I do not understand the code. Please feel free to make comments below if I am wrong.