Relocated some packages to repo 'compile'

List of relocated subdirectories:

base/bash
base/golang-dep
base/rpm
python/python-2.7.5
base/golang

Story: 2006166
Task: 35687
Depends-On: I665dc7fabbfffc798ad57843eb74dca16e7647a3
Change-Id: I1afe2c0a2f9ca6acf70f29ae85f8497da7593bf8
Signed-off-by: Scott Little <scott.little@windriver.com>
Depends-On: I840888f0b012e9fb24e72f4e6a46567e6f949df7
This commit is contained in:
Scott Little 2019-09-04 10:14:28 -04:00 committed by Don Penney
parent 582fa84a7d
commit edb9f64aec
31 changed files with 0 additions and 8056 deletions

View File

@ -1,3 +0,0 @@
COPY_LIST="files/*"
TIS_PATCH_VER=4
BUILD_IS_SLOW=3

View File

@ -1,25 +0,0 @@
From 30796013a8d2b3b008a843bd3a4bee33e866a151 Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
Date: Mon, 2 Oct 2017 16:05:36 -0400
Subject: [PATCH 2/3] WRS: 0001-Update-package-versioning-for-TIS-format.patch
---
SPECS/bash.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/SPECS/bash.spec b/SPECS/bash.spec
index 4f16c8c..d749f92 100644
--- a/SPECS/bash.spec
+++ b/SPECS/bash.spec
@@ -6,7 +6,7 @@
Version: %{baseversion}%{patchleveltag}
Name: bash
Summary: The GNU Bourne Again shell
-Release: 31%{?dist}
+Release: 31.el7%{?_tis_dist}.%{tis_patch_ver}
Group: System Environment/Shells
License: GPLv3+
Url: http://www.gnu.org/software/bash
--
2.7.4

View File

@ -1,2 +0,0 @@
spec-TiS-bash-history.patch
0001-Update-package-versioning-for-TIS-format.patch

View File

@ -1,38 +0,0 @@
From cc0534185464b04c1d320518af7d2b73291ea449 Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
Date: Mon, 2 Oct 2017 16:05:36 -0400
Subject: [PATCH 1/3] WRS: spec-TiS-bash-history.patch
---
SPECS/bash.spec | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/SPECS/bash.spec b/SPECS/bash.spec
index 4b2ec49..4f16c8c 100644
--- a/SPECS/bash.spec
+++ b/SPECS/bash.spec
@@ -198,6 +198,10 @@ Patch153: bash-4.3-wshouldquote.patch
#1495398 - Append '/' while tab completing directory names
Patch154: bash-4.3-dircomp-append-slash.patch
+# Patches from WindRiver
+Patch500: bash-history-syslog.patch
+Patch501: bash-history-exit-child-on-parent-death.patch
+
BuildRequires: texinfo bison
BuildRequires: ncurses-devel
BuildRequires: autoconf, gettext
@@ -331,6 +335,10 @@ This package contains documentation files for %{name}.
%patch153 -p1 -b .wshouldquote
%patch154 -p1 -b .append-slash
+# WindRiver patches
+%patch500 -p1 -b .history-syslog
+%patch501 -p1 -b .history-exit-child-on-parent-death
+
echo %{version} > _distribution
echo %{release} > _patchlevel
--
2.7.4

View File

@ -1 +0,0 @@
mirror:Source/bash-4.2.46-31.el7.src.rpm

View File

