Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instance#clean! - do not remove downloads #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Instance#clean! - do not remove downloads #38

wants to merge 1 commit into from

Conversation

dazza-codes
Copy link
Contributor

Fix #37

@dazza-codes
Copy link
Contributor Author

dazza-codes commented May 5, 2017

If I make this change to the gem installed for hyku, then clean does not remove download .jar, only the .md5 file, e.g.

$ bundle install --path .gems
$ gvim .gems/ruby/2.4.0/gems/fcrepo_wrapper-0.8.0/lib/fcrepo_wrapper/instance.rb 
# edit that file as per this PR

$ ll ~/tmp/fcrepo_wrapper/
total 47M
-rw-r--r-- 1 dlweber users 47M May  5 14:25 fcrepo-webapp-4.7.1-jetty-console.jar
-rw-r--r-- 1 dlweber users  71 May  5 14:27 fcrepo-webapp-4.7.1-jetty-console.jar.md5

$ fcrepo_wrapper clean
cleaning /tmp/fcrepo-webapp-4.7.1-jetty-console...

$ ll ~/tmp/fcrepo_wrapper/
total 47M
-rw-r--r-- 1 dlweber users 47M May  5 14:25 fcrepo-webapp-4.7.1-jetty-console.jar

$ fcrepo_wrapper 
Starting Fedora 4.7.1 on port 8984 ...                                                                                                                            fcrepo-webapp-4.7.1-jetty-console.jar.md5: |==============================================================================================| 100% (Time: 00:00:00 )

etc. it's all good

@cbeer
Copy link
Owner

cbeer commented May 22, 2017

We should have a consistent approach, and wait to merge this until we resolve https://github.com/cbeer/solr_wrapper/pull/104/files.

@dazza-codes
Copy link
Contributor Author

Applied a similar approach to the current solr_wrapper PR, may be revised again when that PR resolves.

end

##
# Clean up any files in the fcrepo instance dir
def remove_instance_dir!
FileUtils.remove_entry(config.instance_dir, true) if File.exists? config.instance_dir
FileUtils.remove_entry(config.instance_dir, true)
end
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, when FileUtils.remove_* is called with the force: true, it ignores any StdErr on failures. Hence, the File.exists? checks are removed here.

@dazza-codes
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants