Skip to content

Support multiple remotes #44

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 167 additions & 0 deletions distros/fedora-41.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
#!/usr/bin/perl
{
'appimage_dependencies' => [
'ImageMagick',
'curl'
],
'has_binary_qt_package' => 0,
'package_manager' => 'dnf',
'cmake' => 'cmake',
'system_qt_dependencies' => [
'qt5-qtbase-devel',
'qt5-qtmultimedia-devel',
'qt5-qtscript-devel',
'qt5-qtwebkit-devel',
'qt5-qtwebengine-devel',
'qt5-qtbase-private-devel',
'qt5-linguist',
'qt5-qtxmlpatterns-devel',
'qt5-qtsvg-devel',
'qt5-qtwebchannel',
'qt5-qtwebsockets-devel'
],
'qt_configure_arguments' => [
'-nomake',
'examples',
'-nomake',
'tests',
'-skip',
'qttranslations',
'-skip',
'qtserialport',
'-skip',
'qt3d',
'-skip',
'qtlocation',
'-skip',
'qtwayland',
'-skip',
'qtsensors',
'-skip',
'qtgamepad',
'-skip',
'qtspeech',
'-skip',
'qtcharts',
'-skip',
'qtx11extras',
'-skip',
'qtmacextras',
'-skip',
'qtvirtualkeyboard',
'-skip',
'qtpurchasing',
'-skip',
'qtdatavis3d',
'-skip',
'qtlottie',
'-skip',
'qtquick3d',
'-skip',
'qtpim',
'-skip',
'qtdocgallery',
'-no-warnings-are-errors',
'-no-pch',
'-opengl',
'-xcb-xlib',
'-no-egl',
'-no-icu'
],

'qt_patches' => [ 'qt5.15-gcc11.patch' ],

'qt_source_dependencies' => [
'alsa-lib-devel',
'at-spi2-core-devel',
'bison',
'cups-devel',
'dbus-devel',
'firebird-devel',
'flex',
'fontconfig-devel',
'freetds-devel',
'glib2-devel',
'gperf',
'gtk3-devel',
'harfbuzz-devel',
'jsoncpp-devel',
'libICE-devel',
'libSM-devel',
'libdrm-devel',
'libicu-devel',
'libinput-devel',
'libjpeg-turbo-devel',
'libmng-devel',
'libpng-devel',
'libpq-devel',
'libproxy-devel',
'libstdc++-static',
'libtiff-devel',
'libvpx-devel',
'libwebp-devel',
'libxcb-devel',
'libxcb-devel',
'libxkbcommon-devel',
'libxkbcommon-x11-devel',
'libxml2-devel',
'libxslt-devel',
'mariadb-connector-c-devel',
'mesa-libEGL-devel',
'mesa-libGL-devel',
'mesa-libgbm-devel',
'nss-devel',
'openssl-devel',
'opus-devel',
'patch',
'pcre-devel',
'pcre2-devel',
'perl-generators',
'pulseaudio-libs-devel',
'python2.7',
'qt5-rpm-macros',
're2-devel',
'sqlite-devel',
'systemd-devel',
'unixODBC-devel',
'xcb-util-image-devel',
'xcb-util-keysyms-devel',
'xcb-util-renderutil-devel',
'xcb-util-wm-devel',
'xkeyboard-config-devel',
'zlib-devel',
'expat-devel'
],
'qt_version' => '5.15.2',
'source_dependencies' => [
'SDL2-devel',
'cmake',
'curl',
'gcc-c++',
'git',
'harfbuzz-devel',
'libatomic',
'make',
'nodejs-npm',
'patchelf',
'perl-Term-ReadLine-Gnu',
'python3-distro',
'python3.11',
'unzip',
'xdg-user-dirs',
'which',
'libXext-devel',
'openssl-devel',
],
'packaging' => {
'dependencies' => {
'domain-server' => [
'qt5-qtwebsockets',
'qt5-qtdeclarative',
'qt5-qtbase',
'qt5-qtscript',
'mesa-libGLU'
]
}
}
}
65 changes: 32 additions & 33 deletions overte-builder
Original file line number Diff line number Diff line change
Expand Up @@ -1569,35 +1569,7 @@ sub get_source_from_git {
if ( ! -d "$root_dir/$destdir/.git" ) {
clone_repo($url, $destdir, $tag, %opts);
} else {
info("Checking if updating the existing source is possible... ");

chdir("$root_dir/$destdir") or fatal("Can't chdir into $root_dir/$destdir: $!");
my @remotes = read_from_cmd("git", "remote", "-v");
my $no_update;

foreach my $line (@remotes) {
my ($name, $remote) = split(/\s+/, $line);
if ( $name ne "origin" ) {
info_ok("no, additional remote $name present.\n");
$no_update=1;
last;
}

if ( $remote ne $url ) {
info_ok("no, url '$remote' differs from wanted URL.\n");
$no_update=1;
last;
}
}

chdir($root_dir);

if ( $no_update ) {
clone_repo($url, $destdir, $tag, %opts);
} else {
info_ok("yes\n");
update_repo($url, $destdir, $tag, %opts);
}
update_repo($url, $destdir, $tag, %opts);
}
}

Expand Down Expand Up @@ -1639,21 +1611,48 @@ sub update_repo {
fatal("Can't update $root_dir/$destdir: there doesn't seem to be a git repo there!");
}


info_ok("Already cloned, updating...\n");

chdir("$root_dir/$destdir") or die "Can't change to directory $destdir";

my $remote_name;
my @remotes = read_from_cmd("git", "remote", "-v");

foreach my $line (@remotes) {
my ($name, $remote_url) = split(/\s+/, $line);
if ($remote_url eq $url) {
info("Will use existing remote $name\n");
$remote_name = $name;
last;
} else {
$remote_name = $url;
$remote_name =~ s/^.*?\:\/\///;
$remote_name =~ s/[^a-zA-Z0-9_-]/_/g;

info("Creating new remote $remote_name\n");
run("git", "remote", "add", $remote_name, $url);
last;
}
}


if ( !$opt_keep_source ) {
chdir("$root_dir/$destdir");
run("git", "fetch", "origin", "$tag:refs/remotes/origin/$tag");
#run("git", "fetch", "origin", "$tag:refs/remotes/origin/$tag");
info("Updating remote $remote_name\n");

run("git", "fetch", $remote_name);
run("git", "submodule", "update", "-f", "--init", "--recursive") unless ($opts{'no_submodules'});
run("git", "clean", "-f");

if ( $opts{pr} ) {
my $pr = $opts{pr};
info("Checking out PR $pr\n");
run("git", "fetch", "origin", "pull/$pr/head:PR-$pr");
run("git", "checkout", "PR-$pr");
run("git", "fetch", $remote_name, "pull/$pr/head:PR-$pr");
run("git", "reset", "--hard", "PR-$pr");
} else {
run("git", "checkout", "origin/$tag");
run("git", "reset", "--hard", "$remote_name/$tag");
}
}

Expand Down