@ -1,105 +0,0 @@
From 31e35dced8a76f9bec4ed2be86d0cca234751d09 Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
Date: Fri, 26 Aug 2016 16:04:48 -0400
Subject: [PATCH 2/2] WRS: Patch501:
bash-history-exit-child-on-parent-death.patch
---
shell.c | 16 +++++++++++++++-
sig.c | 13 +++++++++++++
sig.h | 2 ++
3 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/shell.c b/shell.c
index 7eca4e3..dcba61a 100644
--- a/shell.c
+++ b/shell.c
@@ -75,6 +75,7 @@
#if defined (SYSLOG_HISTORY)
# include <syslog.h>
# include <sys/socket.h>
+# include <sys/prctl.h>
# include "error.h"
#endif
@@ -338,6 +339,7 @@ static void shell_reinitialize __P((void));
static void show_shell_usage __P((FILE *, int));
#if defined (SYSLOG_HISTORY)
+int logger_terminated = 0;
static pid_t make_consumer_process __P(());
#endif
@@ -1687,6 +1689,16 @@ make_consumer_process ()
default_tty_job_signals ();
+ /* handle parent process deaths */
+ set_signal_handler(SIGTERM, sigterm_logger_sighandler);
+ prctl(PR_SET_PDEATHSIG, SIGTERM);
+
+ if (getppid() == 1)
+ {
+ /* parent has already died */
+ exit (0);
+ }
+
close(cmdline_hist_sock[0]);
ret = getsockopt(cmdline_hist_sock[1], SOL_SOCKET, SO_RCVBUF, &rcvbuf_size, &optlen);
@@ -1718,7 +1730,9 @@ make_consumer_process ()
/*syslog this bash command line*/
syslog (SYSLOG_FACILITY|SYSLOG_LEVEL, "HISTORY: PID=%d UID=%d %s",
getpid(), current_user.uid, buffer);
- } while (1);
+ } while (!logger_terminated);
+
+ exit(0);
}
else
diff --git a/sig.c b/sig.c
index 6bd1319..94864fa 100644
--- a/sig.c
+++ b/sig.c
@@ -561,6 +561,19 @@ termsig_handler (sig)
kill (getpid (), sig);
}
+sighandler
+sigterm_logger_sighandler (sig)
+ int sig;
+{
+#if defined (MUST_REINSTALL_SIGHANDLERS)
+ signal (sig, sigterm_logger_sighandler);
+#endif
+
+ logger_terminated = 1;
+
+ SIGRETURN (0);
+}
+
/* What we really do when SIGINT occurs. */
sighandler
sigint_sighandler (sig)
diff --git a/sig.h b/sig.h
index 540aa3e..8f47c56 100644
--- a/sig.h
+++ b/sig.h
@@ -115,11 +115,13 @@ extern volatile int sigwinch_received;
extern int interrupt_immediately;
extern int terminate_immediately;
+extern int logger_terminated;
/* Functions from sig.c. */
extern sighandler termsig_sighandler __P((int));
extern void termsig_handler __P((int));
extern sighandler sigint_sighandler __P((int));
+extern sighandler sigterm_logger_sighandler __P((int));
extern void initialize_signals __P((int));
extern void initialize_terminating_signals __P((void));
extern void reset_terminating_signals __P((void));
--
2.7.4

View File

