upm 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4da92ce63688e75043c91e8d40bf9a1829687b974a4bc21bc40e23c06ce108f9
4
- data.tar.gz: 0eb4815df308f4dfaffdcc9fee5a877c65dda0d65f85ed3149fdb338bc34517b
3
+ metadata.gz: 6c755b3ead00bb1808a980d25cf2a7eeaf9e21b0061749aa06b6be6c40eecd4f
4
+ data.tar.gz: f7a18d62933dae46ad1e005bf01478c13c198e500332bfe39ffb077f1c7ec977
5
5
  SHA512:
6
- metadata.gz: d8ca05eff0cd5037aa9a30b9206d79933fdd7fe6bc8a7d225185278c0696965416ba5d0315fec9cc25a1ecb1ed566ed80704b213c9fee1e37b515596a1d50dc0
7
- data.tar.gz: 7a0341ee388207404b5a785d7d27fd5a563f886a8638165539f1a790520e9c097b8d33bbbd2f79d046183a6515e73d5d1cb08ab44f0e3a0d33fb7d4e58f6df94
6
+ metadata.gz: dab6d3ee5f5a2969f566ceda7414b7e9821cd9084123894bb3331949fed19ada5f4e9d68802b4c057db11422c56cc62740007033a1a4b6870b08e911a8033002
7
+ data.tar.gz: b7150c73d16573cc37626dfa40a6639c824ab6af1f1392b580dc6db7885631902bb5c3ca096b09a27afdc3579e1ab153b30e5f57e1438ddaaf43017fa4a502a2
data/TODO.md CHANGED
@@ -9,6 +9,23 @@ Currently missing:
9
9
  * OpenBSD
10
10
  * SuSE
11
11
 
12
+ ## Abbrev cmds
13
+
14
+ * eg: upm install => upm i => u i
15
+
16
+ ## Dependency-fetching features
17
+
18
+ * Use upm to fetch dependencies for any library or script, across any language.
19
+ * Some kind of manifest file (or personifest, to be politically correct)
20
+ * This is a little like bundler, npm, etc., but for any type of package.
21
+
22
+ ## Ability to install any package from any OS to the user's home directory
23
+
24
+ Slurps up the packages and their dependencies, then unpacks them into ~/.upm/{bin,lib} or something.
25
+ (Like nix?)
26
+
27
+ Related tool: intoli/exodus
28
+
12
29
  ## fzf
13
30
 
14
31
  Use fzf for "list" output (or other commands that require selecting, like "remove")
@@ -21,6 +38,12 @@ Use fzf for "list" output (or other commands that require selecting, like "remov
21
38
 
22
39
  * Make the `run` command able to grep the output while streaming the results to the screen.
23
40
  * Make run pretend to be a tty, so I don't need `--color=always`.
41
+ * Use spawn, like so:
42
+ ```
43
+ r,w = IO.pipe
44
+ spawn(*%w[echo hello world], out: w)
45
+ spawn(*%w[tr a-z A-Z], in: r)
46
+ ```
24
47
 
25
48
  ## Figure out how to integrate language package managers
26
49
 
@@ -29,10 +52,30 @@ Use fzf for "list" output (or other commands that require selecting, like "remov
29
52
  * Possibilites:
30
53
  * upm install --ruby <pkg>
31
54
  * upm install ruby:<pkg>,<pkg>
55
+ * upm --ruby search <query>
56
+ * upm ruby:search <query>
57
+ * upm search os:<query>
58
+ * Separate tool: `lpm search <query>` searches only language packages
32
59
  * Add detectors for language-specific package-managers
33
60
  * Help screen needs to display language-specific package managers
34
61
  * `upm help --ruby` should show available ruby commands
35
62
 
63
+ ## Give identical output on every platform
64
+
65
+ * Requires parsing the output of every command into a canonical format, or reading the package databases directly.
66
+
67
+ ## apt: Integrate 'acs' wrapper script
68
+
69
+ ## Evaluate UPM::Tool.new block in an instance of an anonymous subclass of UPM::Tool
70
+
71
+ This will allow tools to create classes and modules inside the UPM::Tool block without namespace collisions
72
+
73
+ ## Themes?
74
+
75
+ Why not!
76
+
36
77
  ## Mirror Selector
37
78
 
38
- * Do a ping test on available mirrors, and use fzf to select
79
+ Do a ping test on available mirrors, and use fzf to select.
80
+
81
+
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.2
data/bin/upm CHANGED
@@ -10,5 +10,5 @@ command, *args = ARGV
10
10
  if command.nil?
11
11
  tool.help
12
12
  else
13
- tool.call_command command, args
13
+ tool.call_command command, *args
14
14
  end
data/lib/upm/tool.rb CHANGED
@@ -17,7 +17,7 @@ module UPM
17
17
  "search" => "using the fastest known API or service",
18
18
  "list" => "list installed packages (or search their names if extra arguments are supplied)",
19
19
  "info" => "show metadata about a package",
20
- "sync/update" => "retrieve the latest package list or manifest",
20
+ "update/sync" => "retrieve the latest package list or manifest",
21
21
  "upgrade" => "install new versions of all packages",
22
22
  "pin" => "pinning a package means it won't be automatically upgraded",
23
23
  "rollback" => "revert to an earlier version of a package (including its dependencies)",
@@ -76,7 +76,7 @@ module UPM
76
76
  @@tools[name] = self
77
77
  end
78
78
 
79
- def call_command(name, args)
79
+ def call_command(name, *args)
80
80
  if block = (@cmds[name] || @cmds[ALIASES[name]])
81
81
  block.call args
82
82
  else
@@ -133,8 +133,6 @@ module UPM
133
133
  raise "Error: command argument must be a String or an Array; it was a #{cmd.class}"
134
134
  end
135
135
 
136
- shell_command.unshift "sudo" if root
137
-
138
136
  @cmds[name] = proc { |args| run(*shell_command, *args, paged: paged) }
139
137
  end
140
138
  end
@@ -145,7 +143,9 @@ module UPM
145
143
 
146
144
  ## Helpers
147
145
 
148
- def run(*args, paged: false, grep: nil)
146
+ def run(*args, root: false, paged: false, grep: nil)
147
+ args.unshift "sudo" if root
148
+
149
149
  if !paged and !grep
150
150
  system(*args)
151
151
  else
data/lib/upm/tools/apt.rb CHANGED
@@ -4,7 +4,12 @@ UPM::Tool.new "apt" do
4
4
 
5
5
  command "install", "apt install", root: true
6
6
  command "update", "apt update", root: true
7
- command "upgrade", "apt upgrade", root: true
7
+
8
+ command "upgrade" do |args|
9
+ call_command("update")
10
+ run("apt", "upgrade", root: true)
11
+ end
12
+
8
13
  command "remove", "apt remove", root: true
9
14
 
10
15
  command "files", "dpkg-query -L", paged: true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: upm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - epitron