Skip to content

Commit

Permalink
- Check if the VCS dependencies are out-of-date, during --devel.
Browse files Browse the repository at this point in the history
When a package is now updated or installed with `--devel`, trizen will check if its VCS installed dependencies (git only, for now) are all up-to-date.

If not, then the out-of-date VCS dependencies will be updated first. After which the main package will be built and installed.

This helps with updating "intel-media-driver-git", which often requires the latest commit of "libva-git" in order to build successfully.
  • Loading branch information
trizen committed Jun 11, 2020
1 parent 041d7b4 commit 9af7560
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions trizen
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# Created: 07 July 2010
# First rewrite: 16 February 2011
# Second rewrite: 24 March 2012
# Latest edit: 13 March 2020
# Latest edit: 11 June 2020
# https://github.com/trizen/trizen

# Contributors:
Expand Down Expand Up @@ -1651,6 +1651,19 @@ sub install_packages_from_repo (@pkgs) {
return execute_pacman_command(1, @args, @pkgs);
}

sub install_dependency($name) {

# Activate `dependency` mode
local $lconfig{asdeps} = 1;

install_package($name) or do {
note(":: Dependency not found: <<$name>>");
return 0;
};

return 1;
}

sub install_package ($pkg) {

# Avoid circular dependencies
Expand Down Expand Up @@ -1815,7 +1828,13 @@ sub install_package ($pkg) {
}

if ($already_installed{lc $name} or (defined($local_version) ? defined($version) ? $is_up_to_date : 1 : 0)) {
msg(":: Dependency <<$pkgname>> is already installed -- skipping") if $lconfig{debug};
if ($lconfig{devel} and is_vcs_package($name) and is_vcs_package_ood($name)) {
msg(":: Dependency <<$pkgname>> seems to be {!out-of-date!} -- updating") if $lconfig{debug};
install_dependency($name) || next;
}
else {
msg(":: Dependency <<$pkgname>> is already installed -- skipping") if $lconfig{debug};
}
}
elsif (is_available_in_pacman_repo($pkgname)) {
msg(":: Dependency <<$pkgname>> is available in pacman's repository -- skipping") if $lconfig{debug};
Expand All @@ -1832,14 +1851,7 @@ sub install_package ($pkg) {
}

msg(":: Trying to install dependency: <<$name>>") if $lconfig{debug};

# Activate `dependency` mode
local $lconfig{asdeps} = 1;

install_package($name) or do {
note(":: Dependency not found: <<$name>>");
next;
};
install_dependency($name) || next;
}
}

Expand Down

0 comments on commit 9af7560

Please sign in to comment.