@ -1,335 +0,0 @@
From 33e9b03f81e871594b1f8ab1740c09cd5593c27c Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
Date: Fri, 26 Aug 2016 16:04:44 -0400
Subject: [PATCH 1/2] WRS: Patch500: bash-history-syslog.patch
---
bashhist.c | 78 +-
config-top.h | 2 +-
shell.c | 111 +++
3 files changed, 173 insertions(+), 18 deletions(-)
diff --git a/bashhist.c b/bashhist.c
index 7240a5b..5116f8d 100644
--- a/bashhist.c
+++ b/bashhist.c
@@ -38,10 +38,6 @@
#include "bashintl.h"
-#if defined (SYSLOG_HISTORY)
-# include <syslog.h>
-#endif
-
#include "shell.h"
#include "flags.h"
#include "input.h"
@@ -54,6 +50,10 @@
#include <glob/glob.h>
#include <glob/strmatch.h>
+#if defined (SYSLOG_HISTORY)
+#include <sys/socket.h>
+#endif
+
#if defined (READLINE)
# include "bashline.h"
extern int rl_done, rl_dispatching; /* should really include readline.h */
@@ -68,6 +68,12 @@ static int check_history_control __P((char *));
static void hc_erasedups __P((char *));
static void really_add_history __P((char *));
+
+#if defined (SYSLOG_HISTORY)
+static void send_cmdline_mq __P((const char *));
+int cmdline_hist_sock[2];
+#endif
+
static struct ignorevar histignore =
{
"HISTIGNORE",
@@ -700,22 +706,11 @@ check_add_history (line, force)
}
#if defined (SYSLOG_HISTORY)
-#define SYSLOG_MAXLEN 600
-
void
bash_syslog_history (line)
const char *line;
{
- char trunc[SYSLOG_MAXLEN];
-
- if (strlen(line) < SYSLOG_MAXLEN)
- syslog (SYSLOG_FACILITY|SYSLOG_LEVEL, "HISTORY: PID=%d UID=%d %s", getpid(), current_user.uid, line);
- else
- {
- strncpy (trunc, line, SYSLOG_MAXLEN);
- trunc[SYSLOG_MAXLEN - 1] = '\0';
- syslog (SYSLOG_FACILITY|SYSLOG_LEVEL, "HISTORY (TRUNCATED): PID=%d UID=%d %s", getpid(), current_user.uid, trunc);
- }
+ send_cmdline_mq (line);
}
#endif
@@ -769,6 +764,10 @@ bash_add_history (line)
sprintf (new_line, "%s%s%s", current->line, chars_to_add, line);
offset = where_history ();
old = replace_history_entry (offset, new_line, current->data);
+
+#if defined (SYSLOG_HISTORY)
+ bash_syslog_history (new_line);
+#endif
free (new_line);
if (old)
@@ -779,11 +778,13 @@ bash_add_history (line)
}
if (add_it)
+ {
really_add_history (line);
#if defined (SYSLOG_HISTORY)
- bash_syslog_history (line);
+ bash_syslog_history (line);
#endif
+ }
using_history ();
}
@@ -906,4 +907,47 @@ history_should_ignore (line)
return match;
}
+
+#if defined (SYSLOG_HISTORY)
+
+#define MQ_SEND_MAX_ATTEMPT 2
+
+static void
+send_cmdline_mq (line)
+ const char *line;
+{
+ int ret = 0;
+ int attempt = 0;
+ int fail = 0;
+ size_t len_snd;
+ int sndbuf_size;
+
+ do {
+ if (attempt >= MQ_SEND_MAX_ATTEMPT)
+ {
+ fail = 1;
+ break;
+ }
+
+ len_snd = strlen(line)+1;
+ ret = send (cmdline_hist_sock[0], line, len_snd, MSG_DONTWAIT);
+ if (ret == EMSGSIZE)
+ {
+ socklen_t optlen = sizeof(sndbuf_size);
+ ret = getsockopt(cmdline_hist_sock[0], SOL_SOCKET, SO_SNDBUF,
+ &sndbuf_size, &optlen);
+ if (ret == 0) {
+ len_snd = sndbuf_size - 1;
+ continue;
+ }
+ }
+
+ attempt ++;
+ } while (ret < 0 && (errno == EAGAIN || errno == EINTR));
+
+ return;
+}
+
+#endif /*SYSLOG_HISTORY*/
+
#endif /* HISTORY */
diff --git a/config-top.h b/config-top.h
index 01e934e..c22c883 100644
--- a/config-top.h
+++ b/config-top.h
@@ -103,7 +103,7 @@
/* Define if you want each line saved to the history list in bashhist.c:
bash_add_history() to be sent to syslog(). */
-/* #define SYSLOG_HISTORY */
+#define SYSLOG_HISTORY
#if defined (SYSLOG_HISTORY)
# define SYSLOG_FACILITY LOG_USER
# define SYSLOG_LEVEL LOG_INFO
diff --git a/shell.c b/shell.c
index 6f9afcd..7eca4e3 100644
--- a/shell.c
+++ b/shell.c
@@ -72,6 +72,12 @@
# include <readline/history.h>
#endif
+#if defined (SYSLOG_HISTORY)
+# include <syslog.h>
+# include <sys/socket.h>
+# include "error.h"
+#endif
+
#if defined (READLINE)
# include "bashline.h"
#endif
@@ -106,6 +112,9 @@ extern int array_needs_making;
extern int gnu_error_format;
extern char *primary_prompt, *secondary_prompt;
extern char *this_command_name;
+#if defined (SYSLOG_HISTORY)
+extern int cmdline_hist_sock[2];
+#endif
/* Non-zero means that this shell has already been run; i.e. you should
call shell_reinitialize () if you need to start afresh. */
@@ -223,6 +232,7 @@ int dump_po_strings; /* Dump strings in $"..." in po format */
int wordexp_only = 0; /* Do word expansion only */
int protected_mode = 0; /* No command substitution with --wordexp */
+
#if defined (STRICT_POSIX)
int posixly_correct = 1; /* Non-zero means posix.2 superset. */
#else
@@ -327,6 +337,10 @@ static void shell_reinitialize __P((void));
static void show_shell_usage __P((FILE *, int));
+#if defined (SYSLOG_HISTORY)
+static pid_t make_consumer_process __P(());
+#endif
+
#ifdef __CYGWIN__
static void
_cygwin32_check_tmp ()
@@ -369,6 +383,11 @@ main (argc, argv, env)
env = environ;
#endif /* __OPENNT */
+
+#if defined (SYSLOG_HISTORY)
+ pid_t con_pid;
+#endif
+
USE_VAR(argc);
USE_VAR(argv);
USE_VAR(env);
@@ -747,6 +766,11 @@ main (argc, argv, env)
/* Initialize terminal state for interactive shells after the
.bash_profile and .bashrc are interpreted. */
get_tty_state ();
+
+#if defined (SYSLOG_HISTORY)
+ /*fork a child for bash history logging consumption*/
+ con_pid = make_consumer_process ();
+#endif
}
#if !defined (ONESHOT)
@@ -757,6 +781,13 @@ main (argc, argv, env)
/* Read commands until exit condition. */
reader_loop ();
+
+#if defined (SYSLOG_HISTORY)
+ if (interactive_shell && con_pid > 0) {
+ kill(con_pid, SIGKILL);
+ }
+#endif
+
exit_shell (last_command_exit_value);
}
@@ -1619,6 +1650,86 @@ set_shell_name (argv0)
shell_name = PROGRAM;
}
+
+#if defined (SYSLOG_HISTORY)
+#define SYSLOG_MAXLEN 1200
+
+/* Fork child process for bash history logging, handling errors.
+ Returns the pid of the newly made child in parent process context
+ and will not return in child process context. */
+static pid_t
+make_consumer_process ()
+{
+ pid_t pid;
+
+ if (socketpair(AF_UNIX, SOCK_DGRAM | SOCK_CLOEXEC, 0, cmdline_hist_sock) == -1)
+ {
+ return -1;
+ }
+
+
+ pid = fork ();
+ if (pid < 0)
+ {
+ return -1;
+ }
+
+ if (pid == 0)
+ {
+ int ret;
+ char *buffer;
+ int rcvbuf_size;
+ socklen_t optlen = sizeof(rcvbuf_size);
+
+#if defined (BUFFERED_INPUT)
+ unset_bash_input (0);
+#endif /* BUFFERED_INPUT */
+
+ default_tty_job_signals ();
+
+ close(cmdline_hist_sock[0]);
+
+ ret = getsockopt(cmdline_hist_sock[1], SOL_SOCKET, SO_RCVBUF, &rcvbuf_size, &optlen);
+ if (ret < 0)
+ {
+ rcvbuf_size = SYSLOG_MAXLEN;
+ }
+
+ buffer = (char *) malloc(rcvbuf_size);
+ if (buffer == NULL)
+ {
+ return -1;
+ }
+
+ do {
+ ret = recv(cmdline_hist_sock[1], buffer, rcvbuf_size, 0);
+
+ if (ret == -1 && errno == EINTR)
+ {
+ continue;
+ }
+ else if (ret < 0)
+ {
+ break;
+ }
+
+ buffer[ret] = '\0';
+
+ /*syslog this bash command line*/
+ syslog (SYSLOG_FACILITY|SYSLOG_LEVEL, "HISTORY: PID=%d UID=%d %s",
+ getpid(), current_user.uid, buffer);
+ } while (1);
+
+ }
+ else
+ {
+ /* In the parent. */
+ close(cmdline_hist_sock[1]);
+ }
+ return (pid);
+}
+#endif /*SYSLOG_HISTORY*/
+
static void
init_interactive ()
{
--
1.9.1

View File

@ -1,2 +0,0 @@
COPY_LIST="$CGCS_BASE/downloads/dep-v0.5.0.tar.gz"
TIS_PATCH_VER=0

View File

@ -1,45 +0,0 @@
Name: golang-dep
Version: 0.5.0
Release: %{tis_patch_ver}%{?_tis_dist}
Summary: Go dep dependency management tool
Group: Development/Languages
License: Go
URL: https://github.com/golang/dep
Source: dep-v0.5.0.tar.gz
BuildRequires: golang
Requires: golang
%global with_debug 0
%global debug_package %{nil}
%define __spec_install_post %{nil}
%define tooldir %{_libdir}/go/pkg/%{name}/linux_amd64
%if ! 0%{?gobuild:1}
%define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**};
%endif
%description
This package includes additional go development tools.
%prep
%setup -T -c -n go/src/github.com/golang/dep
tar --strip-components=1 -x -f %{SOURCE0}
%build
export GOPATH=%{_builddir}/go
(cd cmd/dep && %gobuild -o dep)
%install
rm -rf %{buildroot}
install -d %{buildroot}%{_bindir}
install -d %{buildroot}%{tooldir}
install cmd/dep/dep %{buildroot}%{_bindir}
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%{_bindir}/dep

