Class: RuPacSync::PacSync
- Inherits:
-
Pacman
- Object
- Pacman
- RuPacSync::PacSync
- Defined in:
- lib/rupacsync.rb
Overview
PacSync Class. Handles all -S options except -Ss, -Sg, and -Si
Instance Method Summary collapse
-
#allClean ⇒ Object
Represents -Scc Raises an exception if @@lock is already yes.
-
#downOnly(*packs) ⇒ Object
Represents -Sw Raises an exception if @@lock is already yes.
-
#initialize ⇒ PacSync
constructor
A new instance of PacSync.
-
#install(*packs) ⇒ Object
Represents -S foo bar etc Raises an exception if @@lock is already yes.
-
#oldClean ⇒ Object
Represents -Sc Raises an exception if @@lock is already yes.
-
#sync ⇒ Object
Represents -Sy Raises an exception if @@lock is already yes.
-
#sysUpgrade ⇒ Object
Represents -Suy or -Syu Raises an exception if @@lock is already yes.
Constructor Details
#initialize ⇒ PacSync
Returns a new instance of PacSync.
16 17 18 19 |
# File 'lib/rupacsync.rb', line 16 def initialize super( "yes" ) @command = "pacman -S" end |
Instance Method Details
#allClean ⇒ Object
Represents -Scc
Raises an exception if @@lock is already yes
71 72 73 74 75 76 77 78 79 |
# File 'lib/rupacsync.rb', line 71 def allClean if @@lock == "no" @@lock = "yes" exec( "#{@command}cc" ) @@lock = "no" else raise "#{@@lockerror}" end end |
#downOnly(*packs) ⇒ Object
Represents -Sw
Raises an exception if @@lock is already yes
83 84 85 86 87 88 89 90 91 |
# File 'lib/rupacsync.rb', line 83 def downOnly( *packs ) if @@lock == "no" @@lock = "yes" exec( "#{@command}w #{packs.join(' ')}" ) @@lock = "no" else raise "#{@@lockerror}" end end |
#install(*packs) ⇒ Object
Represents -S foo bar etc
Raises an exception if @@lock is already yes
47 48 49 50 51 52 53 54 55 |
# File 'lib/rupacsync.rb', line 47 def install( *packs ) if @@lock == "no" @@lock = "yes" exec( "#{@command} #{packs.join(' ')}" ) @@lock = "no" else raise "#{@@lockerror}" end end |
#oldClean ⇒ Object
Represents -Sc
Raises an exception if @@lock is already yes
59 60 61 62 63 64 65 66 67 |
# File 'lib/rupacsync.rb', line 59 def oldClean if @@lock == "no" @@lock = "yes" exec( "#{@command}c" ) @@lock = "no" else raise "#{@@lockerror}" end end |
#sync ⇒ Object
Represents -Sy
Raises an exception if @@lock is already yes
23 24 25 26 27 28 29 30 31 |
# File 'lib/rupacsync.rb', line 23 def sync if @@lock == "no" @@lock = "yes" exec( "#{@command}y" ) @@lock = "no" else raise "#{@@lockerror}" end end |
#sysUpgrade ⇒ Object
Represents -Suy or -Syu
Raises an exception if @@lock is already yes
35 36 37 38 39 40 41 42 43 |
# File 'lib/rupacsync.rb', line 35 def sysUpgrade if @@lock == "no" @@lock = "yes" exec( "#{@command}yu" ) @@lock = "no" else raise "#{@@lockerror}" end end |