Is Pkg.clone replaced by Pkg.add in v1.0.3?

pkg

#1

I’m trying to add some unregistered packages from online, and I have some legacy installation code that uses Pkg.clone instead of Pkg.add.
Is clone here replaced by add in 1.0?

Not sure if I’m right. It seems like Pkg.add = REPL add = a new version of clone which add package to Project.toml?
Reading this: [Julia 1.0 Replacement for `Pkg.clone(url::String, name::String)` and adding in Project.toml]


#2

Yes, see documentation on Pkg.add (especially the examples)

help?> Pkg.add
  Pkg.add(pkg::Union{String, Vector{String}})
  Pkg.add(pkg::Union{PackageSpec, Vector{PackageSpec}})

  Add a package to the current project. This package will be available using the import and using keywords in the Julia REPL and if the current project is a package, also inside that package.

  Examples
  ≡≡≡≡≡≡≡≡≡≡

  Pkg.add("Example") # Add a package from registry
  Pkg.add(PackageSpec(name="Example", version="0.3")) # Specify version
  Pkg.add(PackageSpec(url="https://github.com/JuliaLang/Example.jl", rev="master")) # From url
  Pkg.add(PackageSpec(url="/remote/mycompany/juliapackages/OurPackage"))` # From path (has to be a gitrepo)

  See also PackageSpec.

or the Pkg-REPL mode add

(v1.0) pkg> ?add
  add pkg[=uuid] [@version] [#rev] ...

  Add package pkg to the current project file. If pkg could refer to multiple different packages, specifying uuid allows you to disambiguate. @version optionally allows specifying which versions of packages. Versions
  may be specified by @1, @1.2, @1.2.3, allowing any version with a prefix that matches, or ranges thereof, such as @1.2-3.4.5. A git-revision can be specified by #branch or #commit.

  If a local path is used as an argument to add, the path needs to be a git repository. The project will then track that git repository just like if it is was tracking a remote repository online.

  Examples

  pkg> add Example
  pkg> add Example@0.5
  pkg> add Example#master
  pkg> add Example#c37b675
  pkg> add https://github.com/JuliaLang/Example.jl#master
  pkg> add git@github.com:JuliaLang/Example.jl.git
  pkg> add Example=7876af07-990d-54b4-ab0e-23690620f79a