Skip to content

Commit

Permalink
Internal/add warning when xxx license (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
MajoBerger authored Aug 27, 2024
1 parent d277b3f commit dca65c2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ e.g.,`handle.additional.prefixes = 11858, 11234, 11372, 11346, 20.500.12801, 20.
## !!!Migration notes:!!!
- The values of table attributes that describe the last modification time of dspace object (for example attribute `last_modified` in table `Item`) have a value that represents the time when that object was migrated and not the value from migrated database dump.
- If you don't have valid and complete data, not all data will be imported.
- check if license link contains XXX. This is of course unsuitable for production run!

## Check import consistency

Use `tools/repo_diff` utility, see [README](tools/repo_diff/README.md).
Use `tools/repo_diff` utility, see [README](tools/repo_diff/README.md).
9 changes: 7 additions & 2 deletions src/pump/_license.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,21 @@ def update_license_def(env, lic_def_url: str):
env_lic = env.get("licenses", {})
if "to_replace_def_url" not in env_lic:
_logger.info(
"License def URL is not replaced, absolute path to the new repo must math the old one!")
"License def URL is not replaced, absolute"
"path to the new repo must match the old one!")
return lic_def_url

# Replace old site url to a new site url
if env_lic["to_replace_def_url"] in lic_def_url:
if 'XXX' in env_lic['replace_with_def_url']:
_logger.warning(f"New license contains XXX and is probably misconfigured: "
f"{lic_def_url}")
lic_def_url = lic_def_url.replace(
env_lic["to_replace_def_url"],
env_lic["replace_with_def_url"]
)
# File name has a missing `.html` suffix -> add that suffix to the end of the definition url
# File name has a missing `.html` suffix -> add that suffix
# to the end of the definition url
lic_def_url += '.html'

return lic_def_url

0 comments on commit dca65c2

Please sign in to comment.