mirror of
https://github.com/Mic92/nix-update.git
synced 2024-09-17 13:27:27 +03:00
consider revision when checking whether there was an update
This commit is contained in:
parent
71e0c9673c
commit
8ab80a4d7b
@ -160,7 +160,10 @@ def git_commit(git_dir: str, package: Package) -> None:
|
||||
if isinstance(package.cargo_lock, CargoLockInSource):
|
||||
cmd.append(package.cargo_lock.path)
|
||||
run(cmd, stdout=None)
|
||||
if new_version and package.old_version != new_version.number:
|
||||
if new_version and (
|
||||
package.old_version != new_version.number
|
||||
or (new_version.rev and new_version.rev != package.rev)
|
||||
):
|
||||
run(
|
||||
["git", "-C", git_dir, "commit", "--verbose", "--message", msg], stdout=None
|
||||
)
|
||||
|
@ -28,7 +28,11 @@ def replace_version(package: Package) -> bool:
|
||||
if new_version.startswith("v"):
|
||||
new_version = new_version[1:]
|
||||
|
||||
if old_version != new_version:
|
||||
changed = old_version != new_version or (
|
||||
package.new_version.rev is not None and package.new_version.rev != package.rev
|
||||
)
|
||||
|
||||
if changed:
|
||||
info(f"Update {old_version} -> {new_version} in {package.filename}")
|
||||
with fileinput.FileInput(package.filename, inplace=True) as f:
|
||||
for line in f:
|
||||
@ -38,7 +42,7 @@ def replace_version(package: Package) -> bool:
|
||||
else:
|
||||
info(f"Not updating version, already {old_version}")
|
||||
|
||||
return old_version != new_version
|
||||
return changed
|
||||
|
||||
|
||||
def to_sri(hashstr: str) -> str:
|
||||
|
Loading…
Reference in New Issue
Block a user