View File

@ -1,5 +0,0 @@
The spec file used here was from the golang 1.11.2 src rpm.
The orig file is included to help show modifications made to that
spec file, to help understand which changes were needed and to
assist with future upversioning.

View File

@ -1,8 +0,0 @@
VERSION=1.12.9
TAR_NAME=go
TAR="$TAR_NAME$VERSION.src.tar.gz"
CONTRIB="$TAR_NAME-contrib-v$CON_VERSION.tar.gz"
COPY_LIST="${CGCS_BASE}/downloads/$TAR $FILES_BASE/*"
TIS_PATCH_VER=1

View File

@ -1,88 +0,0 @@
From edce31a2904846ae74e3c011f2cf5fddc963459e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jakub=20=C4=8Cajka?= <jcajka@redhat.com>
Date: Thu, 22 Mar 2018 12:07:32 +0100
Subject: [PATCH 1/3] Don't use the bundled tzdata at runtime, except for the
internal test suite
---
src/time/internal_test.go | 7 +++++--
src/time/zoneinfo_test.go | 3 ++-
src/time/zoneinfo_unix.go | 2 --
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/time/internal_test.go b/src/time/internal_test.go
index 76d5524124..e81ace5f64 100644
--- a/src/time/internal_test.go
+++ b/src/time/internal_test.go
@@ -4,13 +4,15 @@
package time
+import "runtime"
+
func init() {
// force US/Pacific for time zone tests
ForceUSPacificForTesting()
}
func initTestingZone() {
- z, err := loadLocation("America/Los_Angeles", zoneSources[len(zoneSources)-1:])
+ z, err := loadLocation("America/Los_Angeles", zoneSources)
if err != nil {
panic("cannot load America/Los_Angeles for testing: " + err.Error())
}
@@ -21,8 +23,9 @@ func initTestingZone() {
var OrigZoneSources = zoneSources
func forceZipFileForTesting(zipOnly bool) {
- zoneSources = make([]string, len(OrigZoneSources))
+ zoneSources = make([]string, len(OrigZoneSources)+1)
copy(zoneSources, OrigZoneSources)
+ zoneSources = append(zoneSources, runtime.GOROOT()+"/lib/time/zoneinfo.zip")
if zipOnly {
zoneSources = zoneSources[len(zoneSources)-1:]
}
diff --git a/src/time/zoneinfo_test.go b/src/time/zoneinfo_test.go
index 7a55d4f618..6063ca1195 100644
--- a/src/time/zoneinfo_test.go
+++ b/src/time/zoneinfo_test.go
@@ -8,6 +8,7 @@ import (
"fmt"
"os"
"reflect"
+ "runtime"
"testing"
"time"
)
@@ -128,7 +129,7 @@ func TestLoadLocationFromTZData(t *testing.T) {
t.Fatal(err)
}
- tzinfo, err := time.LoadTzinfo(locationName, time.OrigZoneSources[len(time.OrigZoneSources)-1])
+ tzinfo, err := time.LoadTzinfo(locationName, runtime.GOROOT()+"/lib/time/zoneinfo.zip")
if err != nil {
t.Fatal(err)
}
diff --git a/src/time/zoneinfo_unix.go b/src/time/zoneinfo_unix.go
index 88313aa0ed..d9596115ef 100644
--- a/src/time/zoneinfo_unix.go
+++ b/src/time/zoneinfo_unix.go
@@ -12,7 +12,6 @@
package time
import (
- "runtime"
"syscall"
)
@@ -22,7 +21,6 @@ var zoneSources = []string{
"/usr/share/zoneinfo/",
"/usr/share/lib/zoneinfo/",
"/usr/lib/locale/TZ/",
- runtime.GOROOT() + "/lib/time/zoneinfo.zip",
}
func initLocal() {
--
2.14.3

View File

@ -1,41 +0,0 @@
From 817407fc2d6a861e65086388766f58082d38bc0b Mon Sep 17 00:00:00 2001
From: Michael Munday <munday@ca.ibm.com>
Date: Tue, 17 Jan 2017 11:33:38 -0500
Subject: [PATCH 2/3] syscall: expose IfInfomsg.X__ifi_pad on s390x
Exposing this field on s390x improves compatibility with the other
linux architectures, all of which already expose it.
Fixes #18628 and updates #18632.
Change-Id: I08e8e1eb705f898cd8822f8bee0d61ce11d514b5
---
src/syscall/ztypes_linux_s390x.go | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/syscall/ztypes_linux_s390x.go b/src/syscall/ztypes_linux_s390x.go
index 63c4a83b19..b5894255df 100644
--- a/src/syscall/ztypes_linux_s390x.go
+++ b/src/syscall/ztypes_linux_s390x.go
@@ -449,12 +449,12 @@ type RtAttr struct {
}
type IfInfomsg struct {
- Family uint8
- _ uint8
- Type uint16
- Index int32
- Flags uint32
- Change uint32
+ Family uint8
+ X__ifi_pad uint8
+ Type uint16
+ Index int32
+ Flags uint32
+ Change uint32
}
type IfAddrmsg struct {
--
2.14.3

View File

@ -1,7 +0,0 @@
// +build rpm_crashtraceback
package runtime
func init() {
setTraceback("crash")
}

View File

@ -1 +0,0 @@
add-auto-load-safe-path /usr/lib/golang/src/runtime/runtime-gdb.py

View File

@ -1,3 +0,0 @@
# there are ELF files in src which are testdata and shouldn't be modified
-b /usr/lib/golang/src
-b /usr/lib64/golang/src

View File

@ -1,8 +0,0 @@
# Where to set GOPATH for builds. Like:
# export GOPATH=$(pwd)/_build:%{gopath}
%gopath %{_datadir}/gocode
# for use like:
# ExclusiveArch: %{go_arches}
%go_arches %{ix86} x86_64 %{arm} aarch64 ppc64le

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +0,0 @@
TAR_NAME=rpm
VERSION=4.14.0
TIS_PATCH_VER=1
COPY_LIST="$CGCS_BASE/downloads/$TAR_NAME-$VERSION.tar.bz2 patches/*"

File diff suppressed because it is too large Load Diff

View File

@ -1,206 +0,0 @@
diff --git a/rpmsign.c b/rpmsign.c
index ae86f66..8855e01 100644
--- a/rpmsign.c
+++ b/rpmsign.c
@@ -19,7 +19,7 @@ enum modes {
static int mode = MODE_NONE;
#ifdef WITH_IMAEVM
-static int signfiles = 0, fskpass = 0;
+static int signfiles = 0, fskpass = 0, signpkg=0;
static char * fileSigningKey = NULL;
#endif
@@ -97,9 +97,11 @@ static int doSign(poptContext optCon, struct rpmSignArgs *sargs)
int rc = EXIT_FAILURE;
char * name = rpmExpand("%{?_gpg_name}", NULL);
- if (rstreq(name, "")) {
- fprintf(stderr, _("You must set \"%%_gpg_name\" in your macro file\n"));
- goto exit;
+ if (signpkg) {
+ if (rstreq(name, "")) {
+ fprintf(stderr, _("You must set \"%%_gpg_name\" in your macro file\n"));
+ goto exit;
+ }
}
#ifdef WITH_IMAEVM
@@ -179,7 +181,11 @@ int main(int argc, char *argv[])
}
break;
case MODE_NONE:
- printUsage(optCon, stderr, 0);
+ if (signfiles) {
+ ec = doSign(optCon, &sargs);
+ } else {
+ printUsage(optCon, stderr, 0);
+ }
break;
default:
argerror(_("only one major mode may be specified"));
diff --git a/sign/rpmgensig.c b/sign/rpmgensig.c
index d29c178..66168d2 100644
--- a/sign/rpmgensig.c
+++ b/sign/rpmgensig.c
@@ -507,7 +507,9 @@ static rpmRC replaceSigDigests(FD_t fd, const char *rpm, Header *sigp,
goto exit;
}
+/*
headerFree(*sigp);
+*/
rc = rpmReadSignature(fd, sigp, NULL);
if (rc != RPMRC_OK) {
rpmlog(RPMLOG_ERR, _("rpmReadSignature failed\n"));
@@ -519,6 +521,15 @@ exit:
}
#endif
+static void *nullDigest(int algo, int ascii)
+{
+ void *d = NULL;
+ DIGEST_CTX ctx = rpmDigestInit(algo, 0);
+ rpmDigestFinal(ctx, &d, NULL, ascii);
+ return d;
+}
+
+
static rpmRC includeFileSignatures(FD_t fd, const char *rpm,
Header *sigp, Header *hdrp,
off_t sigStart, off_t headerStart)
@@ -572,6 +583,27 @@ static rpmRC includeFileSignatures(FD_t fd, const char *rpm,
goto exit;
}
+ /* Generate and write a placeholder signature header */
+ if (Fseek(fd, sigStart, SEEK_SET) < 0) {
+ rc = RPMRC_FAIL;
+ rpmlog(RPMLOG_ERR, _("Could not seek in file %s: %s\n"),
+ rpm, Fstrerror(fd));
+ goto exit;
+ }
+ SHA1 = nullDigest(PGPHASHALGO_SHA1, 1);
+ SHA256 = nullDigest(PGPHASHALGO_SHA256, 1);
+ MD5 = nullDigest(PGPHASHALGO_MD5, 0);
+ replaceSigDigests(fd, rpm, sigp, sigStart, sigTargetSize, SHA256, SHA1, MD5);
+ SHA1 = _free(SHA1);
+ SHA256 = _free(SHA256);
+ MD5 = _free(MD5);
+ SHA1 = NULL;
+ SHA256 = NULL;
+ MD5 = NULL;
+
+ /* get new header start */
+ headerStart = Ftell(fd);
+
if (Fseek(fd, headerStart, SEEK_SET) < 0) {
rc = RPMRC_FAIL;
rpmlog(RPMLOG_ERR, _("Could not seek in file %s: %s\n"),
@@ -590,9 +622,12 @@ static rpmRC includeFileSignatures(FD_t fd, const char *rpm,
rpmlog(RPMLOG_ERR, _("headerWrite failed\n"));
goto exit;
}
+
fdFiniDigest(fd, RPMSIGTAG_SHA1, (void **)&SHA1, NULL, 1);
/* Only add SHA256 if it was there to begin with */
+/*
if (headerIsEntry(*sigp, RPMSIGTAG_SHA256))
+*/
fdFiniDigest(fd, RPMSIGTAG_SHA256, (void **)&SHA256, NULL, 1);
/* Copy archive from temp file */
@@ -621,8 +656,10 @@ static rpmRC includeFileSignatures(FD_t fd, const char *rpm,
rpmlog(RPMLOG_WARNING,
_("%s already contains identical file signatures\n"),
rpm);
- else
+ else {
replaceSigDigests(fd, rpm, sigp, sigStart, sigTargetSize, SHA256, SHA1, MD5);
+ rc = headerWrite(fd, *hdrp, HEADER_MAGIC_YES);
+ }
exit:
free(trpm);
@@ -697,6 +734,22 @@ static int rpmSign(const char *rpm, int deleting, int signfiles)
if (signfiles) {
includeFileSignatures(fd, rpm, &sigh, &h, sigStart, headerStart);
+
+ if (Fseek(fd, sigStart, SEEK_SET) < 0) {
+ rpmlog(RPMLOG_ERR, _("Could not seek in file %s: %s\n"),
+ rpm, Fstrerror(fd));
+ goto exit;
+ }
+
+ rc = rpmReadSignature(fd, &sigh, &msg);
+ if (rc != RPMRC_OK) {
+ rpmlog(RPMLOG_ERR, _("%s: rpmReadSignature failed: %s"), rpm,
+ (msg && *msg ? msg : "\n"));
+ goto exit;
+ }
+
+ headerStart = Ftell(fd);
+
}
unloadImmutableRegion(&sigh, RPMTAG_HEADERSIGNATURES);
@@ -730,6 +783,7 @@ static int rpmSign(const char *rpm, int deleting, int signfiles)
}
/* Try to make new signature smaller to have size of original signature */
+/*
rpmtdReset(&utd);
if (headerGet(sigh, RPMSIGTAG_RESERVEDSPACE, &utd, HEADERGET_MINMEM)) {
int diff;
@@ -752,6 +806,7 @@ static int rpmSign(const char *rpm, int deleting, int signfiles)
insSig = 1;
}
}
+*/
/* Reallocate the signature into one contiguous region. */
sigh = headerReload(sigh, RPMTAG_HEADERSIGNATURES);
@@ -794,12 +849,12 @@ static int rpmSign(const char *rpm, int deleting, int signfiles)
Fstrerror(ofd));
goto exit;
}
-
if (Fseek(fd, headerStart, SEEK_SET) < 0) {
rpmlog(RPMLOG_ERR, _("Could not seek in file %s: %s\n"),
rpm, Fstrerror(fd));
goto exit;
}
+
/* Append the header and archive from the temp file */
if (copyFile(&fd, rpm, &ofd, trpm) == 0) {
struct stat st;
@@ -848,7 +903,7 @@ int rpmPkgSign(const char *path, const struct rpmSignArgs * args)
}
}
- rc = rpmSign(path, 0, args ? args->signfiles : 0);
+ rc = rpmSign(path, args ? args->signfiles : 0, args ? args->signfiles : 0);
if (args) {
if (args->hashalgo) {
diff --git a/sign/rpmsignfiles.c b/sign/rpmsignfiles.c
index 61b73bd..d6c593d 100644
--- a/sign/rpmsignfiles.c
+++ b/sign/rpmsignfiles.c
@@ -126,10 +126,15 @@ rpmRC rpmSignFiles(Header h, const char *key, char *keypass)
rc = RPMRC_FAIL;
goto exit;
}
+/*
free(signature);
+*/
+
}
exit:
+/*
rpmtdFreeData(&digests);
+*/
return rc;
}

View File

@ -1,3 +0,0 @@
The src rpm version indicates that we are patching python 2.7.5, however there are at least 58 patches
added by Centos to fix issues fixed in the later python 2.7 releases.

View File

@ -1 +0,0 @@
TIS_PATCH_VER=4

View File

@ -1,25 +0,0 @@
From 61ff7bbc259e5729f58536bdb6e3a554de6be514 Mon Sep 17 00:00:00 2001
From: Al Bailey <Al.Bailey@windriver.com>
Date: Tue, 27 Mar 2018 12:38:50 -0500
Subject: [PATCH 1/4] Update package versioning for TIS format
---
SPECS/python.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/SPECS/python.spec b/SPECS/python.spec
index 2af363e..c3706be 100644
--- a/SPECS/python.spec
+++ b/SPECS/python.spec
@@ -114,7 +114,7 @@ Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
# Remember to also rebase python-docs when changing this:
Version: 2.7.5
-Release: 76%{?dist}
+Release: 76.el7%{?_tis_dist}.%{tis_patch_ver}
License: Python
Group: Development/Languages
Requires: %{python}-libs%{?_isa} = %{version}-%{release}
--
2.7.4

View File

@ -1,25 +0,0 @@
From 2f23c2c6194d828de7bede593926007802cca610 Mon Sep 17 00:00:00 2001
From: Al Bailey <Al.Bailey@windriver.com>
Date: Tue, 6 Mar 2018 18:21:48 -0600
Subject: [PATCH] Disable unittest check phase
---
SPECS/python.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/SPECS/python.spec b/SPECS/python.spec
index a9fd32f..1030c57 100644
--- a/SPECS/python.spec
+++ b/SPECS/python.spec
@@ -62,7 +62,7 @@
%global with_gdbm 1
# Turn this to 0 to turn off the "check" phase:
-%global run_selftest_suite 1
+%global run_selftest_suite 0
# Some of the files below /usr/lib/pythonMAJOR.MINOR/test (e.g. bad_coding.py)
# are deliberately invalid, leading to SyntaxError exceptions if they get
--
1.8.3.1

View File

@ -1,42 +0,0 @@
From 089860dac0d15120466dc7d9e38041dbaae505eb Mon Sep 17 00:00:00 2001
From: Al Bailey <Al.Bailey@windriver.com>
Date: Wed, 28 Mar 2018 08:26:56 -0500
Subject: [PATCH] Make Python Faster
---
SPECS/python.spec | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/SPECS/python.spec b/SPECS/python.spec
index 94adb05..36289ea 100644
--- a/SPECS/python.spec
+++ b/SPECS/python.spec
@@ -1301,6 +1301,8 @@ Patch306: 00306-fix-oserror-17-upon-semaphores-creation.patch
# above:
Patch5000: 05000-autotool-intermediates.patch
+Patch9000: Rollup-optimization-commits.patch
+
# ======================================================
# Additional metadata, and subpackages
# ======================================================
@@ -1719,6 +1721,7 @@ find -name "*~" |xargs rm -f
%patch5000 -p0 -b .autotool-intermediates
%endif
+%patch9000 -p1
# ======================================================
# Configuring and building the code:
@@ -1849,7 +1852,7 @@ BuildPython debug \
BuildPython optimized \
python \
python%{pybasever} \
- "" \
+ "--enable-optimizations --with-computed-gotos" \
true
--
2.7.4

View File

@ -1,25 +0,0 @@
From 83b8eb17d13fd5afdb926698082e47cba029c531 Mon Sep 17 00:00:00 2001
From: Al Bailey <Al.Bailey@windriver.com>
Date: Wed, 28 Mar 2018 15:23:35 -0500
Subject: [PATCH] Turn off with_systemtap to disable dtrace
---
SPECS/python.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/SPECS/python.spec b/SPECS/python.spec
index 2441951..c2edce8 100644
--- a/SPECS/python.spec
+++ b/SPECS/python.spec
@@ -43,7 +43,7 @@
%global with_gdb_hooks 1
-%global with_systemtap 1
+%global with_systemtap 0
# some arches don't have valgrind so we need to disable its support on them
%ifarch %{ix86} x86_64 ppc %{power64} s390x aarch64
--
1.8.3.1

View File

@ -1,4 +0,0 @@
0001-Update-package-versioning-for-TIS-format.patch
0002-Disable-unittest-check-phase.patch
0003-Make-Python-Faster.patch
0004-Turn-off-with_systemtap-to-disable-dtrace.patch

View File

@ -1,2 +0,0 @@
mirror:Source/python-2.7.5-76.el7.src.rpm