Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package seidl for openSUSE:Factory checked in at 2023-10-08 12:18:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/seidl (Old) and /work/SRC/openSUSE:Factory/.seidl.new.28202 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "seidl" Sun Oct 8 12:18:22 2023 rev:2 rq:1116098 version:0.2 Changes: -------- --- /work/SRC/openSUSE:Factory/seidl/seidl.changes 2022-05-12 23:00:41.792823885 +0200 +++ /work/SRC/openSUSE:Factory/.seidl.new.28202/seidl.changes 2023-10-08 12:21:44.165530137 +0200 @@ -1,0 +2,26 @@ +Mon Oct 2 04:58:40 UTC 2023 - Jeff Kowalczyk <jkowalc...@suse.com> + +- Packaging improvements: + * _service change disabled to manual per osc deprecation warning: + WARNING: Command 'disabledrun/dr' is obsolete, please convert + your _service to use 'manual' and then 'manualrun/mr' instead. + * _service change tar and recompress from buildtime to manual + * _service obs_scm param revision use git tag + * _service obs_scm param versionformat use @PARENT_TAG@ + * _service set_version move earlier in service ordering + * Update to BuildRequires: golang(API) >= 1.18 matching go.mod + * Drop BuildRequires: fdupes and usage during install step. Go + application packages have a small number of installed files and + this hasn't been an issue following the transition from GOPATH + (where sources were installed) to Go modules where only + binaries and supporting files e.g. doc, license are installed. + * Use %%name macro where applicable to normalize common lines + across Go app packages. Also makes renaming binary easier when + required to handle package name conflict. + +------------------------------------------------------------------- +Tue Aug 29 09:11:54 UTC 2023 - Felix Niederwanger <felix.niederwan...@suse.com> + +- Initial package version version 0.2 + +------------------------------------------------------------------- Old: ---- seidl-0.1.tar.gz New: ---- seidl-0.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ seidl.spec ++++++ --- /var/tmp/diff_new_pack.aOHRrr/_old 2023-10-08 12:21:45.313571413 +0200 +++ /var/tmp/diff_new_pack.aOHRrr/_new 2023-10-08 12:21:45.313571413 +0200 @@ -1,7 +1,7 @@ # # spec file for package seidl # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,21 +18,19 @@ Name: seidl Summary: Complementary light pint client -Url: https://github.com/grisu48/seidl -Version: 0.1 +URL: https://github.com/grisu48/seidl +Version: 0.2 Release: 0 License: MIT Group: Metapackages -Source: seidl-%{version}.tar.gz -BuildRequires: fdupes -BuildRequires: go >= 1.14 +Source: %{name}-%{version}.tar.gz +BuildRequires: golang(API) >= 1.18 %description seidl is a lightweight pint query utility designed for easy usage. It displays the current SUSE publiccloud images according to customizable filter rules. In aims at complementing the public-cloud-info-client by the feature to display all current not-deleted and not-deprecated images in a nice table on the console. - %prep %autosetup -D @@ -40,12 +38,10 @@ make seidl %install -install -D -m 0755 seidl "%{buildroot}/%{_bindir}/seidl" - -%fdupes %{buildroot} +install -D -m 0755 %{name} "%{buildroot}/%{_bindir}/%{name}" %files %doc README.md %license LICENSE -%{_bindir}/seidl +%{_bindir}/%{name} ++++++ _service ++++++ --- /var/tmp/diff_new_pack.aOHRrr/_old 2023-10-08 12:21:45.345572564 +0200 +++ /var/tmp/diff_new_pack.aOHRrr/_new 2023-10-08 12:21:45.349572708 +0200 @@ -1,16 +1,17 @@ <services> - <service name="obs_scm" mode="localonly"> + <service name="obs_scm" mode="manual"> <param name="url">https://github.com/grisu48/seidl.git</param> <param name="scm">git</param> - <param name="revision">main</param> - <param name="versionformat">v0.1</param> + <param name="revision">v0.2</param> + <param name="versionformat">@PARENT_TAG@</param> <param name="versionrewrite-pattern">v(.*)</param> + <param name="changesgenerate">enable</param> </service> - <service name="tar" mode="localonly"/> - <service name="recompress" mode="localonly"> + <service name="set_version" mode="manual"/> + <service name="tar" mode="manual"/> + <service name="recompress" mode="manual"> <param name="file">*.tar</param> <param name="compression">gz</param> </service> - <service name="set_version" mode="buildtime"/> </services> ++++++ seidl-0.1.tar.gz -> seidl-0.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/seidl-0.1/README.md new/seidl-0.2/README.md --- old/seidl-0.1/README.md 2022-05-11 16:01:48.000000000 +0200 +++ new/seidl-0.2/README.md 2022-06-30 14:21:44.000000000 +0200 @@ -27,6 +27,22 @@ seidl --list-aws-regions # List available AWS regions seidl --list-az-envs # List possible Azure environments + seidl --noformat ... # Don't format the output as a table + +## Install + +Checkout the [Releases](https://github.com/grisu48/seidl/releases) page of this repository. + +## openSUSE + +`seidl` is part of the openSUSE Tumbleweed packages and can be installed there via `zypper in seidl`. + +I build packages for openSUSE Leap in my [ph03nix:tools](https://build.opensuse.org/project/show/home:ph03nix:tools) repository. This is my personal "stable" repository (don't use my home repo, weird stuff happens there!). +For install instructions follow [this link](https://software.opensuse.org//download.html?project=home%3Aph03nix%3Atools&package=seidl) or try the following, if you understand what you are doing: + + zypper addrepo https://download.opensuse.org/repositories/home:ph03nix:tools/15.4/home:ph03nix:tools.repo + zypper refresh + zypper install seidl ## Build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/seidl-0.1/cmd/seidl/seidl.go new/seidl-0.2/cmd/seidl/seidl.go --- old/seidl-0.1/cmd/seidl/seidl.go 2022-05-11 16:01:48.000000000 +0200 +++ new/seidl-0.2/cmd/seidl/seidl.go 2022-06-30 14:21:44.000000000 +0200 @@ -10,11 +10,12 @@ "strings" ) -const VERSION = "0.1" +const VERSION = "0.2" type Config struct { Region string Filter string // filtering string + format string // Preferred output format. Currently only "" (none) and "table" are supported. Defaults to "" } var config Config @@ -75,18 +76,6 @@ i.Images = i.Images[:n] } -// Filter all images without the "suse-" prefix -func (i *Images) filterSUSE() { - n := 0 - for _, val := range i.Images { - if strings.HasPrefix(val.Name, "suse-") { - i.Images[n] = val - n++ - } - } - i.Images = i.Images[:n] -} - func (i *Image) filter(filter string) bool { if filter == "" { return true @@ -107,6 +96,7 @@ fmt.Println("CSP (cloud service providers) gce|aws|azure") fmt.Println("OPTIONS:") fmt.Println(" -f, --filter FILTER Filter results based on the given strings (comma-separated)") + fmt.Println(" -n,--noformat Don't format output text as table") fmt.Println(" --region Set region (required for AWS)") fmt.Println(" --list-aws-regions List AWS regions") fmt.Println(" --az-env Set environment (for Azure)") @@ -192,6 +182,7 @@ } func main() { + config.format = "table" // Parse program arguments, one after another args := os.Args[1:] if len(args) < 1 { @@ -239,6 +230,8 @@ } else if arg == "-r" || arg == "--region" { i += 1 config.Region = args[i] + } else if arg == "-n" || arg == "--noformat" { + config.format = "" } else if arg == "--list-az-envs" { envs, err := GetAzureEnvironments() if err != nil { @@ -278,9 +271,17 @@ } os.Exit(1) } - fmt.Printf("| %-58s | %-40s | %-20s |\n", "Name", "Project", "State") - for _, image := range images.Images { - fmt.Printf("%-60s | %-40s | %-20s\n", image.Name, image.Project, image.State) + if config.format == "table" { + fmt.Println("################################################################################") + fmt.Printf("# %-44s # %-18s # %-8s #\n", "Name", "Project", "State") + for _, image := range images.Images { + fmt.Printf("| %-45s| %-18s | %-8s |\n", image.Name, image.Project, image.State) + } + fmt.Println("################################################################################") + } else { + for _, image := range images.Images { + fmt.Printf("%-45s %-18s %-8s\n", image.Name, image.Project, image.State) + } } } else if isAWS(arg) { images, err := FetchImages("amazon") @@ -298,16 +299,41 @@ } os.Exit(1) } - if config.Region == "" { - fmt.Printf("| %-23s | %-60s | %-20s | %-20s |\n", "ID", "Name", "Region", "State") - for _, image := range images.Images { - fmt.Printf("%-25s | %-60s | %-20s | %-20s\n", image.Id, image.Name, image.Region, image.State) + + if config.Region != "" { + images.filterRegion(config.Region) + } + if len(images.Images) == 0 { + fmt.Fprintf(os.Stderr, "no images found for the given region\n") + os.Exit(1) + } + + if config.format == "table" { + // Note: I tried but because of the amount of information it's impossible to reduce it to 80 characters per line + if config.Region == "" { + fmt.Println("################################################################################################################") + fmt.Printf("# %-22s # %-55s # %-15s # %-9s #\n", "ID", "Name", "Region", "State") + for _, image := range images.Images { + fmt.Printf("| %-22s | %-55s | %-15s | %9s |\n", image.Id, image.Name, image.Region, image.State) + } + fmt.Println("################################################################################################################") + } else { + fmt.Println("################################################################################################") + fmt.Printf("# %-22s # %-55s # %-9s #\n", "ID", "Name", "State") + for _, image := range images.Images { + fmt.Printf("| %-22s | %-55s | %9s |\n", image.Id, image.Name, image.State) + } + fmt.Println("################################################################################################") } } else { - images.filterRegion(config.Region) - fmt.Printf("| %-23s | %-60s | %-20s |\n", "ID", "Name", "State") - for _, image := range images.Images { - fmt.Printf("%-25s | %-60s | %-20s\n", image.Id, image.Name, image.State) + if config.Region == "" { + for _, image := range images.Images { + fmt.Printf("%-22s %-55s %-15s %9s\n", image.Id, image.Name, image.Region, image.State) + } + } else { + for _, image := range images.Images { + fmt.Printf("%-22s %-55s %9s\n", image.Id, image.Name, image.State) + } } } } else if isAzure(arg) { @@ -316,8 +342,6 @@ fmt.Fprintf(os.Stderr, "error: %s\n", err) os.Exit(1) } - // Filter out weird entries - images.filterSUSE() n := images.filter(config.Filter) if len(images.Images) == 0 { if n == 0 { @@ -327,9 +351,18 @@ } os.Exit(1) } - fmt.Printf("| %-58s | %-60s | %-20s\n", "URN", "Name", "State") - for _, image := range images.Images { - fmt.Printf("%-60s | %-60s | %-20s\n", image.URN, image.Name, image.State) + + if config.format == "table" { + fmt.Println("###########################################################################") + fmt.Printf("# %-48s # %-20s #\n", "URN", "State") + for _, image := range images.Images { + fmt.Printf("| %-48s | %20s |\n", image.URN, image.State) + } + fmt.Println("###########################################################################") + } else { + for _, image := range images.Images { + fmt.Printf("%-48s %20s\n", image.URN, image.State) + } } } else { fmt.Fprintf(os.Stderr, "error: invalid CSP\n") ++++++ seidl.obsinfo ++++++ --- /var/tmp/diff_new_pack.aOHRrr/_old 2023-10-08 12:21:45.429575584 +0200 +++ /var/tmp/diff_new_pack.aOHRrr/_new 2023-10-08 12:21:45.433575728 +0200 @@ -1,5 +1,5 @@ name: seidl -version: 0.1 -mtime: 1652277708 -commit: bae7efa6a5b086abfe22cee32af12b4217c24e13 +version: 0.2 +mtime: 1656591704 +commit: c70ac1e1d6a07e7ebb418643df9b4650eaa6be8f