summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbiao716.wang <biao716.wang@samsung.com>2023-05-04 12:46:01 +0900
committerbiao716.wang <biao716.wang@samsung.com>2023-05-04 12:46:06 +0900
commit1b4b5ed73cd0f2af8d1d920de0b1c2b6665c2cf5 (patch)
tree9e8765833a8257f451e42af875f7e758edc32d18
parent47053f9ad1f51d9858eb95e5d8255c2888b92de8 (diff)
downloadbuild-1b4b5ed73cd0f2af8d1d920de0b1c2b6665c2cf5.tar.gz
build-1b4b5ed73cd0f2af8d1d920de0b1c2b6665c2cf5.tar.bz2
build-1b4b5ed73cd0f2af8d1d920de0b1c2b6665c2cf5.zip
hide credentials information in logs
Change-Id: I26a391de6c1e0c18bc9aeff7f31294aad0ada6b6 Signed-off-by: biao716.wang <biao716.wang@samsung.com>
-rwxr-xr-xcreaterepomddeps10
1 files changed, 8 insertions, 2 deletions
diff --git a/createrepomddeps b/createrepomddeps
index 4347005..e183fc0 100755
--- a/createrepomddeps
+++ b/createrepomddeps
@@ -46,6 +46,12 @@ my $opt_bc;
my $opt_zypp;
my $cachedir = "/var/cache/build";
+sub hide_passwd {
+ my $url = shift;
+ $url =~ s|://[^@]*@|://|;
+ return $url
+}
+
sub printold {
my ($pkg, $baseurl, $old_seen) = @_;
@@ -111,8 +117,8 @@ for my $url (@ARGV) {
$baseurl .= '/' unless $baseurl =~ /\/$/;
if (! -s "${dir}repodata/repomd.xml") {
- die("zypp repo $url is not up to date, please refresh first\n") if $opt_zypp;
- die("repo $url does not contain a repomd.xml file\n");
+ die("zypp repo " . hide_passwd($url) . " is not up to date, please refresh first\n") if $opt_zypp;
+ die("repo " . hide_passwd($url) . " does not contain a repomd.xml file\n");
}
my @primaryfiles;