-
Notifications
You must be signed in to change notification settings - Fork 407
Remove dealing with descr and url files #6253
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
612ff8c
b43c23e
fc6454e
adb134e
9805cd4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -332,6 +332,24 @@ let packages_with_prefixes repo_root packages = | |
| (List.rev missing_pkgs))); | ||
| pkgs_map | ||
|
|
||
| let check_opam_file_version_url has_error repo_root prefix nv opam = | ||
| let min_opam_version = OpamVersion.of_string "2.0" in | ||
| let url_file = | ||
| let ( // ) = OpamFilename.Op.( // ) in | ||
| OpamFile.(make | ||
| (OpamRepositoryPath.packages repo_root prefix nv // "url")) | ||
| in | ||
| if OpamFile.exists url_file then | ||
| (OpamConsole.warning "Not updating external URL file at %s" | ||
| (OpamFile.to_string url_file); | ||
| true) | ||
| else if OpamVersion.compare opam.OpamFile.OPAM.opam_version min_opam_version < 0 then | ||
| (OpamConsole.warning "OPAM version must be >= 2.0 at %s" | ||
| (OpamFile.to_string (OpamRepositoryPath.opam repo_root prefix nv)); | ||
| true) | ||
| else | ||
| has_error | ||
|
|
||
| let update_extrafiles_command_doc = | ||
| "Add extra-files to an opam repository." | ||
| let update_extrafiles_command cli = | ||
|
|
@@ -368,12 +386,7 @@ let update_extrafiles_command cli = | |
| let opam_file = OpamRepositoryPath.opam repo_root prefix nv in | ||
| let opam = OpamFile.OPAM.read opam_file in | ||
| let has_error = | ||
| if OpamFile.exists (OpamRepositoryPath.url repo_root prefix nv) then | ||
| (OpamConsole.warning "Not updating external URL file at %s" | ||
| (OpamFile.to_string | ||
| (OpamRepositoryPath.url repo_root prefix nv)); | ||
| true) | ||
| else has_error | ||
| check_opam_file_version_url has_error repo_root prefix nv opam | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this command supposed to work only on 2.0 repos ? if yes, there is no need to handle url files. It is sufficient to have a check at the beginning and fail with a hint to |
||
| in | ||
| let files_dir = OpamRepositoryPath.files repo_root prefix nv in | ||
| if OpamFilename.exists_dir files_dir then | ||
|
|
@@ -552,11 +565,7 @@ let add_hashes_command cli = | |
| let opam_file = OpamRepositoryPath.opam repo_root prefix nv in | ||
| let opam = OpamFile.OPAM.read opam_file in | ||
| let has_error = | ||
| if OpamFile.exists (OpamRepositoryPath.url repo_root prefix nv) then | ||
| (OpamConsole.warning "Not updating external URL file at %s" | ||
| (OpamFile.to_string (OpamRepositoryPath.url repo_root prefix nv)); | ||
| true) | ||
| else has_error | ||
| check_opam_file_version_url has_error repo_root prefix nv opam | ||
| in | ||
| let process_url has_error urlf = | ||
| let hashes = OpamFile.URL.checksum urlf in | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,13 +41,6 @@ val packages: dirname -> string option -> package -> dirname | |
| {i $repo/packages/XXX/$NAME.$VERSION/opam} *) | ||
| val opam: dirname -> string option -> package -> OpamFile.OPAM.t OpamFile.t | ||
|
|
||
| (** Return the description file for a given package: | ||
| {i $repo/packages/XXX/$NAME.VERSION/descr} *) | ||
| val descr: dirname -> string option -> package -> OpamFile.Descr.t OpamFile.t | ||
|
|
||
| (** urls {i $repo/package/XXX/$NAME.$VERSION/url} *) | ||
| val url: dirname -> string option -> package -> OpamFile.URL.t OpamFile.t | ||
|
|
||
|
Comment on lines
-44
to
-50
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we still need them for upgrade functions. We can mark them as deprecated for use in external libraries, but opam lib need to keep for backward compatibility ftm.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what if we simply stopped supporting opam 1.x instead? 6 and a half years seems like a reasonable time for people to upgrade from a deprecated format
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In that case, we should remove all 1.2 upgrade code, not only a part.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it does not require maintenance per say but it holds us back from doing this type of change for example, which we could also call as some kind of maintenance burden |
||
| (** files {i $repo/packages/XXX/$NAME.$VERSION/files} *) | ||
| val files: dirname -> string option -> package -> dirname | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.