Recent Updates Toggle Comment Threads | Keyboard Shortcuts

  • justineleng 3:11 pm on August 25, 2011 Permalink | Reply  

    RubyGem CI::Reporter 

    As I was starting the OBS webserver earlier today, I ran into a missing-gem error:

    Missing these required gems:
      ci_reporter

    So I installed the gem.

    $ sudo gem install ci_reporter
    Fetching: ci_reporter-1.6.5.gem (100%)
    Successfully installed ci_reporter-1.6.5
    1 gem installed

    There was an error installing the documentation for ci_report:

    Installing ri documentation for ci_reporter-1.6.5...
    
    Invalid output formatter
    
    For help on options, try 'rdoc --help'
    
    ERROR:  While generating documentation for ci_reporter-1.6.5
    ... MESSAGE:   exit
    ... RDOC args: --ri --op /usr/lib/ruby/gems/1.8/doc/ci_reporter-1.6.5/ri --main README.txt -SHN -f darkfish --quiet lib History.txt Manifest.txt README.txt LICENSE.txt --title ci_reporter-1.6.5 Documentation
    (continuing with the rest of the installation)
    Installing RDoc documentation for ci_reporter-1.6.5...
    
    Invalid output formatter
    
    For help on options, try 'rdoc --help'
    
    ERROR:  While generating documentation for ci_reporter-1.6.5
    ... MESSAGE:   exit
    ... RDOC args: --op /usr/lib/ruby/gems/1.8/doc/ci_reporter-1.6.5/rdoc --main README.txt -SHN -f darkfish --quiet lib History.txt Manifest.txt README.txt LICENSE.txt --title ci_reporter-1.6.5 Documentation
    (continuing with the rest of the installation)

    But this error didn’t interfere with my starting the web server.

    Anyway, I was curious what ci_report was all about.

    CI::Reporter is an add-on to Test::Unit, RSpec and Cucumber that allows you to generate XML reports of your test, spec and/or feature runs. The resulting files can be read by a continuous integration system that understands Ant’s JUnit report XML format, thus allowing your CI system to track test/spec successes and failures.

    It looks like CI::Reporter works best with projects that use a Rakefile along with the standard Rake::TestTask or Spec::Rake::SpecTask/RSpec::Core::RakeTask tasks for running tests or examples, respectively. This way, it hooks into Test::Unit or RSpec using environment variables recognized by these custom tasks to inject the CI::Reporter code into the test or spec runs.

    There isn’t a fair amount of documentation on CI::Reporter yet, except: http://caldersphere.rubyforge.org/ci_reporter/

     

     
  • justineleng 3:10 pm on August 22, 2011 Permalink | Reply
    Tags: Fix “rake/rdoctask is deprecated. use rdoc/task instead”   

    Fix “rake/rdoctask is deprecated. Use rdoc/task instead” 

    Another problem I’ve run into while starting the obs web server after the system upgrade is:

    /build-service/src/webui> ./script/server
    => Booting WEBrick
    => Rails 2.3.11 application starting on http://0.0.0.0:3000
    No local development environment found: No such file or directory - /home/surfmonkey/branch/build-service/src/webui/config/environments/development.opensuse.rb
    Using global development environment /home/surfmonkey/branch/build-service/src/webui/config/environments/development_base.rb
    ** Erubis 2.6.6
    Missing these required gems:
     daemons  
    
    You're running:
      ruby 1.8.7.334 at /usr/bin/ruby
      rubygems 1.5.0 at /home/surfmonkey/.gem/ruby/1.8, /usr/lib/ruby/gems/1.8
    
    Run `rake gems:install` to install the missing gems.

    I don’t remember running into this problem before.

    $ rake gem:install daemons
    rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+)
    rake aborted!
    Don't know how to build task 'gem:install'

    The stack traces look like the following:

    /usr/lib/ruby/gems/1.8/gems/rake-0.9.1/lib/rake/task_manager.rb:49:in `[]'
    /usr/lib/ruby/gems/1.8/gems/rake-0.9.1/lib/rake/application.rb:111:in `invoke_task'
    /usr/lib/ruby/gems/1.8/gems/rake-0.9.1/lib/rake/application.rb:90:in `top_level'
    /usr/lib/ruby/gems/1.8/gems/rake-0.9.1/lib/rake/application.rb:90:in `each'
    /usr/lib/ruby/gems/1.8/gems/rake-0.9.1/lib/rake/application.rb:90:in `top_level'
    /usr/lib/ruby/gems/1.8/gems/rake-0.9.1/lib/rake/application.rb:129:in `standard_exception_handling'
    /usr/lib/ruby/gems/1.8/gems/rake-0.9.1/lib/rake/application.rb:84:in `top_level'
    /usr/lib/ruby/gems/1.8/gems/rake-0.9.1/lib/rake/application.rb:62:in `run'
    /usr/lib/ruby/gems/1.8/gems/rake-0.9.1/lib/rake/application.rb:129:in `standard_exception_handling'
    /usr/lib/ruby/gems/1.8/gems/rake-0.9.1/lib/rake/application.rb:59:in `run'
    /usr/lib/ruby/gems/1.8/gems/rake-0.9.1/bin/rake:32
    /usr/bin/rake:19:in `load'
    /usr/bin/rake:19

    So I open up my Rakefile and make these lines

    require 'rake'
    require 'rake/testtask'
    require 'rake/rdoctask'

    to

    require 'rake'
    require 'rake/testtask'
    require 'rdoc/task'

    Supposedly, I should also add gem “rdoc” to my Gemfile:

    $ cat /usr/lib/ruby/gems/1.8/gems/jquery-rails-1.0.9/Gemfile
    source :gemcutter
    
    # Specify your gem's dependencies in jquery-rails.gemspec
    gemspec
    # Rails is already being pulled in through gemspec
    # gem "rails", :git => "git://github.com/rails/rails.git"
    gem "rack", :git => "git://github.com/rack/rack.git"
    gem "sprockets", :git => "git://github.com/sstephenson/sprockets.git"
    gem "i18n", "0.6.0beta1"

    But I’m unable to overwrite the write permission:

    I don’t understand what’s going on. Deleting gemfile.lock wouldn’t help.

    Someone on the web suggested adding rdoc/ to my .gitignore, too.

    Anyway, I just go ahead and install the daemons:

    $ sudo gem install daemons
    Fetching: daemons-1.1.4.gem (100%)
    Successfully installed daemons-1.1.4
    1 gem installed
    Installing ri documentation for daemons-1.1.4...
    Installing RDoc documentation for daemons-1.1.4...

    So what are these daemons, after all?

    Daemons provides an easy way to wrap existing ruby scripts (for example, a self-written server) to be run as a daemon and to be controlled by simple start/stop/restart commands. You can also call blocks as daemons and control them from the parent or just daemonize the current process. Besides this basic functionality, daemons offers many advanced features like exception backtracing and logging (in case your ruby script crashes) and monitoring and automatic restarting of your processes if they crash.  — RubyGems.org

    Finally, I’m able to successfully start the web server:

    $ ./script/server
    => Booting WEBrick
    => Rails 2.3.11 application starting on http://0.0.0.0:3000
    No local development environment found: No such file or directory - /home/surfmonkey/branch/build-service/src/webui/config/environments/development.opensuse.rb
    Using global development environment /home/surfmonkey/branch/build-service/src/webui/config/environments/development_base.rb
    ** Erubis 2.6.6
    => Call with -d to detach
    => Ctrl-C to shutdown server
    [2011-08-22 16:03:59] INFO  WEBrick 1.3.1
    [2011-08-22 16:03:59] INFO  ruby 1.8.7 (2011-02-18) [i586-linux]
    [2011-08-22 16:03:59] INFO  WEBrick::HTTPServer#start: pid=9781 port=3000

    . . . . . .

     
    • justineleng 3:13 pm on August 22, 2011 Permalink | Reply

      Wait, why is it booting WEBrick instead of Mongrel? What happened to the Mongrel server that I’d installed on 11.3? Deleted during the system upgrade?

  • justineleng 2:38 pm on August 22, 2011 Permalink | Reply  

    libxml2 problems when installing nokogiri 

    Since I upgraded openSUSE 11.3 to 11.4, the dependencies in my local buildservice repository got updated as well. When I tried to start the web server, it failed:

    ~/branch/build-service/src/webui> ./script/server
    => Booting WEBrick
    => Rails 2.3.11 application starting on http://0.0.0.0:3000
    /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require': no such file to load -- nokogiri (MissingSourceFile)

    Nokogiri parses and searches XML/HTML very quickly, and also provides CSS3 selector support and XPath support for document searching.

    I installed the nokogiri parser before the system upgrade, but it might’ve gotten lost or updated during the upgrade. So I have to install nokogiri again on 11.4:

    ~/branch/build-service/src/webui> sudo gem install nokogiri
    Fetching: nokogiri-1.5.0.gem (100%)
    Building native extensions.  This could take a while...
    ERROR:  Error installing nokogiri:
            ERROR: Failed to build gem native extension.
    
            /usr/bin/ruby extconf.rb
    checking for libxml/parser.h... no
    -----
    libxml2 is missing.  please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
    -----
    *** extconf.rb failed ***
    Could not create Makefile due to some reason, probably lack of
    necessary libraries and/or headers.  Check the mkmf.log file for more
    details.  You may need configuration options.

    I remember seeing this problem before. The solution is to simply install the dependencies first:

    $ sudo zypper install libxml2
    Loading repository data...
    Reading installed packages...
    'libxml2' is already installed.
    No update candidate for 'libxml2-2.7.8-16.17.1.i586'. The highest available version is already installed.
    Resolving package dependencies...
    
    Nothing to do.

    The trick is to install libxml-devel package instead:

    $ sudo zypper install libxml2-devel
    Loading repository data...
    Reading installed packages...
    Resolving package dependencies...
    
    The following NEW packages are going to be installed:
      libxml2-devel ncurses-devel readline-devel 
    
    3 new packages to install.
    Overall download size: 2.6 MiB. After the operation, additional 18.9 MiB will be used.
    Continue? [y/n/?] (y): y
    Retrieving package ncurses-devel-5.7-14.1.i586 (1/3), 2.5 MiB (18.4 MiB unpacked)
    Retrieving: ncurses-devel-5.7-14.1.i586.rpm [done (230.3 KiB/s)]
    Retrieving package readline-devel-6.1-18.25.1.i586 (2/3), 42.0 KiB (75.0 KiB unpacked)
    Retrieving: readline-devel-6.1-18.25.1.i586.rpm [done (0 B/s)]
    Retrieving package libxml2-devel-2.7.8-16.17.1.i586 (3/3), 81.0 KiB (427.0 KiB unpacked)
    Retrieving: libxml2-devel-2.7.8-16.17.1.i586.rpm [done (165.1 KiB/s)]
    Installing: ncurses-devel-5.7-14.1 [done]
    Installing: readline-devel-6.1-18.25.1 [done]
    Installing: libxml2-devel-2.7.8-16.17.1 [done]

    Also, install libxslt-devel:

    $ sudo zypper install libxslt-devel
    Loading repository data...
    Reading installed packages...
    Resolving package dependencies...
    
    The following NEW packages are going to be installed:
      libgcrypt-devel libgpg-error-devel libxslt-devel 
    
    3 new packages to install.
    Overall download size: 355.0 KiB. After the operation, additional 2.0 MiB will be used.
    Continue? [y/n/?] (y): y
    Retrieving package libgpg-error-devel-1.9-4.1.i586 (1/3), 47.0 KiB (216.0 KiB unpacked)
    Retrieving: libgpg-error-devel-1.9-4.1.i586.rpm [done (156.2 KiB/s)]
    Retrieving package libgcrypt-devel-1.4.6-3.1.i586 (2/3), 106.0 KiB (183.0 KiB unpacked)
    Retrieving: libgcrypt-devel-1.4.6-3.1.i586.rpm [done (213.0 KiB/s)]
    Retrieving package libxslt-devel-1.1.26-2.1.i586 (3/3), 202.0 KiB (1.6 MiB unpacked)
    Retrieving: libxslt-devel-1.1.26-2.1.i586.rpm [done (228.3 KiB/s)]
    Installing: libgpg-error-devel-1.9-4.1 [done]
    Installing: libgcrypt-devel-1.4.6-3.1 [done]
    Installing: libxslt-devel-1.1.26-2.1 [done]

    It looks like nokogiri needs both of these two dependencies resolved first:

    ☑ libxml/parser.h 
    ☑ libxslt/xslt.h

    Thus, the requirements for installing nokogiri are:

    ✓ ruby 1.8 or 1.9
    ✓ libxml2
    ✓ libxml2-dev
    ✓ libxslt
    ✓ libxslt-dev

    Then, I’m able to install nokogiri:

    $ sudo gem install nokogiri
    Building native extensions.  This could take a while...
    Successfully installed nokogiri-1.5.0
    1 gem installed
    Installing ri documentation for nokogiri-1.5.0...
    No definition for get_options
    No definition for set_options
    No definition for parse_memory
    No definition for parse_file
    No definition for parse_with
    Installing RDoc documentation for nokogiri-1.5.0...
    • – – – – – –
     
    • Pavol Rusnak 3:41 pm on August 22, 2011 Permalink | Reply

      … or you can install rubygem-nokogiri from devel:languages:ruby:extensions OBS project. But you have to decide if you want to use always RPMs from the dlre repo or “gem install” method. Mixing both is usually a bad idea.

  • justineleng 11:19 pm on August 16, 2011 Permalink | Reply  

    Live Upgrade openSUSE 11.3 to 11.4 

    Doing a live upgrade in openSUSE to the latest version has certain advantages:

    • You only download the packages that need to be upgraded, saving a lot of bandwidth.
    • During the upgrade you can still use your system (although this is not recommended); the only downtime will be the reboot after the upgrade.
    • You do not have to write an ISO image to a DVD. You could also boot from 1) the Internet; or 2) a USB key, and install the rest from the Internet

    The disadvantages:

    • If, for any reason, the upgrade is interrupted (e.g., power outages, network disconnect) and the process can’t continue, you could be left with a broken system (that depends on where the process stopped, of course).
    • If you have multiple systems to upgrade, you consume bandwidth each time, which is less efficient than downloading an ISO image.

    The upgrade can be done on the command line or via the YaST module Wagon (if you are on an OpenSUSE desktop). Since the Wagon method is less tested than the command line update, we will use the command line method here for both servers and desktops.

    1. Install the latest updates

    Before doing the distribution upgrade, install the latest updates for OpenSUSE 11.3. Open a terminal and run

    $ sudo zypper repos --uri

    to check what repositories are used and enabled on the system.

    Make sure that the line that contains http://download.opensuse.org/update/11.3/ in the URI column reads “Yes” in the “Enabled” column:

    #  | Alias                               | Name                                | Enabled | Refresh | URI
    ---+-------------------------------------+-------------------------------------+---------+---------+--------------------------------------------------------------------------------------------
    1  | Packman Repository                  | Packman Repository                  | Yes     | Yes     | http://ftp.uni-erlangen.de/pub/mirrors/packman/suse/openSUSE_11.3
    2 | Updates for openSUSE 11.3 11.3-1.82 | Updates for openSUSE 11.3 11.3-1.82 | Yes | Yes | http://download.opensuse.org/update/11.3/
    3  | devel_languages_ruby_extensions     | Ruby Extensions (openSUSE_11.4)     | Yes     | No      | http://download.opensuse.org/repositories/devel:/languages:/ruby:/extensions/openSUSE_11.4/
    4  | google-chrome                       | google-chrome                       | Yes     | Yes     | http://dl.google.com/linux/chrome/rpm/stable/i386
    5  | openSUSE-11.3 11.3-1.82             | openSUSE-11.3 11.3-1.82             | Yes     | No      | cd:///?devices=/dev/sr0
    6  | openSUSE:Tools                      | openSUSE:Tools                      | Yes     | Yes     | http://download.opensuse.org/repositories/openSUSE:/Tools/openSUSE_11.3/
    7  | openSUSE_Tools                      | openSUSE.org tools (openSUSE_11.3)  | Yes     | No      | http://download.opensuse.org/repositories/openSUSE:/Tools/openSUSE_11.3/
    8  | packman                             | Packman repository (openSUSE_11.3)  | Yes     | No      | http://packman.inode.at/suse/openSUSE_11.3
    9  | repo-debug                          | openSUSE-11.3-Debug                 | No      | Yes     | http://download.opensuse.org/debug/distribution/11.3/repo/oss/
    10 | repo-non-oss                        | openSUSE-11.3-Non-Oss               | Yes     | Yes     | http://download.opensuse.org/distribution/11.3/repo/non-oss/
    11 | repo-oss                            | openSUSE-11.3-Oss                   | Yes     | Yes     | http://download.opensuse.org/distribution/11.3/repo/oss/
    12 | repo-source                         | openSUSE-11.3-Source                | No      | Yes     | http://download.opensuse.org/source/distribution/11.3/repo/oss/
    13 | ruby-devel                          | ruby-devel                          | Yes     | No      | http://download.opensuse.org/repositories/devel:/languages:/ruby:/extensions/openSUSE_11.3/
    14 | server-database-unstable            | server-database-unstable            | Yes     | Yes     | http://download.opensuse.org/repositories/server:/database:/UNSTABLE/openSUSE_11.3

    If the line reads “No” in the “Enabled” column, enable the repository as follows:

    $ sudo zypper modifyrepo --enable #Alias_name

    If there’s no repository with the URI http://download.opensuse.org/update/11.3/, then add the repository:

    $ sudo zypper addrepo --check --name 'openSUSE-11.3-Update' http://download.opensuse.org/update/11.3/ repo-update

    Now, install the latest updates:

    $ sudo zypper refresh
    Repository 'Packman Repository' is up to date.Repository 'Updates for openSUSE 11.3 11.3-1.82' is up to date.Repository 'Ruby Extensions (openSUSE_11.4)' is up to date.Repository 'google-chrome' is up to date.Repository 'openSUSE:Tools' is up to date.Repository 'openSUSE.org tools (openSUSE_11.3)' is up to date.Repository 'Packman repository (openSUSE_11.3)' is up to date.Repository 'openSUSE-11.3-Non-Oss' is up to date.Repository 'openSUSE-11.3-Oss' is up to date.Repository 'ruby-devel' is up to date.Repository 'server-database-unstable' is up to date.All repositories have been refreshed.

    And

    $ sudo zypper update
    Loading repository data...Reading installed packages...
    
    The following package updates will NOT be installed:
    gpg2 gstreamer-0_10 gstreamer-0_10-plugin-gnomevfs gstreamer-0_10-plugins-base k3b k3b-lang kaffeine libassuan0 libgstapp-0_10-0 libgstinterfaces-0_10-0 libgstreamer-0_10-0   libmariadbclient16 libmariadbclient_r16 libmysqlclient16 libsndfile libtag-extras1 libxine1 libxine1-gnome-vfs libxine1-pulse mjpegtools perl-Try-Tiny python-numpy rubygem-actionmailer-2_3   rubygem-actionpack-2_3 rubygem-activerecord-2_3 rubygem-activeresource-2_3 rubygem-activesupport-2_3 rubygem-daemons rubygem-delayed_job rubygem-exception_notification rubygem-libxml-ruby   rubygem-rack rubygem-rails-2_3 rubygem-rails_xss rubygem-rake rubygem-sqlite3 taglib 
    
    The following NEW packages are going to be installed:
    build-mkbaselibs build-mkdrpms libreoffice-languagetool-en obs-service-download_files obs-service-format_spec_file obs-service-source_validator perl-Package-Stash-XS  rubygem-rbx-require-relative 
    
    The following package is going to be REMOVED:
    OpenOffice_org-LanguageTool-en 
    
    The following packages are going to be upgraded:
    broadcom-wl build chromium-ffmpeg cpanspec dbus-1 flash-player foomatic-filters gimp gimp-help-browser gimp-module-hal gimp-plugins-python glib2 google-chrome-stable icedtea-web  inst-source-utils iproute2 kernel-default kernel-desktop libapr1 libapr-util1 libfreetype6 libsndfile libsoup-2_4-1 libxml2 obs-api obs-productconverter obs-server obs-service-extract_file  obs-service-recompress obs-service-set_version obs-service-tar_scm obs-source_service obs-utils obs-worker osc osc-source_validator perl-BSSolv perl-Package-Stash perl-Params-Util  perl-Parse-CPAN-Packages perl-YAML permissions preload-kmp-default preload-kmp-desktop pullin-msttf-fonts rubygem-columnize rubygem-gem_plugin rubygem-linecache rubygem-mongrel  rubygem-ruby-debug rubygem-ruby-debug-base telnet udisks yast2-mail
    54 packages to upgrade, 8 new, 1 to remove.Overall download size: 123.6 MiB. 
    
    After the operation, additional 11.8 MiB will be used.Continue? [y/n/?] (y): y
    
    In order to install 'flash-player', you must agree to terms of the following license agreement:
    Do you agree with the terms of the license? [yes/no] (no): yes

    Then kick back, and let zypper retrieve and install / upgrade these packages.

    There are some running programs that use files deleted by recent upgrade.
    You may wish to restart some of them. Run 'zypper ps' to list these programs.

    2. Run the distribution upgrade

    Now that the latest updates are installed, disable all OpenSUSE 11.3 repositories:

    $ sudo zypper modifyrepo --all --disable
    Repository 'Packman Repository' has been successfully disabled.
    Repository 'Updates for openSUSE 11.3 11.3-1.82' has been successfully disabled.
    Repository 'devel_languages_ruby_extensions' has been successfully disabled.
    Repository 'google-chrome' has been successfully disabled.
    Repository 'openSUSE-11.3 11.3-1.82' has been successfully disabled.
    Repository 'openSUSE:Tools' has been successfully disabled.
    Repository 'openSUSE_Tools' has been successfully disabled.
    Repository 'packman' has been successfully disabled.
    Nothing to change for repository 'repo-debug'.
    Repository 'repo-non-oss' has been successfully disabled.
    Repository 'repo-oss' has been successfully disabled.
    Nothing to change for repository 'repo-source'.
    Repository 'ruby-devel' has been successfully disabled.
    Repository 'server-database-unstable' has been successfully disabled.

    And enable the OpenSUSE 11.4 repositories:

    $ sudo zypper addrepo --name "openSUSE-11.4 OSS" http://download.opensuse.org/distribution/11.4/repo/oss/ repo-11.4-oss
    Adding repository 'openSUSE-11.4 OSS' [done]
    Repository 'openSUSE-11.4 OSS' successfully added
    Enabled: Yes
    Autorefresh: No
    URI: http://download.opensuse.org/distribution/11.4/repo/oss/
    
    $ sudo zypper addrepo --name "openSUSE-11.4 Non-OSS" http://download.opensuse.org/distribution/11.4/repo/non-oss/ repo-11.4-non-oss
    Adding repository 'openSUSE-11.4 Non-OSS' [done]
    Repository 'openSUSE-11.4 Non-OSS' successfully added
    Enabled: Yes
    Autorefresh: No
    URI: http://download.opensuse.org/distribution/11.4/repo/non-oss/
    
    $ sudo zypper addrepo --name "openSUSE-11.4 Updates" http://download.opensuse.org/update/11.4/ repo-11.4-update
    Adding repository 'openSUSE-11.4 Updates' [done]
    Repository 'openSUSE-11.4 Updates' successfully added
    Enabled: Yes
    Autorefresh: No
    URI: http://download.opensuse.org/update/11.4/

    Now, the repositories look like this:

    $ sudo zypper repos --uri
    
    #  | Alias                               | Name                                | Enabled | Refresh | URI
    ---+-------------------------------------+-------------------------------------+---------+---------+--------------------------------------------------------------------------------------------
    1  | Packman Repository                  | Packman Repository                  | No      | Yes     | http://ftp.uni-erlangen.de/pub/mirrors/packman/suse/openSUSE_11.3
    2  | Updates for openSUSE 11.3 11.3-1.82 | Updates for openSUSE 11.3 11.3-1.82 | No      | Yes     | http://download.opensuse.org/update/11.3/
    3  | devel_languages_ruby_extensions     | Ruby Extensions (openSUSE_11.4)     | No      | No      | http://download.opensuse.org/repositories/devel:/languages:/ruby:/extensions/openSUSE_11.4/
    4  | google-chrome                       | google-chrome                       | No      | Yes     | http://dl.google.com/linux/chrome/rpm/stable/i386
    5  | openSUSE-11.3 11.3-1.82             | openSUSE-11.3 11.3-1.82             | No      | No      | cd:///?devices=/dev/sr0
    6  | openSUSE:Tools                      | openSUSE:Tools                      | No      | Yes     | http://download.opensuse.org/repositories/openSUSE:/Tools/openSUSE_11.3/
    7  | openSUSE_Tools                      | openSUSE.org tools (openSUSE_11.3)  | No      | No      | http://download.opensuse.org/repositories/openSUSE:/Tools/openSUSE_11.3/
    8  | packman                             | Packman repository (openSUSE_11.3)  | No      | No      | http://packman.inode.at/suse/openSUSE_11.3
    9 | repo-11.4-non-oss | openSUSE-11.4 Non-OSS | Yes | No | http://download.opensuse.org/distribution/11.4/repo/non-oss/ 
    10 | repo-11.4-oss | openSUSE-11.4 OSS | Yes | No | http://download.opensuse.org/distribution/11.4/repo/oss/ 
    11 | repo-11.4-update | openSUSE-11.4 Updates | Yes | No | http://download.opensuse.org/update/11.4/
    12 | repo-debug                          | openSUSE-11.3-Debug                 | No      | Yes     | http://download.opensuse.org/debug/distribution/11.3/repo/oss/
    13 | repo-non-oss                        | openSUSE-11.3-Non-Oss               | No      | Yes     | http://download.opensuse.org/distribution/11.3/repo/non-oss/
    14 | repo-oss                            | openSUSE-11.3-Oss                   | No      | Yes     | http://download.opensuse.org/distribution/11.3/repo/oss/
    15 | repo-source                         | openSUSE-11.3-Source                | No      | Yes     | http://download.opensuse.org/source/distribution/11.3/repo/oss/
    16 | ruby-devel                          | ruby-devel                          | No      | No      | http://download.opensuse.org/repositories/devel:/languages:/ruby:/extensions/openSUSE_11.3/
    17 | server-database-unstable            | server-database-unstable            | No      | Yes     | http://download.opensuse.org/repositories/server:/database:/UNSTABLE/openSUSE_11.3

    Search for updated openSUSE 11.4 compatible third-party repositories that you used before and add them.

    $ sudo zypper addrepo --name <name> <url> <alias>

    For example, if you used the VirtualBox repository in 11.3, you can enable the VirtualBox repository in 11.4 like this:

    $ sudo zypper addrepo --name "VirtualBox for openSUSE 11.4" http://download.virtualbox.org/virtualbox/rpm/opensuse/11.4 virtualbox-11.4

    (Use values for Name and Alias that are not in use yet.) Be aware that using third-party repositories could increase the chances that the upgrade will not complete correctly.

    Now, run the full distribution upgrade:

    $ sudo zypper ref

    This retrieves the metadata for the 11.4 repositories (i.e., openSUSE-11.4 Non-OSS, openSUSE-11.4 OSS, and openSUSE-11.4 Updates), and builds up caches for those repositories.

    Retrieving repository 'openSUSE-11.4 Non-OSS' metadata [done]
    Building repository 'openSUSE-11.4 Non-OSS' cache [done]
    Retrieving repository 'openSUSE-11.4 OSS' metadata [done]
    Building repository 'openSUSE-11.4 OSS' cache [done]
    Retrieving repository 'openSUSE-11.4 Updates' metadata [done]
    Building repository 'openSUSE-11.4 Updates' cache [done]
    All repositories have been refreshed.

    Then, do

    $ sudo zypper dup

    This zypper command will download the required packages when it installs them. You may download all packages in advance:

    $ zypper dup --download "in-advance"  

    The lengthy output goes like this:

    The following product is going to be upgraded:
      openSUSE 11.4
    The following packages are going to be reinstalled:
      bind-libs bind-utils flash-player icedtea-web java-1_6_0-sun java-1_6_0-sun-devel libmariadbclient16 libmariadbclient_r16 libreoffice-branding-openSUSE mozilla-js192 mozilla-xulrunner192
      mozilla-xulrunner192-gnome perl-Algorithm-C3 perl-Class-C3 perl-Class-C3-XS perl-MRO-Compat perl-Scope-Guard timezone timezone-java 
    
    The following packages are going to change architecture:
      ghostscript-fonts-other  i586 -> noarch
      ghostscript-fonts-std    i586 -> noarch
      perl-Archive-Zip         i586 -> noarch
      perl-Digest-HMAC         i586 -> noarch
      perl-Error               i586 -> noarch
      perl-IO-Socket-INET6     i586 -> noarch
      perl-IO-Socket-SSL       i586 -> noarch
      perl-libwww-perl         i586 -> noarch
      perl-Net-Server          i586 -> noarch
      perl-Parse-RecDescent    i586 -> noarch
      perl-Pod-POM             i586 -> noarch
      perl-Text-Autoformat     i586 -> noarch
      perl-Text-Reform         i586 -> noarch
      perl-URI                 i586 -> noarch
      perl-XML-Writer          i586 -> noarch
      python-iniparse          i586 -> noarch
    . . .
    1125 packages to upgrade, 74 to downgrade, 165 new, 19 to reinstall, 99 to remove, 42  to change vendor, 16 to change arch.
    Overall download size: 982.3 MiB. After the operation, 27.9 MiB will be freed.
    Continue? [y/n/?] (y): y
    . . .

    Then, a bunch of license agreements come up. Press Enter to get to the bottom of the page and type “yes.”

    In order to install 'openSUSE 11.4' (product), you must agree to terms of the following license agreement:
    LICENSE AGREEMENT openSUSE® 11.4
    . . .
    In order to install 'fetchmsttfonts', you must agree to terms of the following license agreement:
    END-USER LICENSE AGREEMENT FOR MICROSOFT SOFTWARE
    . . .
    In order to install 'java-1_6_0-sun-devel', you must agree to terms of the following license agreement:
    Operating System Distributor License for Java version 1.1
    . . .
    In order to install 'java-1_6_0-sun', you must agree to terms of the following license agreement:
    Operating System Distributor License for Java version 1.1
    . . .
    In order to install 'flash-player', you must agree to terms of the following license agreement:
    ADOBE® SOFTWARE LICENSE AGREEMENTNOTICE TO USER
    . . .

    You can run zypper dup  from time to time to ensure you have the latest available packages from the various repositories that you have enabled. YOU (Yast Online Update) only addresses security updates from the official repositories.

    Lastly, reboot… and enjoy your new OpenSUSE 11.4 system!

    • – – – – – –

    You can also find this post on my other blog.

     
    • Joseph 12:36 am on August 27, 2011 Permalink | Reply

      Isn’t this article essentially just cut and pasted from Falko Timme’s article on HowtoForge? :-(

  • justineleng 11:12 pm on August 16, 2011 Permalink | Reply  

    Install Broadcom STA wireless driver in openSUSE 11.4 (and other Linux distros) 

    Broadcom is a real nag. Buying a laptop with Broadcom wireless network card never bothered me until I installed several Linux distros and things started to go less smoothly… especially when you do not have wired ethernet nearby and wireless is all you get.

    On the other hand, installing the Broadcom wireless driver for different Linux distros is a great learning experience.

    Previously, I talked about how to activate the Broadcom STA wireless driver in Fedora 14. It turns out the activation is slightly different in openSUSE.

    The following works on openSUSE 11.3, 11.4, Mint 10 Julia, Ubuntu 10.x, Kubuntu 10.x, and LMDE.

    To make Wi-Fi work in openSUSE 11.4, first download the tarball containing Broadcom’s IEEE 802.11a/b/g/n hybrid Linux device driver from http://www.broadcom.com/support/802.11/linux_sta.php

    The cards with the following PCI Device IDs are supported with this driver.
    Both Broadcom and and Dell product names are described.  Cards not listed here
    may also work.
    
     	    BRCM		    PCI	PCI		  Dell
    	    Product Name	  Vendor ID	Device ID	Product ID
              -------------	 ----------	---------   -----------
              4311 2.4 Ghz	    0x14e4	0x4311  	Dell 1390
              4311 Dualband	    0x14e4	0x4312  	Dell 1490
              4311 5 Ghz	    0x14e4      0x4313
              4312 2.4 Ghz	    0x14e4	0x4315  	Dell 1395
              4313 2.4 Ghz	    0x14e4	0x4727   	Dell 1501
              4321 Dualband	    0x14e4	0x4328  	Dell 1505
              4321 Dualband	    0x14e4	0x4328  	Dell 1500
              4321 2.4 Ghz	    0x14e4	0x4329
              4321 5 Ghz        0x14e4	0x432a
              4322 Dualband     0x14e4	0x432b  	Dell 1510
              4322 2.4 Ghz      0x14e4 	0x432c
              4322 5 Ghz        0x14e4 	0x432d
              43224 Dualband    0x14e4	0x4353  	Dell 1520
              43225 2.4 Ghz     0x14e4	0x4357
              43227 2.4 Ghz     0x14e4      0x4358
              43228 Dualband    0x14e4      0x4359          Dell 1530
    
    To find the Device ID's of Broadcom cards on your machines do:
    # lspci -n | grep 14e4

    Untar the package:

    $ tar -xvf hybrid-portsrc_x86_32-v5_100_82_38.tar.gz 

    And build this driver from source:

    $ make
    KBUILD_NOPEDANTIC=1 make -C /lib/modules/`uname -r`/build M=`pwd`
    make: *** /lib/modules/2.6.37.6-0.7-desktop/build: No such file or directory.  Stop.
    make: *** [all] Error 2

    Looks like you yet need to install the proper packages, which will create /lib/modules/”release”/build on your system. Take a quick check on what kernel packages you have:

    $ rpm -qva | grep kernel
    kernel-desktop-2.6.37.6-0.7.1.i586
    kernel-default-2.6.37.6-0.7.1.i586

    So, just install ‘kernel-devel’ (Development Package for building kernel modules to match the kernel):

    $ sudo zypper install kernel-devel
    Loading repository data...
    Reading installed packages...
    Resolving package dependencies...
    
    The following NEW packages are going to be installed:
      kernel-default-devel kernel-desktop-devel kernel-devel 
    
    3 new packages to install.
    Overall download size: 20.9 MiB. After the operation, additional 50.0 MiB will be used.
    Continue? [y/n/?] (y): y
    Retrieving package kernel-devel-2.6.37.6-0.7.1.noarch (1/3), 7.2 MiB (35.2 MiB unpacked)
    Retrieving: kernel-devel-2.6.37.6-0.7.1.noarch.rpm [done (66.3 KiB/s)]
    Retrieving package kernel-desktop-devel-2.6.37.6-0.7.1.i586 (2/3), 7.1 MiB (7.8 MiB unpacked)
    Retrieving: kernel-desktop-devel-2.6.37.6-0.7.1.i586.rpm [done (71.3 KiB/s)]
    Retrieving package kernel-default-devel-2.6.37.6-0.7.1.i586 (3/3), 6.5 MiB (7.1 MiB unpacked)
    Retrieving: kernel-default-devel-2.6.37.6-0.7.1.i586.rpm [done (49.2 KiB/s)]
    Installing: kernel-devel-2.6.37.6-0.7.1 [done]
    Installing: kernel-desktop-devel-2.6.37.6-0.7.1 [done]
    Installing: kernel-default-devel-2.6.37.6-0.7.1 [done]

    Also, install the GNU Compiler:

    $ sudo zypper install gcc
    
    Loading repository data...
    Reading installed packages...
    Resolving package dependencies...
    
    The following NEW packages are going to be installed:
      binutils-gold gcc gcc45 
    
    3 new packages to install.
    Overall download size: 5.6 MiB. After the operation, additional 18.2 MiB will be used.
    Continue? [y/n/?] (y): y
    Retrieving package binutils-gold-2.21-13.1.i586 (1/3), 699.0 KiB (2.8 MiB unpacked)
    Retrieving: binutils-gold-2.21-13.1.i586.rpm [done (36.0 KiB/s)]
    Retrieving package gcc45-4.5.1_20101208-9.8.i586 (2/3), 5.0 MiB (15.4 MiB unpacked)
    Retrieving: gcc45-4.5.1_20101208-9.8.i586.rpm [done (79.7 KiB/s)]
    Retrieving package gcc-4.5-19.1.i586 (3/3), 4.0 KiB (0 B unpacked)
    Retrieving: gcc-4.5-19.1.i586.rpm [done (0 B/s)]
    Installing: binutils-gold-2.21-13.1 [done]
    Installing: gcc45-4.5.1_20101208-9.8 [done]
    Installing: gcc-4.5-19.1 [done]

    Then, run make again:

    $ make
    KBUILD_NOPEDANTIC=1 make -C /lib/modules/`uname -r`/build M=`pwd`
    make[1]: Entering directory `/usr/src/linux-2.6.37.6-0.7-obj/i386/desktop'
    make -C ../../../linux-2.6.37.6-0.7 O=/usr/src/linux-2.6.37.6-0.7-obj/i386/desktop/.
      CC [M]  /home/surfmonkey/broadcom-wl/src/shared/linux_osl.o
      CC [M]  /home/surfmonkey/broadcom-wl/src/wl/sys/wl_linux.o
    /home/surfmonkey/broadcom-wl/src/wl/sys/wl_linux.c: In function ‘wl_attach’:
    /home/surfmonkey/broadcom-wl/src/wl/sys/wl_linux.c:485:3: error: implicit declaration of function ‘init_MUTEX’
    make[4]: *** [/home/surfmonkey/broadcom-wl/src/wl/sys/wl_linux.o] Error 1 make[3]: *** [_module_/home/surfmonkey/broadcom-wl] Error 2 make[2]: *** [sub-make] Error 2
    make[1]: *** [all] Error 2
    make[1]: Leaving directory `/usr/src/linux-2.6.37.6-0.7-obj/i386/desktop'
    make: *** [all] Error 2
    
    $ ls -l
    total 1184
    -rw-r--r-- 1 surfmonkey users       8 Aug 13 18:22 built-in.o
    -rw-r--r-- 1 surfmonkey users 1195817 Aug 13 18:11 hybrid-portsrc_x86_32-v5_100_82_38.tar.gz
    drwxr-xr-x 2 surfmonkey users    4096 Dec 14  2010 lib
    -rw-r--r-- 1 surfmonkey users    1134 Dec 14  2010 Makefile
    drwxr-xr-x 5 surfmonkey users    4096 Dec 14  2010 src

    There is still an error building the driver. The expected wl.ko file wasn’t generated.

    It turns out there is a compilation problem with kernel versions > 2.6.37. The kernel I have falls right into that range:

    $ uname -a
    Linux opensuse 2.6.37.6-0.7-desktop #1 SMP PREEMPT 2011-07-21 02:17:24 +0200 i686 i686 i386 GNU/Linux

    We need to apply a patch to fix the ‘init_MUTEX’ compile problem on newer (> 2.6.37) kernels.

    At the top level of the driver source folder  (where ”ls” should show at least src, lib, Makefile), create a file which I named “patch.” Fill in the following lines:

    --- src/wl/sys/wl_linux.c	2011-05-20 12:07:25.303356739 -0700
    +++ src/wl/sys/wl_linux.c.new	2011-05-20 12:07:13.663356735 -0700
    @@ -481,9 +481,9 @@
     	if (WL_ALL_PASSIVE_ENAB(wl)) {
     #ifdef WL_ALL_PASSIVE
     		spin_lock_init(&wl->txq_lock);
     #endif
    -		init_MUTEX(&wl->sem);
    +		sema_init(&wl->sem, 1);
     	}
    
     	if (!(wl->wlc = wlc_attach((void *) wl, vendor, device, unit, wl->piomode,
     		osh, wl->regsva, wl->bcm_bustype, btparam, &err))) {

    Save it, and go back to the command line:

    $ patch -p0 < patch
    patching file src/wl/sys/wl_linux.c
    patch unexpectedly ends in middle of line
    Hunk #1 succeeded at 481 with fuzz 1.

    Try building the driver again:

    $ make
    KBUILD_NOPEDANTIC=1 make -C /lib/modules/`uname -r`/build M=`pwd`
    make[1]: Entering directory `/usr/src/linux-2.6.37.6-0.7-obj/i386/desktop'
    make -C ../../../linux-2.6.37.6-0.7 O=/usr/src/linux-2.6.37.6-0.7-obj/i386/desktop/.
      CC [M]  /home/surfmonkey/broadcom-wl/src/wl/sys/wl_linux.o
      CC [M]  /home/surfmonkey/broadcom-wl/src/wl/sys/wl_iw.o
      LD [M]  /home/surfmonkey/broadcom-wl/wl.o
      Building modules, stage 2.
      MODPOST 1 modules
    WARNING: modpost: missing MODULE_LICENSE() in /home/surfmonkey/broadcom-wl/wl.o
    see include/linux/module.h for more information
      CC      /home/surfmonkey/broadcom-wl/wl.mod.o
      LD [M]  /home/surfmonkey/broadcom-wl/wl.ko
    make[1]: Leaving directory `/usr/src/linux-2.6.37.6-0.7-obj/i386/desktop'

    Do a quick “ls” to make sure the wl.ko file has been successfully created.

    $ ls -l
    total 8100
    -rw-r--r-- 1 surfmonkey users       8 Aug 13 18:22 built-in.o
    drwxr-xr-x 2 surfmonkey users    4096 Dec 14  2010 lib
    -rw-r--r-- 1 surfmonkey users    1134 Dec 14  2010 Makefile
    -rw-r--r-- 1 surfmonkey users      42 Aug 13 18:30 modules.order
    -rw-r--r-- 1 surfmonkey users       0 Aug 13 18:30 Module.symvers
    -rw-r--r-- 1 surfmonkey users     437 Aug 13 18:30 patch
    drwxr-xr-x 5 surfmonkey users    4096 Dec 14  2010 src
    -rw-r--r-- 1 surfmonkey users 3527159 Aug 13 18:30 wl.ko
    -rw-r--r-- 1 surfmonkey users    4646 Aug 13 18:30 wl.mod.c
    -rw-r--r-- 1 surfmonkey users   39660 Aug 13 18:30 wl.mod.o
    -rw-r--r-- 1 surfmonkey users 3488826 Aug 13 18:30 wl.o

    Now, let’s do a fresh install of the wl driver, since the system was just upgraded live to openSUSE 11.4 and no previous version of the wl driver has been running.

    First, check if there’s any other driver for Broadcom wireless device on the system:

    $ lsmod  | grep "b43\|ssb\|wl"
    $ [blank]

    Looks good. If any of these are installed, remove them:

    # rmmod b43
    # rmmod ssb
    # rmmod wl

    And blacklist these drivers and prevent them from loading in the future:

    # echo "blacklist ssb" >> /etc/modprobe.d/blacklist.conf
    # echo "blacklist b43" >> /etc/modprobe.d/blacklist.conf

    At root,

    # cp wl.ko /lib/modules/`uname -r’/kernel/net/wireless/
    # insmod wl.ko
    insmod: can't read 'wl.ko': No such file or directory

    You could skip insmod wl.ko if it doesn’t work.

    Make sure you’re root “su –“. Otherwise, you’d get this:

    $ sudo insmod wl.ko
    root's password:
    sudo: insmod: command not found

    Proceed to

    # modprobe lib80211
    # depmod -a
    # modprobe wl

    Now, check your Network Manager, and you should see wireless networks immediately.

    In openSUSE, the module will be loaded on boot. In Mint/Ubuntu/Kubuntu/LMDE, users will need to add it manually in /etc/modules file.

    • – – – – – – – – –

    You can also find this post on my other blog.

     
    • Andrea 7:09 am on August 17, 2011 Permalink | Reply

      I wonder, why do you have to go for all that mess and troubles when packman provides you with rpms for those drivers….

    • Tejas Guruswamy 7:16 am on August 17, 2011 Permalink | Reply

      Or you could just install it from packman :)
      http://packman.links2linux.de/package/broadcom-wl

    • Shuker 11:15 am on August 17, 2011 Permalink | Reply

      Please remove the dot after the link http://www.broadcom.com/support/802.11/linux_sta.php.
      Otherwise i got page not found :)

      • Shuker 11:36 am on August 17, 2011 Permalink | Reply

        I got issues with patching:
        patch -p0 txq_lock);
        #endif
        – init_MUTEX(&wl->sem);
        + sema_init(&wl->sem, 1);
        }

        if (!(wl->wlc = wlc_attach((void *) wl, vendor, device, unit, wl->piomode,
        osh, wl->regsva, wl->bcm_bustype, btparam, &err))) {

        • Shuker 11:44 am on August 17, 2011 Permalink

          Please ignore my previous post. All works fine now. Thanks for the tutorial.

      • justineleng 3:55 pm on August 17, 2011 Permalink | Reply

        Thanks for pointing that out.
        Already fixed the link. I meant to end the sentence instead of the web link with a period.
        And glad to hear that you got it all working :)

    • justineleng 3:52 pm on August 17, 2011 Permalink | Reply

      @Tejas and @ Andrea:

      Thanks for bringing up the broadcom-wl driver from Packman. That’s what I tried to do at first, but ended up with only half-working Wi-Fi at best — it worked fine with non-secured wireless networks, but couldn’t hook up to WEP-/WEP2-/WPA-secured ones at all. I tried installing it multiple times, but never had much luck with it. There could be some gotchas that I might’ve missed. If so, I’d appreciate your pointing them out.

      So far, the only way to make wireless driver work on my openSUSE 11.4 system is by doing what I’ve posted above.

    • johndoe 5:41 am on August 26, 2011 Permalink | Reply

      You might want to make sure that people sudo zypper update. I kept getting errors because kernel-devel was for a newer kernel then the one I was running and it wasn’t until I explored the lib/modules/ directory did I realize it.

    • rexz 8:23 am on October 6, 2011 Permalink | Reply

      Need help!! Newb guides.. I’ve tried lots of thread and i did used the packman guide as well.. I’m currently running my backtrack on live usb.. My wireless driver is BCM4313.. when i followed your guide i got these message and i did go through next step instead.. Please reply =) :

      root@root:~/wifi# sudo zypper install rpm
      sudo: zypper: command not found

      root@root:~/wifi# rpm -qva | grep kernel
      The program ‘rpm’ is currently not installed. You can install it by typing:
      apt-get install rpm

      root@root:~/wifi# patch -p0 < patch
      patching file src/wl/sys/wl_linux.c
      Hunk #1 FAILED at 481.
      1 out of 1 hunk FAILED — saving rejects to file src/wl/sys/wl_linux.c.rej

      root@root:~/wifi# rmmod b43
      ERROR: Module b43 does not exist in /proc/modules

      root@root:~/wifi# cp wl.ko/lib/modules/`uname -r`/kernel/net/wireless
      cp: missing destination file operand after `wl.ko/lib/modules/2.6.39.4/kernel/net/wireless'
      Try `cp –help' for more information.

      root@root:~/wifi# insmod wl.ko
      insmod: can't read 'wl.ko': No such file or directory

      root@root:~/wifi# modprobe wl
      FATAL: Module wl not found.

      please note that i'm doing this offline so apt-get update or apt-get is unable to comply.. thanks

  • justineleng 10:57 pm on August 16, 2011 Permalink | Reply  

    OpenSUSE 11.4 Review: http://cristalinux.blogspot.com/2011/03/opensuse-114-review.html

     
  • justineleng 11:03 pm on August 9, 2011 Permalink | Reply  

    OBS Mobile: Package View 

    Played with Package view a little bit today. This would probably look more like what I’m heading toward:

    The biggest change was adding embedded collapsible buttons.

    I tried serializing Files and loading the list alphabetically sorted, like this:

    <script type="text/javascript">
    
     // build up a javascript array from the file list
     var filelist = [
    <% @files.each do |file|
     fl = file.submit if file.has_element? :submit
     fl = file.action if file.has_element? :action
     pkg = ""
     if fl.has_element?(:pkg)
     pkg = elide(ae.pkg.package, 20)
     if fl.pkg.has_attribute?(:package)
     pkg += "/ #{elide(fl.target.package, 12)}"
     end
     end
     -%>
     {"name": "<%= elide(file.name, 12) %>", "pkg": "<%= pkg %>"
    <% end -%>
     ];
    
     // renders the file list
     function render_list(criteria) {
     console.debug("rendering list, ordered by: " + criteria);
     var list = $("#file_list");
     $(list).empty();
    
     var files = filelist.sort(function(a, b) {
     switch (criteria) {
     case 'name':
     return a.name > b.name;
     }
     });
    
     list.append("<li data-role=\"list-divider\">Files contained in this package</li>");
     $.each(files, function() {
     list.append("<a href='<%= url_for :project => @project, :package => @package, :action => :files %>/" + this.name + "'></a>");
     });
     }
    
     // initial render after page load
    $(document).ready(function(){
     render_list("name");
    });
    
    </script>

    In the mobile view, I would like to have the Files loaded as a pre-sorted list:

    <% @files.each do |file| %>
     <div data-role="collapsible" data-collapsed="true">
     <h3><%= h file %> </h3>
    
     <ul data-role=”listview”>
     <% if @package.linkinfo %>
     <% if @expand && @expand.to_s == "1" %>
     <%= link_to '(show unmerged sources)', :project => @project, :package => @package, :action => :files, :rev => params[:rev], :expand => "0" %>
     <% else %>
     <%= link_to '(show merged sources derived from linked package)', :project => @project, :package => @package, :action => :files, :rev => params[:rev], :expand => "1" %>
     <% end %>
     <% end %>
     </ul>
    </div>
    <% end %>

    But when I compile, I get this error:

    [FATAL|# 8894] ActionView::TemplateError (You have a nil object when you didn't expect it!
    You might have expected an instance of Array.
    The error occurred while evaluating nil.each) on line #5 of app/mobile_views/package/_files.html.erb:
    2: 
    3: // build up a javascript array from the file list
    4: var filelist = [
    5: <% @files.each do |file|
    6: fl = file.submit if file.has_element? :submit
    7: fl = file.action if file.has_element? :action
    8: pkg = ""
    
     app/mobile_views/package/_files.html.erb:5
     app/mobile_views/package/show.html.erb:21
     /server:3
    
    [ERROR|# 8894] rescue_action: caught ActionView::TemplateError: You have a nil object when you didn't expect it!
    You might have expected an instance of Array.
    The error occurred while evaluating nil.each
    [DEBUG|# 8894] ERROR: unknown; You have a nil object when you didn't expect it!
    You might have expected an instance of Array.
    The error occurred while e

    In desktop views, Files are implemented as a table and sorted with jquery.tablesorter.js. In mobile view, Files would have to be converted to an Array. I can’t quite tell what went wrong here, or how else to do it.

     
  • justineleng 7:43 pm on August 8, 2011 Permalink | Reply  

    Sorting elements with jQuery Mobile: controlgroup buttons vs. radio buttons 

    After implementing a prototype for sorting functions in Requests, I needed to refine the UI and get the sorting buttons to work correctly with jQuery Mobile. The problem was when I clicked on a button to re-order the list of requests, the action would complete properly, but the selected button would not be highlighted.

    This is the ideal view I would like to have:

    I re-examined the code in the prototype, and realized these sorting buttons were laid out as control group buttons as follows:

    <div data-role="controlgroup" data-type="horizontal">
     <a href="#" onclick="render_list('date'); $('#request_list').listview('refresh'); return false" data-role="button" data-theme="b">Date</a>
     <a href="#" onclick="render_list('requester'); $('#request_list').listview('refresh'); return false" data-role="button">Requester</a>
     <a href="#" onclick="render_list('target'); $('#request_list').listview('refresh'); return false" data-role="button">Target</a>
     <a href="#" onclick="render_list('state'); $('#request_list').listview('refresh'); return false" data-role="button">State</a>
    </div>

    After some web research, I learned that control group buttons might not provide what I wanted. More than one button in a control group can be active at a time. I also looked at the demos and examples on jQuery Mobile website. For control group buttons, there doesn’t seem to be any highlighting for the selected button. There is a millisecond of color change when the button is being clicked. But after the clicking is finished, the buttons return to their default data-theme. 

    One thing I could think of to make this highlighting happen for control group buttons is to dynamically change the data-theme for each selected button, but it seems to be an overkill for this tiny issue.

    On the other hand, radio buttons seem to perform exactly the way I wanted. With radio buttons, the highlighting comes automatically once the button is selected (the newly selected button is added to the selector class, as the previously selected one is removed from there).

    A second option to fix the button highlighting would be to change the control group buttons to radio buttons. A group of radio buttons always have at least one option selected, and that selected button is always highlighted. This would work perfectly on the Request view page, as requests would always display sorted by date.

    (Check out jQuery Mobile documentation on radio buttons)

    Switching the UI from control group buttons to radio buttons was easy:

    <div data-role="fieldcontain">
     <fieldset data-role="controlgroup" data-type="horizontal" >
     <input type="radio" name="radio-choice-1" id="radio-choice-1" value="date" checked="checked" />
     <label for="radio-choice-1">Date</label>
    
     <input type="radio" name="radio-choice-1" id="radio-choice-2" value="requester" />
     <label for="radio-choice-2">Requester</label>
    
     <input type="radio" name="radio-choice-1" id="radio-choice-3" value="target" />
     <label for="radio-choice-3">Target</label>
    
     <input type="radio" name="radio-choice-1" id="radio-choice-4" value="state" />
     <label for="radio-choice-4">State</label>
     </fieldset>
    </div>

    But binding an onclick event to the radio buttons took a bit effort. The trick was to use “change” instead of “click.”

     // initial render after page load
    $(document).ready(function(){
     render_list("date");
     $("input[type='radio']").bind("change", function(){
     var selection=$(this).val();
     //alert("Criterion changed. Selected: "+selection);
     render_list(selection); 
     $('#request_list').listview('refresh');
     })
    });

    Now the buttons are correctly implemented. The final Requests views look like the following:

    • – – – – – –
     
    • Jimbly2 9:29 pm on February 5, 2012 Permalink | Reply

      Hi – interesting – but how would you assign an audio file by selecting a radio button, then have another button play the selected audio file?

      cheers
      Jim

  • justineleng 10:40 pm on August 5, 2011 Permalink | Reply  

    New Features Added to Requests 

    I would like to share some exciting progress on the OBS Mobile Project:

    1. Request state has been added to each request;
    2. Sorting functions have been implemented for Requests;
    3. A search filter has been added to the Request page.

    Now, when the user logs into the list of requests, the user will not only be able to see the state of each request, but also sort requests based on 4 criteria:

    • request date
    • requester’s name
    • target project/package
    • request state

    The user can also filter requests by typing in a keyword:

    These new features have been tested in my desktop browsers and on my Android device, and they seem to be working fine.

    Please feel free to check out the new features as soon as they are merged to the master. Feedback and comments are always welcome & appreciated.

     

     
  • justineleng 9:00 pm on August 4, 2011 Permalink | Reply  

    jQuery Mobile Beta 2 Released! http://jquerymobile.com/blog/2011/08/03/jquery-mobile-beta-2-released/

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel
Follow

Get every new post delivered to your Inbox.