| Revision 7244,
711 bytes
checked in by daisuke, 14 years ago
(diff) |
- fix emacs-install.rb/emacs-package-install.rb to work with ruby-1.9
|
| Rev | Line | |
|---|
| [7238] | 1 | #!/usr/bin/ruby |
|---|
| 2 | |
|---|
| 3 | #prefix = "/home/xtakei/cvs/emacsen-common/apel-sample" |
|---|
| 4 | prefix ="/" |
|---|
| 5 | |
|---|
| 6 | # variables |
|---|
| 7 | |
|---|
| 8 | # installed emacs |
|---|
| 9 | flavors = Array.new |
|---|
| 10 | |
|---|
| 11 | # installed elisp package |
|---|
| 12 | elpackages = Array.new |
|---|
| 13 | |
|---|
| 14 | lib_dir = prefix+"/usr/lib/emacsen-common" |
|---|
| 15 | var_dir = prefix+"/var/lib/emacsen-common" |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | action = "install" |
|---|
| 19 | |
|---|
| 20 | if $0 =~ /remove/ |
|---|
| 21 | then |
|---|
| 22 | action = "remove" |
|---|
| 23 | end |
|---|
| 24 | |
|---|
| 25 | actionscript = lib_dir+"/packages/"+action+"/"+ARGV[0] |
|---|
| 26 | print "actionscript:"+actionscript+"\n" |
|---|
| 27 | |
|---|
| 28 | def getflavors(var_dir = "/") |
|---|
| 29 | return open(var_dir+"/installed-flavors").readlines |
|---|
| 30 | end |
|---|
| 31 | |
|---|
| 32 | flavors = getflavors(var_dir) |
|---|
| 33 | |
|---|
| 34 | flavors.each{ |flavor| |
|---|
| [7244] | 35 | _eprefix=ENV["EPREFIX"] |
|---|
| 36 | ENV["EPREFIX"]=prefix |
|---|
| 37 | system("#{actionscript} #{flavor}") |
|---|
| 38 | ENV["EPREFIX"]=_eprefix |
|---|
| [7238] | 39 | } |
|---|
| 40 | |
|---|
Note: See
TracBrowser
for help on using the repository browser.