New Upstream Snapshot - vagrant-cachier

Ready changes

Summary

Merged new upstream version: 1.2.1+git20221205.1.7e885eb (was: 1.2.1).

Resulting package

Built on 2023-01-20T17:17 (took 40m36s)

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-snapshots vagrant-cachier

Diff

diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index ef6adbc..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,17 +0,0 @@
-*.gem
-*.rbc
-.bundle
-.config
-.yardoc
-InstalledFiles
-_yardoc
-coverage
-doc/
-lib/bundler/man
-pkg
-rdoc
-spec/reports
-test/tmp
-test/version_tmp
-tmp
-.vagrant
diff --git a/README.md b/README.md
index 45853d6..aa73a67 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,11 @@
+# :warning: UNMAINTAINED :warning:
+
+This project has been archived. Thanks a lot to everyone that contributed with it over the years ❤️‍🔥
+
+If anyone else wants to resurrect it please reach out on twitter or by other means listed in @fgrehm's website!
+
+--------
+
 # vagrant-cachier
 
 [![Gem Version](https://badge.fury.io/rb/vagrant-cachier.png)](http://badge.fury.io/rb/vagrant-cachier) [![Gitter chat](https://badges.gitter.im/fgrehm/vagrant-cachier.png)](https://gitter.im/fgrehm/vagrant-cachier)
@@ -8,10 +16,6 @@ package cache among similar VM instances. Kinda like [vagrant-apt_cache](https:/
 or [this magical snippet](http://gist.github.com/juanje/3797297) but targeting
 multiple package managers and Linux distros.
 
-## Help Needed!
-
-This project is looking for maintainers, please see [GH-143](https://github.com/fgrehm/vagrant-cachier/issues/143) for more.
-
 ## Installation
 
 Make sure you have Vagrant 1.4+ and run:
@@ -56,6 +60,7 @@ http://fgrehm.viewdocs.io/vagrant-cachier.
 * [vagrant-lxc](https://github.com/fgrehm/vagrant-lxc)
 * [VMware providers](http://www.vagrantup.com/vmware) with NFS enabled (See
   [GH-24](https://github.com/fgrehm/vagrant-cachier/issues/24) for more info)
+* [vagrant-parallels](https://github.com/Parallels/vagrant-parallels)
 * [vagrant-libvirt](https://github.com/pradels/vagrant-libvirt)
 * [vagrant-kvm](https://github.com/adrahon/vagrant-kvm)
 * _[Let us know if it is compatible with other providers!](https://github.com/fgrehm/vagrant-cachier/issues/new)_
diff --git a/debian/changelog b/debian/changelog
index 3f9ac93..4814f7b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-vagrant-cachier (1.2.1-4) UNRELEASED; urgency=medium
+vagrant-cachier (1.2.1+git20221205.1.7e885eb-1) UNRELEASED; urgency=medium
 
   [ Utkarsh Gupta ]
   * Add salsa-ci.yml
@@ -20,8 +20,9 @@ vagrant-cachier (1.2.1-4) UNRELEASED; urgency=medium
   * Remove constraints unnecessary since buster:
     + Build-Depends: Drop versioned constraint on vagrant.
   * Bump debhelper from old 12 to 13.
+  * New upstream snapshot.
 
- -- Utkarsh Gupta <guptautkarsh2102@gmail.com>  Tue, 13 Aug 2019 08:27:14 +0530
+ -- Utkarsh Gupta <guptautkarsh2102@gmail.com>  Fri, 20 Jan 2023 17:06:35 -0000
 
 vagrant-cachier (1.2.1-3) unstable; urgency=medium
 
diff --git a/debian/patches/0001-Load-locales-from-usr-share.patch b/debian/patches/0001-Load-locales-from-usr-share.patch
index bd645b0..8bf39d2 100644
--- a/debian/patches/0001-Load-locales-from-usr-share.patch
+++ b/debian/patches/0001-Load-locales-from-usr-share.patch
@@ -6,11 +6,11 @@ Subject: Load locales from /usr/share
  lib/vagrant-cachier/plugin.rb | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/lib/vagrant-cachier/plugin.rb b/lib/vagrant-cachier/plugin.rb
-index bb337b1..2e3352c 100644
---- a/lib/vagrant-cachier/plugin.rb
-+++ b/lib/vagrant-cachier/plugin.rb
-@@ -3,7 +3,7 @@ unless Gem::Requirement.new('>= 1.4.0').satisfied_by?(Gem::Version.new(Vagrant::
+Index: vagrant-cachier.git/lib/vagrant-cachier/plugin.rb
+===================================================================
+--- vagrant-cachier.git.orig/lib/vagrant-cachier/plugin.rb
++++ vagrant-cachier.git/lib/vagrant-cachier/plugin.rb
+@@ -3,7 +3,7 @@ unless Gem::Requirement.new('>= 1.4.0').
  end
  
  # Add our custom translations to the load path
diff --git a/docs/buckets/dnf.md b/docs/buckets/dnf.md
new file mode 100644
index 0000000..9d897a1
--- /dev/null
+++ b/docs/buckets/dnf.md
@@ -0,0 +1,20 @@
+# DNF
+
+Used by Fedora guests, will get configured under guest's `/var/cache/dnf`. It will
+also [make sure](lib/vagrant-cachier/bucket/dnf.rb#L20) that `keepcache` is set to
+`1` on guest's `/etc/dnf/dnf.conf`.
+
+To manually enable it:
+
+```ruby
+Vagrant.configure("2") do |config|
+  config.vm.box = 'some-fedora-box'
+  config.cache.enable :dnf
+end
+```
+
+### :warning: Notice about Windows hosts :warning:
+
+In case this bucket is enabled and a Windows host is in use, you might see an
+ugly stacktrace as described on [this comment](https://github.com/fgrehm/vagrant-cachier/issues/117#issuecomment-50548393)
+if some DNF repository is not available during provisioning.
diff --git a/docs/buckets/pip.md b/docs/buckets/pip.md
new file mode 100644
index 0000000..bfa4a3b
--- /dev/null
+++ b/docs/buckets/pip.md
@@ -0,0 +1,15 @@
+# [pip](https://pip.pypa.io/)
+
+Compatible with probably any type of linux guest distro, will hook into pip's
+http and wheels cache directory under `$HOME/.cache/pip/http` and `$HOME/.cache/pip/wheels` as
+the default SSH user (usually `vagrant`) on your guest.
+
+To manually enable it:
+
+```ruby
+Vagrant.configure("2") do |config|
+  config.vm.box = 'some-box-with-pip-installed'
+  config.cache.enable :pip
+end
+```
+
diff --git a/docs/template.html b/docs/template.html
index 06b1eca..9679ad4 100644
--- a/docs/template.html
+++ b/docs/template.html
@@ -89,6 +89,7 @@
                   <li><a tabindex="-1" href="buckets/chef">Chef</a></li>
                   <li><a tabindex="-1" href="buckets/chef_rubygems">Chef Gems</a></li>
                   <li><a tabindex="-1" href="buckets/composer">Composer</a></li>
+                  <li><a tabindex="-1" href="buckets/dnf">DNF</a></li>
                   <li><a tabindex="-1" href="buckets/bower">Bower</a></li>
                   <li><a tabindex="-1" href="buckets/pacman">Pacman</a></li>
                   <li><a tabindex="-1" href="buckets/npm">npm</a></li>
@@ -96,6 +97,7 @@
                   <li><a tabindex="-1" href="buckets/rvm">rvm</a></li>
                   <li><a tabindex="-1" href="buckets/yum">Yum</a></li>
                   <li><a tabindex="-1" href="buckets/zypper">Zypper</a></li>
+                  <li><a tabindex="-1" href="buckets/pip">pip</a></li>
                 </ul>
               </li>
               <li>
diff --git a/lib/vagrant-cachier/bucket.rb b/lib/vagrant-cachier/bucket.rb
index ac4e76b..576b019 100644
--- a/lib/vagrant-cachier/bucket.rb
+++ b/lib/vagrant-cachier/bucket.rb
@@ -93,6 +93,7 @@ require_relative "bucket/gem"
 require_relative "bucket/chef_gem"
 require_relative "bucket/pacman"
 require_relative "bucket/yum"
+require_relative "bucket/dnf"
 require_relative "bucket/rvm"
 require_relative "bucket/apt_cacher"
 require_relative "bucket/apt_lists"
@@ -101,3 +102,4 @@ require_relative "bucket/bower"
 require_relative "bucket/npm"
 require_relative "bucket/zypper"
 require_relative "bucket/generic"
+require_relative "bucket/pip"
diff --git a/lib/vagrant-cachier/bucket/dnf.rb b/lib/vagrant-cachier/bucket/dnf.rb
new file mode 100644
index 0000000..93ca9c8
--- /dev/null
+++ b/lib/vagrant-cachier/bucket/dnf.rb
@@ -0,0 +1,27 @@
+module VagrantPlugins
+  module Cachier
+    class Bucket
+      class Dnf < Bucket
+        def self.capability
+          :dnf_cache_dir
+        end
+
+        def install
+          if guest.capability?(:dnf_cache_dir)
+            if guest_path = guest.capability(:dnf_cache_dir)
+              return if @env[:cache_dirs].include?(guest_path)
+
+              # Ensure caching is enabled
+              comm.sudo("sed -i '/keepcache=/d' /etc/dnf/dnf.conf")
+              comm.sudo("sed -i '/^[main]/a keepcache=1' /etc/dnf/dnf.conf")
+
+              symlink(guest_path)
+            end
+          else
+            @env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'DNF')
+          end
+        end
+      end
+    end
+  end
+end
diff --git a/lib/vagrant-cachier/bucket/pip.rb b/lib/vagrant-cachier/bucket/pip.rb
new file mode 100644
index 0000000..9be5c47
--- /dev/null
+++ b/lib/vagrant-cachier/bucket/pip.rb
@@ -0,0 +1,22 @@
+module VagrantPlugins
+  module Cachier
+    class Bucket
+      class Pip < Bucket
+        def self.capability
+          :pip_cache_dir
+        end
+
+        def install
+          if guest.capability?(:pip_cache_dir)
+            if guest_path = guest.capability(:pip_cache_dir)
+              symlink("#{guest_path}/http", "/tmp/vagrant-cache/#{@name}/http")
+              symlink("#{guest_path}/wheels", "/tmp/vagrant-cache/#{@name}/wheels")
+            end
+          else
+            @env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'pip')
+          end
+        end
+      end
+    end
+  end
+end
diff --git a/lib/vagrant-cachier/bucket/yum.rb b/lib/vagrant-cachier/bucket/yum.rb
index b58ce19..55a6f1f 100644
--- a/lib/vagrant-cachier/bucket/yum.rb
+++ b/lib/vagrant-cachier/bucket/yum.rb
@@ -8,13 +8,14 @@ module VagrantPlugins
 
         def install
           if guest.capability?(:yum_cache_dir)
-            guest_path = guest.capability(:yum_cache_dir)
-            return if @env[:cache_dirs].include?(guest_path)
+            if guest_path = guest.capability(:yum_cache_dir)
+              return if @env[:cache_dirs].include?(guest_path)
 
-            # Ensure caching is enabled
-            comm.sudo("sed -i 's/keepcache=0/keepcache=1/g' /etc/yum.conf")
+              # Ensure caching is enabled
+              comm.sudo("sed -i 's/keepcache=0/keepcache=1/g' /etc/yum.conf")
 
-            symlink(guest_path)
+              symlink(guest_path)
+            end
           else
             @env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'Yum')
           end
diff --git a/lib/vagrant-cachier/cap/linux/pip_cache_dir.rb b/lib/vagrant-cachier/cap/linux/pip_cache_dir.rb
new file mode 100644
index 0000000..29408f0
--- /dev/null
+++ b/lib/vagrant-cachier/cap/linux/pip_cache_dir.rb
@@ -0,0 +1,20 @@
+module VagrantPlugins
+  module Cachier
+    module Cap
+      module Linux
+        module PipCacheDir
+          def self.pip_cache_dir(machine)
+            pip_cache_dir = nil
+            machine.communicate.tap do |comm|
+              return unless comm.test('which pip')
+              comm.execute 'echo $HOME' do |buffer, output|
+                pip_cache_dir = output.chomp if buffer == :stdout
+              end
+            end
+            return "#{pip_cache_dir}/.cache/pip"
+          end
+        end
+      end
+    end
+  end
+end
diff --git a/lib/vagrant-cachier/cap/redhat/dnf_cache_dir.rb b/lib/vagrant-cachier/cap/redhat/dnf_cache_dir.rb
new file mode 100644
index 0000000..e9e42d6
--- /dev/null
+++ b/lib/vagrant-cachier/cap/redhat/dnf_cache_dir.rb
@@ -0,0 +1,18 @@
+module VagrantPlugins
+  module Cachier
+    module Cap
+      module RedHat
+        module DnfCacheDir
+          def self.dnf_cache_dir(machine)
+            dnf_cache_dir = nil
+            machine.communicate.tap do |comm|
+              return unless comm.test('which dnf')
+              dnf_cache_dir = '/var/cache/dnf'
+            end
+            return dnf_cache_dir
+          end
+        end
+      end
+    end
+  end
+end
diff --git a/lib/vagrant-cachier/cap/redhat/yum_cache_dir.rb b/lib/vagrant-cachier/cap/redhat/yum_cache_dir.rb
index 2639ab0..0b5b0d9 100644
--- a/lib/vagrant-cachier/cap/redhat/yum_cache_dir.rb
+++ b/lib/vagrant-cachier/cap/redhat/yum_cache_dir.rb
@@ -4,7 +4,13 @@ module VagrantPlugins
       module RedHat
         module YumCacheDir
           def self.yum_cache_dir(machine)
-            '/var/cache/yum'
+            yum_cache_dir = nil
+            machine.communicate.tap do |comm|
+              # In case yum is only forwarding to dnf do not cache
+              return unless not comm.test('yum --version 2>&1 | grep /usr/bin/dnf')
+              yum_cache_dir = '/var/cache/yum'
+            end
+            return yum_cache_dir
           end
         end
       end
diff --git a/lib/vagrant-cachier/capabilities.rb b/lib/vagrant-cachier/capabilities.rb
index 277ff37..ce73499 100644
--- a/lib/vagrant-cachier/capabilities.rb
+++ b/lib/vagrant-cachier/capabilities.rb
@@ -36,6 +36,11 @@ module VagrantPlugins
         Cap::Linux::NpmCacheDir
       end
 
+      guest_capability 'linux', 'pip_cache_dir' do
+        require_relative 'cap/linux/pip_cache_dir'
+        Cap::Linux::PipCacheDir
+      end
+      
       guest_capability 'debian', 'apt_cache_dir' do
         require_relative 'cap/debian/apt_cache_dir'
         Cap::Debian::AptCacheDir
@@ -56,6 +61,11 @@ module VagrantPlugins
         Cap::RedHat::YumCacheDir
       end
 
+      guest_capability 'redhat', 'dnf_cache_dir' do
+        require_relative 'cap/redhat/dnf_cache_dir'
+        Cap::RedHat::DnfCacheDir
+      end
+
       guest_capability 'suse', 'yum_cache_dir' do
         # Disable Yum on suse guests
       end

More details

Full run details