public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/bouncer:master commit in: perl/
@ 2018-12-10  5:15 Robin H. Johnson
  0 siblings, 0 replies; 3+ messages in thread
From: Robin H. Johnson @ 2018-12-10  5:15 UTC (permalink / raw
  To: gentoo-commits

commit:     7a7859fdf12e8c71fb60ae500ecc025cc40bf979
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 10 05:15:13 2018 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Mon Dec 10 05:15:13 2018 +0000
URL:        https://gitweb.gentoo.org/proj/bouncer.git/commit/?id=7a7859fd

perl: find db.conf when run from another path

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 perl/sentry.pl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/perl/sentry.pl b/perl/sentry.pl
index bc4788c..3da9291 100755
--- a/perl/sentry.pl
+++ b/perl/sentry.pl
@@ -9,6 +9,7 @@ use Data::Dumper;
 use LWP;
 use LWP::UserAgent;
 use Config::Tiny;
+use File::Basename;
 
 $ua = LWP::UserAgent->new;
 $ua->timeout(4);
@@ -17,7 +18,8 @@ $ua->agent("Gentoo Mirror Monitor/1.0");
 my $DEBUG = 1;
 my %products = ();
 my %oss = ();
-my $Config = Config::Tiny->read( 'db.conf' );
+my $dirname = dirname(__FILE__);
+my $Config = Config::Tiny->read( $dirname . '/db.conf' );
 
 # Some db credentials
 my $host = $Config->{database}->{host};


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] proj/bouncer:master commit in: perl/
@ 2018-12-10  5:22 Robin H. Johnson
  0 siblings, 0 replies; 3+ messages in thread
From: Robin H. Johnson @ 2018-12-10  5:22 UTC (permalink / raw
  To: gentoo-commits

commit:     08abc2e2a98d3fce6bb38439d9b2fbefd4ee4412
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 10 05:17:11 2018 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Mon Dec 10 05:17:11 2018 +0000
URL:        https://gitweb.gentoo.org/proj/bouncer.git/commit/?id=08abc2e2

perl/sentry: fix whitespace

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 perl/sentry.pl | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/perl/sentry.pl b/perl/sentry.pl
index 3da9291..ad82570 100755
--- a/perl/sentry.pl
+++ b/perl/sentry.pl
@@ -52,11 +52,11 @@ if ( $DEBUG ) {
 	}
 
 	$oss_sth = $dbh->prepare($oss_sql);
-        $oss_sth->execute();
+	$oss_sth->execute();
 
-        while ( my $os = $oss_sth->fetchrow_hashref() ) {
-                $oss{$os->{os_id}} = $os->{os_name};
-        }
+	while ( my $os = $oss_sth->fetchrow_hashref() ) {
+		$oss{$os->{os_id}} = $os->{os_name};
+	}
 }
 
 # let's build the location information


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] proj/bouncer:master commit in: perl/
@ 2018-12-10  7:16 Robin H. Johnson
  0 siblings, 0 replies; 3+ messages in thread
From: Robin H. Johnson @ 2018-12-10  7:16 UTC (permalink / raw
  To: gentoo-commits

commit:     d52d8dda5354b945ef6b5916237d93b4d582f97e
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 10 07:16:22 2018 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Mon Dec 10 07:16:22 2018 +0000
URL:        https://gitweb.gentoo.org/proj/bouncer.git/commit/?id=d52d8dda

sentry: set last_check timestamp

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>

 perl/sentry.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/perl/sentry.pl b/perl/sentry.pl
index ad82570..c0cf4ff 100755
--- a/perl/sentry.pl
+++ b/perl/sentry.pl
@@ -31,7 +31,7 @@ my $dbh = DBI->connect( "DBI:mysql:$db:$host",$user,$pass) or die "Connecting :
 $location_sql = qq{SELECT * FROM mirror_locations JOIN mirror_products USING (product_id) WHERE product_priority > 0 ORDER BY product_priority DESC};
 #$mirror_sql = qq{SELECT * FROM mirror_mirrors WHERE mirror_active IN ('1') ORDER BY mirror_rating DESC, mirror_name};
 $mirror_sql = qq{SELECT * FROM mirror_mirrors WHERE mirror_active IN ('1') ORDER BY RAND()};
-$update_sql = qq{REPLACE mirror_location_mirror_map SET location_id=?,mirror_id=?,location_active=?};
+$update_sql = qq{REPLACE mirror_location_mirror_map SET location_id=?, mirror_id=?, location_active=?, last_check=NOW()};
 
 my $location_sth = $dbh->prepare($location_sql);
 my $mirror_sth = $dbh->prepare($mirror_sql);


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-12-10  7:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-10  5:15 [gentoo-commits] proj/bouncer:master commit in: perl/ Robin H. Johnson
  -- strict thread matches above, loose matches on Subject: below --
2018-12-10  5:22 Robin H. Johnson
2018-12-10  7:16 Robin H. Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox