public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/gentoo-mate:master commit in: scripts/
@ 2016-09-20 21:32 NP Hardass
  0 siblings, 0 replies; 3+ messages in thread
From: NP Hardass @ 2016-09-20 21:32 UTC (permalink / raw
  To: gentoo-commits

commit:     f51b841b7bc3631bbc151b8531d350e416cd0ed2
Author:     NP-Hardass <NP-Hardass <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 20 21:23:52 2016 +0000
Commit:     NP Hardass <np-hardass <AT> gentoo <DOT> org>
CommitDate: Tue Sep 20 21:31:49 2016 +0000
URL:        https://gitweb.gentoo.org/proj/gentoo-mate.git/commit/?id=f51b841b

scripts: init-repo-mirror update uri, remote handling

 scripts/init-repo-mirror | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/init-repo-mirror b/scripts/init-repo-mirror
index d2910d9..f6d5b91 100755
--- a/scripts/init-repo-mirror
+++ b/scripts/init-repo-mirror
@@ -47,5 +47,6 @@ fi
 
 if ${REMOTES}; then
 	echo "Configuring Remotes"
-	git add remote github https://github.com/gentoo/gentoo-mate/ || die "Failed to configure remotes"
+	git remote remove github &>/dev/null
+	git remote add github git@github.com:gentoo/gentoo-mate.git || die "Failed to configure remotes"
 fi


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

* [gentoo-commits] proj/gentoo-mate:master commit in: scripts/
@ 2016-09-20 21:45 NP Hardass
  0 siblings, 0 replies; 3+ messages in thread
From: NP Hardass @ 2016-09-20 21:45 UTC (permalink / raw
  To: gentoo-commits

commit:     132d162638b25705de27f2f39b926d59f2b03094
Author:     NP-Hardass <NP-Hardass <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 20 21:45:25 2016 +0000
Commit:     NP Hardass <np-hardass <AT> gentoo <DOT> org>
CommitDate: Tue Sep 20 21:45:31 2016 +0000
URL:        https://gitweb.gentoo.org/proj/gentoo-mate.git/commit/?id=132d1626

scripts: test out new args for remote

 scripts/init-repo-mirror | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/init-repo-mirror b/scripts/init-repo-mirror
index f6d5b91..eba3d56 100755
--- a/scripts/init-repo-mirror
+++ b/scripts/init-repo-mirror
@@ -48,5 +48,5 @@ fi
 if ${REMOTES}; then
 	echo "Configuring Remotes"
 	git remote remove github &>/dev/null
-	git remote add github git@github.com:gentoo/gentoo-mate.git || die "Failed to configure remotes"
+	git remote add --mirror=push github git@github.com:gentoo/gentoo-mate.git || die "Failed to configure remotes"
 fi


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

* [gentoo-commits] proj/gentoo-mate:master commit in: scripts/
@ 2016-10-13 16:03 Ettore Di Giacinto
  0 siblings, 0 replies; 3+ messages in thread
From: Ettore Di Giacinto @ 2016-10-13 16:03 UTC (permalink / raw
  To: gentoo-commits

commit:     adb7a5cf8ebd6d3f102bbd46315373288edee0fc
Author:     mudler <mudler <AT> sabayon <DOT> org>
AuthorDate: Thu Oct 13 15:56:41 2016 +0000
Commit:     Ettore Di Giacinto <mudler <AT> sabayonlinux <DOT> org>
CommitDate: Thu Oct 13 15:57:04 2016 +0000
URL:        https://gitweb.gentoo.org/proj/gentoo-mate.git/commit/?id=adb7a5cf

scripts: Adding keyword-helper script to help out in KEYWORDS manipulations

 scripts/keyword-helper | 122 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 122 insertions(+)

diff --git a/scripts/keyword-helper b/scripts/keyword-helper
new file mode 100755
index 0000000..d5768a1
--- /dev/null
+++ b/scripts/keyword-helper
@@ -0,0 +1,122 @@
+#!/usr/bin/perl
+# keyword-helper - utility to ekeyword packages
+# Usage: from the root of the overlay
+# keyword-helper app-foo/bar-1.2 app-foo/baz-1.2
+# <mudler@sabayon.org>
+
+use Cwd;
+
+my $TARGET_KEYWORD = $ENV{TARGET_KEYWORD} // "amd64 x86"
+    ;    # KEYWORD changes, arguments are given directly to ekeyword
+my $BUGZ =
+    $ENV{BUGZ};    # Bug reference. Mandatory if no COMMIT_MSG is specified
+my $COMMIT_MSG = $ENV{COMMIT_MSG};    # Git commit message
+
+my @KEYWORD_PACKAGES = @ARGV;         # Packages that we want to manipulate
+my $CWD              = getcwd;
+
+sub strip_pvr { s/-[0-9]{1,}.*$//; }
+
+sub package_has_pvr { /-[0-9]{1,}.*$/; }
+
+# print helpers
+
+sub say { print join( "\n", @_ ) . "\n"; }
+
+sub err { say "\e[31m ", @_, " \e[0m"; }
+
+sub fatal { err @_; exit 1; }
+
+sub ok { say "\e[1;34m ", @_, " \e[0m"; }
+
+sub info { say "\e[1;37m ", @_, " \e[0m"; }
+
+# deadly checks
+
+if ( !@ARGV or $ARGV[0] eq "-h" or $ARGV[0] eq "--help" ) {
+    say "You must feed me with at least a package version", "",
+        "e.g. $0 package",        "",
+        "ENV variables options:", "",
+        " COMMIT_MSG \t\t default commit message",
+        " BUGZ \t\t Gentoo Bugzilla id, e.g. 596998",
+        " TARGET_KEYWORD \t the keyword(s) to set separated by a space. e.g. TARGET_KEYWORD='amd64 x86'";
+    exit 1;
+}
+
+if ( -e "${CWD}/Manifest" ) {
+    fatal "You are running me from the wrong folder, don't you?",
+        "I need to be executed from the root of the overlay!";
+}
+
+fatal "You should supply a bug id with the BUGZ environment variable or",
+    "a custom commit message with COMMIT_MSG at least"
+    if ( !$BUGZ and !$COMMIT_MSG );
+
+# Split TARGET_KEYWORD by space and put into an array
+my @ARCHES = split( /\s/, $TARGET_KEYWORD );
+
+# Cycle packages that need to be manipulated
+# Here it's being used $_, that contains strings in the following format:  category/package, contains package version and revision too
+for (@KEYWORD_PACKAGES) {
+    fatal
+        "You must feed me with package versions, not atoms or whatever!",
+        "bailing out since you are using me in the WRONG way, fix yourself first"
+        unless package_has_pvr;
+    my $local_package =
+        (/\/(.*)$/)[0]
+        . ".ebuild"
+        ;  # Extract the package name and version, included of revision if any
+    info "Keywording $TARGET_KEYWORD on $_ [$local_package]";
+    strip_pvr();    # stripping PVR
+
+    if ( -d $_ ) {
+        chdir($_);    # entering in the directory
+    }
+    else {
+        fatal "$_ directory doesn't exists";
+    }
+
+    # Checking if ebuild we want to keyword is there
+    if ( -e $local_package ) {
+
+        # Do magic with the ebuild, since it exists
+        foreach my $arch (@ARCHES) {
+            my $LOCAL_COMMIT_MSG = $COMMIT_MSG;
+
+            # if no COMMIT_MSG is supplied, we generate it
+            if ( !$COMMIT_MSG ) {
+                my ( $keyword_symbol, $clean_arch ) =
+                    ( $arch =~ /^(\^|\~|)(.*)$/ )
+                    ; # Getting the first character of a arch, it can be ~, ^ or "" to use it with ekeyword
+                my $prefix_msg;
+                if ( $keyword_symbol eq '^' ) {
+                    $prefix_msg = "Drop $clean_arch keyword ";
+                }
+                elsif ( $keyword_symbol eq '~' ) {
+                    $prefix_msg = "Added $arch keyword ";
+                }
+                elsif ( $keyword_symbol eq "" ) {
+                    $prefix_msg = "Stable on $clean_arch keyword ";
+                }
+                $LOCAL_COMMIT_MSG = $prefix_msg . "wrt \#${BUGZ}";
+            }
+
+            system("ekeyword $arch $local_package");
+            system("git add $local_package");
+            system("repoman commit -m '$_: $LOCAL_COMMIT_MSG'");
+            if ( $? >> 8 != 0 ) {
+                fatal
+                    "Meh. we got errors. before going on, i want you to fix those by hand.";
+            }
+            else {
+                ok "Done for $_ [$local_package]";
+            }
+        }
+
+    }
+    else {
+        # errors, the ebuild cannot be found
+            fatal "/!\\ $local_package not found in $_ keywording failed!";
+    }
+    chdir($CWD);
+}


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

end of thread, other threads:[~2016-10-13 16:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-13 16:03 [gentoo-commits] proj/gentoo-mate:master commit in: scripts/ Ettore Di Giacinto
  -- strict thread matches above, loose matches on Subject: below --
2016-09-20 21:45 NP Hardass
2016-09-20 21:32 NP Hardass

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