Skip to content

Commit 7143108

Browse files
committed
Support pgautofailover in update_os_package.pl
1 parent b85d795 commit 7143108

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

automated_packaging/update_os_package.pl

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@
1313
$github_repo_name = "citus-enterprise";
1414
$log_repo_name = "Citus Enterprise";
1515
}
16+
my $package_name = $github_repo_name;
17+
if ( $PROJECT eq "pgautofailover" ) {
18+
$github_repo_name = "pg_auto_failover";
19+
$package_name = "pg-auto-failover";
20+
$log_repo_name = "pg_auto_failover";
21+
}
22+
if ( $PROJECT eq "pgautofailover-enterprise" ) {
23+
$github_repo_name = "citus-ha";
24+
$package_name = "pg-auto-failover-enterprise";
25+
$log_repo_name = "pg_auto_failover enterprise";
26+
}
1627

1728
my $github_token = get_and_verify_token();
1829

@@ -70,9 +81,9 @@ sub get_changelog_for_debian {
7081

7182
# Based on the repo, update the package related variables
7283
if ( $DISTRO_VERSION eq "redhat" || $DISTRO_VERSION eq "microsoft" || $DISTRO_VERSION eq "all") {
73-
`sed -i 's|^Version:.*|Version: $VERSION.citus|g' $github_repo_name.spec`;
74-
`sed -i 's|^Source0:.*|Source0: https:\/\/github.com\/citusdata\/$github_repo_name\/archive\/v$VERSION.tar.gz|g' $github_repo_name.spec`;
75-
`sed -i 's|^%changelog|%changelog\\n* $abbr_day[$wday] $abbr_mon[$mon] $mday $year - $git_name <$microsoft_email> $VERSION.citus-1\\n- Update to $log_repo_name $VERSION\\n|g' $github_repo_name.spec`;
84+
`sed -i 's|^Version:.*|Version: $VERSION.citus|g' $package_name.spec`;
85+
`sed -i 's|^Source0:.*|Source0: https:\/\/github.com\/citusdata\/$package_name\/archive\/v$VERSION.tar.gz|g' $package_name.spec`;
86+
`sed -i 's|^%changelog|%changelog\\n* $abbr_day[$wday] $abbr_mon[$mon] $mday $year - $git_name <$microsoft_email> $VERSION.citus-1\\n- Update to $log_repo_name $VERSION\\n|g' $package_name.spec`;
7687
}
7788
if ( $DISTRO_VERSION eq "debian" || $DISTRO_VERSION eq "microsoft" || $DISTRO_VERSION eq "all") {
7889
open( DEB_CLOG_FILE, "<./debian/changelog" ) || die "Debian changelog file not found";
@@ -85,7 +96,7 @@ sub get_changelog_for_debian {
8596

8697
# Update the changelog file of the debian branch
8798
open( DEB_CLOG_FILE, ">./debian/changelog" ) || die "Debian changelog file not found";
88-
print DEB_CLOG_FILE "$github_repo_name ($VERSION.citus-1) stable; urgency=low\n";
99+
print DEB_CLOG_FILE "$package_name ($VERSION.citus-1) stable; urgency=low\n";
89100
print DEB_CLOG_FILE @changelog_print;
90101
print DEB_CLOG_FILE " -- $git_name <$microsoft_email> $abbr_day[$wday], $mday $abbr_mon[$mon] $year $print_hour:$min:$sec +0000\n\n";
91102
print DEB_CLOG_FILE @lines;

0 commit comments

Comments
 (0)