rel-eng/packages schema/spacewalk
by Jan Pazdziora
rel-eng/packages/spacewalk-schema | 2 +-
schema/spacewalk/spacewalk-schema.spec | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 1cbddebae8f0afd4f7c0c7878c84d7cf4c7de4ca
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Dec 22 17:10:19 2010 +0100
Automatic commit of package [spacewalk-schema] release [1.3.6-1].
diff --git a/rel-eng/packages/spacewalk-schema b/rel-eng/packages/spacewalk-schema
index 7887b78..565a156 100644
--- a/rel-eng/packages/spacewalk-schema
+++ b/rel-eng/packages/spacewalk-schema
@@ -1 +1 @@
-1.3.5-1 schema/spacewalk/
+1.3.6-1 schema/spacewalk/
diff --git a/schema/spacewalk/spacewalk-schema.spec b/schema/spacewalk/spacewalk-schema.spec
index c11d92f..b24a2ba 100644
--- a/schema/spacewalk/spacewalk-schema.spec
+++ b/schema/spacewalk/spacewalk-schema.spec
@@ -2,7 +2,7 @@ Name: spacewalk-schema
Group: Applications/Internet
Summary: Oracle SQL schema for Spacewalk server
-Version: 1.3.5
+Version: 1.3.6
Release: 1%{?dist}
Source0: %{name}-%{version}.tar.gz
@@ -59,6 +59,10 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/spacewalk-schema-upgrade*
%changelog
+* Wed Dec 22 2010 Jan Pazdziora 1.3.6-1
+- Fixed the rhnPackage.build_time type on PostgreSQL to
+ address rhnpush error.
+
* Tue Dec 14 2010 Jan Pazdziora 1.3.5-1
- 661109 - the schema upgrade script has to have extension .sql.
13 years, 4 months
2 commits - schema/spacewalk
by Jan Pazdziora
schema/spacewalk/common/tables/rhnPackage.sql | 86 ------------------------
schema/spacewalk/oracle/tables/rhnPackage.sql | 86 ++++++++++++++++++++++++
schema/spacewalk/postgres/tables/rhnPackage.sql | 80 ++++++++++++++++++++++
3 files changed, 166 insertions(+), 86 deletions(-)
New commits:
commit 8f3746c62e23f17298f1f36158f1b5ee069513d1
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Dec 22 16:22:43 2010 +0100
We need the build_time column without time zone.
Addressing
Error: Package with same name already exists on server but contents differ (differing build times or hosts). Use --force or remove old package before uploading the newer version.
Diff: [['build_time', '2010-06-23 23:06:12', '2010-06-23 23:06:12-04:00']]
diff --git a/schema/spacewalk/postgres/tables/rhnPackage.sql b/schema/spacewalk/postgres/tables/rhnPackage.sql
index 02506e0..6b01e06 100644
--- a/schema/spacewalk/postgres/tables/rhnPackage.sql
+++ b/schema/spacewalk/postgres/tables/rhnPackage.sql
@@ -40,7 +40,7 @@ CREATE TABLE rhnPackage
package_size NUMERIC NOT NULL,
payload_size NUMERIC,
build_host VARCHAR(256),
- build_time TIMESTAMPTZ,
+ build_time TIMESTAMP WITHOUT TIME ZONE,
source_rpm_id NUMERIC
CONSTRAINT rhn_package_srcrpmid_fk
REFERENCES rhnSourceRPM (id),
commit f11467d8f4a2bbdedde0adc505e73168e22d5ed3
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed Dec 22 16:21:57 2010 +0100
Do a separate PostgreSQL version of the rhnPackage table.
diff --git a/schema/spacewalk/common/tables/rhnPackage.sql b/schema/spacewalk/common/tables/rhnPackage.sql
deleted file mode 100644
index b0cefdd..0000000
--- a/schema/spacewalk/common/tables/rhnPackage.sql
+++ /dev/null
@@ -1,86 +0,0 @@
---
--- Copyright (c) 2008--2010 Red Hat, Inc.
---
--- This software is licensed to you under the GNU General Public License,
--- version 2 (GPLv2). There is NO WARRANTY for this software, express or
--- implied, including the implied warranties of MERCHANTABILITY or FITNESS
--- FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
--- along with this software; if not, see
--- http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
---
--- Red Hat trademarks are not licensed under GPLv2. No permission is
--- granted to use or replicate Red Hat trademarks that are incorporated
--- in this software or its documentation.
---
-
-
-CREATE TABLE rhnPackage
-(
- id NUMBER NOT NULL
- CONSTRAINT rhn_package_id_pk PRIMARY KEY
- USING INDEX TABLESPACE [[4m_tbs]],
- org_id NUMBER
- CONSTRAINT rhn_package_oid_fk
- REFERENCES web_customer (id)
- ON DELETE CASCADE,
- name_id NUMBER NOT NULL
- CONSTRAINT rhn_package_nid_fk
- REFERENCES rhnPackageName (id),
- evr_id NUMBER NOT NULL
- CONSTRAINT rhn_package_eid_fk
- REFERENCES rhnPackageEvr (id),
- package_arch_id NUMBER NOT NULL
- CONSTRAINT rhn_package_paid_fk
- REFERENCES rhnPackageArch (id),
- package_group NUMBER
- CONSTRAINT rhn_package_group_fk
- REFERENCES rhnPackageGroup (id),
- rpm_version VARCHAR2(16),
- description VARCHAR2(4000),
- summary VARCHAR2(4000),
- package_size NUMBER NOT NULL,
- payload_size NUMBER,
- build_host VARCHAR2(256),
- build_time DATE,
- source_rpm_id NUMBER
- CONSTRAINT rhn_package_srcrpmid_fk
- REFERENCES rhnSourceRPM (id),
- checksum_id NUMBER NOT NULL
- CONSTRAINT rhn_package_chsum_fk
- REFERENCES rhnChecksum (id),
- vendor VARCHAR2(64) NOT NULL,
- payload_format VARCHAR2(32),
- compat NUMBER(1)
- DEFAULT (0)
- CONSTRAINT rhn_package_compat_check
- CHECK (compat in ( 1 , 0 )),
- path VARCHAR2(1000),
- header_sig VARCHAR2(64),
- copyright VARCHAR2(128),
- cookie VARCHAR2(128),
- last_modified DATE
- DEFAULT (sysdate) NOT NULL,
- created DATE
- DEFAULT (sysdate) NOT NULL,
- modified DATE
- DEFAULT (sysdate) NOT NULL,
- header_start NUMBER
- DEFAULT (-1) NOT NULL,
- header_end NUMBER
- DEFAULT (-1) NOT NULL
-)
-ENABLE ROW MOVEMENT
-;
-
-CREATE INDEX rhn_package_oid_id_idx
- ON rhnPackage (org_id, id)
- TABLESPACE [[64k_tbs]]
- NOLOGGING;
-
-CREATE INDEX rhn_package_nid_id_idx
- ON rhnPackage (name_id, id)
- TABLESPACE [[2m_tbs]]
- NOLOGGING;
-
-CREATE SEQUENCE rhn_package_id_seq;
-
diff --git a/schema/spacewalk/oracle/tables/rhnPackage.sql b/schema/spacewalk/oracle/tables/rhnPackage.sql
new file mode 100644
index 0000000..b0cefdd
--- /dev/null
+++ b/schema/spacewalk/oracle/tables/rhnPackage.sql
@@ -0,0 +1,86 @@
+--
+-- Copyright (c) 2008--2010 Red Hat, Inc.
+--
+-- This software is licensed to you under the GNU General Public License,
+-- version 2 (GPLv2). There is NO WARRANTY for this software, express or
+-- implied, including the implied warranties of MERCHANTABILITY or FITNESS
+-- FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
+-- along with this software; if not, see
+-- http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+--
+-- Red Hat trademarks are not licensed under GPLv2. No permission is
+-- granted to use or replicate Red Hat trademarks that are incorporated
+-- in this software or its documentation.
+--
+
+
+CREATE TABLE rhnPackage
+(
+ id NUMBER NOT NULL
+ CONSTRAINT rhn_package_id_pk PRIMARY KEY
+ USING INDEX TABLESPACE [[4m_tbs]],
+ org_id NUMBER
+ CONSTRAINT rhn_package_oid_fk
+ REFERENCES web_customer (id)
+ ON DELETE CASCADE,
+ name_id NUMBER NOT NULL
+ CONSTRAINT rhn_package_nid_fk
+ REFERENCES rhnPackageName (id),
+ evr_id NUMBER NOT NULL
+ CONSTRAINT rhn_package_eid_fk
+ REFERENCES rhnPackageEvr (id),
+ package_arch_id NUMBER NOT NULL
+ CONSTRAINT rhn_package_paid_fk
+ REFERENCES rhnPackageArch (id),
+ package_group NUMBER
+ CONSTRAINT rhn_package_group_fk
+ REFERENCES rhnPackageGroup (id),
+ rpm_version VARCHAR2(16),
+ description VARCHAR2(4000),
+ summary VARCHAR2(4000),
+ package_size NUMBER NOT NULL,
+ payload_size NUMBER,
+ build_host VARCHAR2(256),
+ build_time DATE,
+ source_rpm_id NUMBER
+ CONSTRAINT rhn_package_srcrpmid_fk
+ REFERENCES rhnSourceRPM (id),
+ checksum_id NUMBER NOT NULL
+ CONSTRAINT rhn_package_chsum_fk
+ REFERENCES rhnChecksum (id),
+ vendor VARCHAR2(64) NOT NULL,
+ payload_format VARCHAR2(32),
+ compat NUMBER(1)
+ DEFAULT (0)
+ CONSTRAINT rhn_package_compat_check
+ CHECK (compat in ( 1 , 0 )),
+ path VARCHAR2(1000),
+ header_sig VARCHAR2(64),
+ copyright VARCHAR2(128),
+ cookie VARCHAR2(128),
+ last_modified DATE
+ DEFAULT (sysdate) NOT NULL,
+ created DATE
+ DEFAULT (sysdate) NOT NULL,
+ modified DATE
+ DEFAULT (sysdate) NOT NULL,
+ header_start NUMBER
+ DEFAULT (-1) NOT NULL,
+ header_end NUMBER
+ DEFAULT (-1) NOT NULL
+)
+ENABLE ROW MOVEMENT
+;
+
+CREATE INDEX rhn_package_oid_id_idx
+ ON rhnPackage (org_id, id)
+ TABLESPACE [[64k_tbs]]
+ NOLOGGING;
+
+CREATE INDEX rhn_package_nid_id_idx
+ ON rhnPackage (name_id, id)
+ TABLESPACE [[2m_tbs]]
+ NOLOGGING;
+
+CREATE SEQUENCE rhn_package_id_seq;
+
diff --git a/schema/spacewalk/postgres/tables/rhnPackage.sql b/schema/spacewalk/postgres/tables/rhnPackage.sql
new file mode 100644
index 0000000..02506e0
--- /dev/null
+++ b/schema/spacewalk/postgres/tables/rhnPackage.sql
@@ -0,0 +1,80 @@
+-- oracle equivalent source sha1 197aca2e6b8be7fa9aef2f9dfe3052e622cc4d22
+--
+-- Copyright (c) 2008--2010 Red Hat, Inc.
+--
+-- This software is licensed to you under the GNU General Public License,
+-- version 2 (GPLv2). There is NO WARRANTY for this software, express or
+-- implied, including the implied warranties of MERCHANTABILITY or FITNESS
+-- FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
+-- along with this software; if not, see
+-- http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+--
+-- Red Hat trademarks are not licensed under GPLv2. No permission is
+-- granted to use or replicate Red Hat trademarks that are incorporated
+-- in this software or its documentation.
+--
+
+CREATE TABLE rhnPackage
+(
+ id NUMERIC
+ CONSTRAINT rhn_package_id_pk PRIMARY KEY,
+ org_id NUMERIC
+ CONSTRAINT rhn_package_oid_fk
+ REFERENCES web_customer (id)
+ ON DELETE CASCADE,
+ name_id NUMERIC NOT NULL
+ CONSTRAINT rhn_package_nid_fk
+ REFERENCES rhnPackageName (id),
+ evr_id NUMERIC NOT NULL
+ CONSTRAINT rhn_package_eid_fk
+ REFERENCES rhnPackageEvr (id),
+ package_arch_id NUMERIC NOT NULL
+ CONSTRAINT rhn_package_paid_fk
+ REFERENCES rhnPackageArch (id),
+ package_group NUMERIC
+ CONSTRAINT rhn_package_group_fk
+ REFERENCES rhnPackageGroup (id),
+ rpm_version VARCHAR(16),
+ description VARCHAR(4000),
+ summary VARCHAR(4000),
+ package_size NUMERIC NOT NULL,
+ payload_size NUMERIC,
+ build_host VARCHAR(256),
+ build_time TIMESTAMPTZ,
+ source_rpm_id NUMERIC
+ CONSTRAINT rhn_package_srcrpmid_fk
+ REFERENCES rhnSourceRPM (id),
+ checksum_id NUMERIC NOT NULL
+ CONSTRAINT rhn_package_chsum_fk
+ REFERENCES rhnChecksum (id),
+ vendor VARCHAR(64) NOT NULL,
+ payload_format VARCHAR(32),
+ compat SMALLINT
+ DEFAULT (0)
+ CONSTRAINT rhn_package_compat_check
+ CHECK (compat in ( 1 , 0 )),
+ path VARCHAR(1000),
+ header_sig VARCHAR(64),
+ copyright VARCHAR(128),
+ cookie VARCHAR(128),
+ last_modified TIMESTAMPTZ
+ DEFAULT (CURRENT_TIMESTAMP) NOT NULL,
+ created TIMESTAMPTZ
+ DEFAULT (CURRENT_TIMESTAMP) NOT NULL,
+ modified TIMESTAMPTZ
+ DEFAULT (CURRENT_TIMESTAMP) NOT NULL,
+ header_start NUMERIC
+ DEFAULT (-1) NOT NULL,
+ header_end NUMERIC
+ DEFAULT (-1) NOT NULL
+)
+;
+
+CREATE INDEX rhn_package_oid_id_idx
+ ON rhnPackage (org_id, id);
+
+CREATE INDEX rhn_package_nid_id_idx
+ ON rhnPackage (name_id, id);
+
+CREATE SEQUENCE rhn_package_id_seq;
+
13 years, 4 months
Changes to 'refs/tags/rhncfg-5.9.39-1'
by Michael Mraka
Tag 'rhncfg-5.9.39-1' created by Michael Mraka <michael.mraka(a)redhat.com> at 2010-12-22 15:13 +0000
Tagging package [rhncfg] version [5.9.39-1] in directory [client/tools/rhncfg/].
Changes since spacewalk-java-1.3.32-1:
Michael Mraka (8):
664677 - fixed symlink deployment under --topdir
664677 - fixed directory deployment under --topdir
made exception block more readable
use difflib instead of external diff command
use file_utils.diff instead of external diff command
even rhncfg-manager can use file_utils.diff instead of external diff command
if file is excluded skip also deploy preparation
Automatic commit of package [rhncfg] release [5.9.39-1].
---
client/tools/rhncfg/config_client/rhncfgcli_diff.py | 24 ---
client/tools/rhncfg/config_client/rhncfgcli_get.py | 99 ++++------------
client/tools/rhncfg/config_client/rpc_cli_repository.py | 1
client/tools/rhncfg/config_common/file_utils.py | 52 ++++++--
client/tools/rhncfg/config_common/transactions.py | 2
client/tools/rhncfg/config_management/rhncfg_diff.py | 29 +---
client/tools/rhncfg/rhncfg.spec | 9 +
rel-eng/packages/rhncfg | 2
8 files changed, 90 insertions(+), 128 deletions(-)
---
13 years, 4 months
client/tools rel-eng/packages
by Michael Mraka
client/tools/rhncfg/rhncfg.spec | 9 ++++++++-
rel-eng/packages/rhncfg | 2 +-
2 files changed, 9 insertions(+), 2 deletions(-)
New commits:
commit 43fca9ca70e759d3da5b58c64b6efca87c16aa26
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Wed Dec 22 16:13:28 2010 +0100
Automatic commit of package [rhncfg] release [5.9.39-1].
diff --git a/client/tools/rhncfg/rhncfg.spec b/client/tools/rhncfg/rhncfg.spec
index 5a43fa6..0ecbd6c 100644
--- a/client/tools/rhncfg/rhncfg.spec
+++ b/client/tools/rhncfg/rhncfg.spec
@@ -8,7 +8,7 @@ Group: Applications/System
License: GPLv2 and Python
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
-Version: 5.9.38
+Version: 5.9.39
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -100,6 +100,13 @@ rm -rf $RPM_BUILD_ROOT
# $Id$
%changelog
+* Wed Dec 22 2010 Michael Mraka <michael.mraka(a)redhat.com> 5.9.39-1
+- if file is excluded skip also deploy preparation
+- use difflib instead of external diff command
+- made exception block more readable
+- 664677 - fixed directory deployment under --topdir
+- 664677 - fixed symlink deployment under --topdir
+
* Mon Dec 20 2010 Michael Mraka <michael.mraka(a)redhat.com> 5.9.38-1
- 628846 - fixed symlink info
diff --git a/rel-eng/packages/rhncfg b/rel-eng/packages/rhncfg
index 79f5e66..800276c 100644
--- a/rel-eng/packages/rhncfg
+++ b/rel-eng/packages/rhncfg
@@ -1 +1 @@
-5.9.38-1 client/tools/rhncfg/
+5.9.39-1 client/tools/rhncfg/
13 years, 4 months
7 commits - client/tools
by Michael Mraka
client/tools/rhncfg/config_client/rhncfgcli_diff.py | 24 ---
client/tools/rhncfg/config_client/rhncfgcli_get.py | 99 ++++------------
client/tools/rhncfg/config_client/rpc_cli_repository.py | 1
client/tools/rhncfg/config_common/file_utils.py | 52 ++++++--
client/tools/rhncfg/config_common/transactions.py | 2
client/tools/rhncfg/config_management/rhncfg_diff.py | 29 +---
6 files changed, 81 insertions(+), 126 deletions(-)
New commits:
commit 889764d2b3536c89b20774ca1259e5e8e3998e14
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Wed Dec 22 14:46:52 2010 +0100
if file is excluded skip also deploy preparation
diff --git a/client/tools/rhncfg/config_client/rhncfgcli_get.py b/client/tools/rhncfg/config_client/rhncfgcli_get.py
index 4fe7b7e..588b6e2 100644
--- a/client/tools/rhncfg/config_client/rhncfgcli_get.py
+++ b/client/tools/rhncfg/config_client/rhncfgcli_get.py
@@ -39,22 +39,22 @@ class Handler(handler_base.TopdirHandlerBase):
for path in self.get_valid_files():
- try:
- finfo = self.repository.get_file_info(path, auto_delete=0, dest_directory=topdir)
- except cfg_exceptions.DirectoryEntryIsFile, e:
- print "Error: unable to deploy directory %s, as it is already a file on disk" % (e[0], )
- continue
-
- if finfo is None:
- # File disappeared since we called the function
- continue
-
- (processed_path, file_info, dirs_created) = finfo
-
if excludes.has_key(path):
print "Excluding %s" % path
else:
try:
+ finfo = self.repository.get_file_info(path, auto_delete=0, dest_directory=topdir)
+ except cfg_exceptions.DirectoryEntryIsFile, e:
+ print "Error: unable to deploy directory %s, as it is already a file on disk" % (e[0], )
+ continue
+
+ if finfo is None:
+ # File disappeared since we called the function
+ continue
+
+ (processed_path, file_info, dirs_created) = finfo
+
+ try:
dep_trans.add_preprocessed(path, processed_path, file_info, dirs_created)
except cfg_exceptions.UserNotFound, e:
print "Error: unable to deploy file %s, information on user '%s' could not be found." % (path,e[0])
commit a3247233b25a902360871cf2188dababc549069e
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Wed Dec 22 16:09:51 2010 +0100
even rhncfg-manager can use file_utils.diff instead of external diff command
diff --git a/client/tools/rhncfg/config_management/rhncfg_diff.py b/client/tools/rhncfg/config_management/rhncfg_diff.py
index b1d7b42..fa0a75e 100644
--- a/client/tools/rhncfg/config_management/rhncfg_diff.py
+++ b/client/tools/rhncfg/config_management/rhncfg_diff.py
@@ -18,6 +18,7 @@ import sys
from config_common import handler_base, utils, cfg_exceptions
from config_common.rhn_log import log_debug, die
+from config_common.file_utils import diff
class Handler(handler_base.HandlerBase):
_usage_options = "[options] file [ file ... ]"
@@ -118,27 +119,13 @@ class Handler(handler_base.HandlerBase):
if src_link != os.readlink(local_file):
return "Symbolic links differ. Channel: '%s' -> '%s' System: '%s' -> '%s' \n " % (path,src_link, path, dest_link)
return ""
- # Test -u option to diff
- diffcmd = "/usr/bin/diff -u"
- pipe = os.popen("%s %s %s 2>/dev/null" % (diffcmd, temp_file, local_file))
- pipe.read() # Read the output so GNU diff is happy
- ret = pipe.close()
- if ret == None: ret = 0
- ret = ret/256 # Return code in upper byte
- if ret == 2: # error in diff call
- diffcmd = "/usr/bin/diff -c"
-
- pipe = os.popen("%s %s %s" % (diffcmd, temp_file, local_file))
- first_row = pipe.readline()
- if not first_row:
+ diff_u = diff(temp_file, local_file)
+
+ diff_len = len(diff_u)
+ if diff_len == 0:
return ""
- elif first_row.startswith("---"):
- first_row = "--- %s\tconfig_channel: %s\trevision: %s\n" % (
- path, channel, info['revision']
- )
- elif first_row.startswith("***"):
- # This happens when we drop back to "diff -c"
- first_row = "*** %s\tconfig_channel: %s\trevision: %s\n" % (
+ elif diff_u[0].startswith("---"):
+ diff_u[0] = "--- %s\tconfig_channel: %s\trevision: %s\n" % (
path, channel, info['revision']
)
- return first_row + pipe.read()
+ return ''.join(diff_u)
commit a60d23a73c1e780e9c028d2ee23805fc5bf03c1e
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Wed Dec 22 13:02:13 2010 +0100
use file_utils.diff instead of external diff command
diff --git a/client/tools/rhncfg/config_client/rhncfgcli_diff.py b/client/tools/rhncfg/config_client/rhncfgcli_diff.py
index 83b8477..0e0a9ab 100644
--- a/client/tools/rhncfg/config_client/rhncfgcli_diff.py
+++ b/client/tools/rhncfg/config_client/rhncfgcli_diff.py
@@ -17,16 +17,13 @@ import sys
import os
import handler_base
+from config_common.file_utils import diff
class Handler(handler_base.HandlerBase):
_usage_options = handler_base.HandlerBase._usage_options + " [ files ... ]"
def _process_file(self, *args):
src, dst= args [:2]
type = args[3]
- # label for diff output. this lets 'patch -R' properly apply
- # a patch to update to known version and have proper lsdiff
- # output. also gets rid of /tmp/@blah in diff output.
- label = dst
if type == 'symlink':
#dst is a symlink, so just tell the user we're skipping the entry
@@ -35,21 +32,4 @@ class Handler(handler_base.HandlerBase):
if srclink != destlink:
print "Symbolic links differ. Channel: '%s' -> '%s' System: '%s' -> '%s' " % (dst,srclink, dst, destlink)
elif type == 'file':
- # if file isn't present, compare to /dev/null so we see the
- # whole thing in the diff
- if not os.access(dst, os.R_OK):
- dst = "/dev/null"
-
- # Test -L and -u options to diff
- diffcmd = "/usr/bin/diff -L %s -u" % (label,)
- dst = '"' + dst + '"'
- pipe = os.popen("%s %s %s 2>/dev/null" % (diffcmd, src, dst))
- pipe.read() # Read the output so GNU diff is happy
- ret = pipe.close()
- if ret == None: ret = 0
- ret = ret/256 # Return code in upper byte
- if ret == 2: # error in diff call
- diffcmd = "/usr/bin/diff -c"
-
- pipe = os.popen("%s %s %s" % (diffcmd, src, dst))
- sys.stdout.write(pipe.read())
+ sys.stdout.write(''.join(diff(src, dst, srcname=dst, dstname=dst)))
commit 1750b509e075bc0556115eacde215084371f6d71
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Wed Dec 22 13:00:17 2010 +0100
use difflib instead of external diff command
diff --git a/client/tools/rhncfg/config_common/file_utils.py b/client/tools/rhncfg/config_common/file_utils.py
index 5873bd5..399ddb7 100644
--- a/client/tools/rhncfg/config_common/file_utils.py
+++ b/client/tools/rhncfg/config_common/file_utils.py
@@ -17,6 +17,7 @@ import os
import time
import tempfile
import base64
+import difflib
try:
from selinux import lgetfilecon
except:
@@ -116,8 +117,7 @@ class FileProcessor:
else:
raise e
else:
- pipe = os.popen("/usr/bin/diff -u %s %s" % (path, temp_file))
- result = pipe.read()
+ result = ''.join(diff(path, temp_file))
os.unlink(temp_file)
return sectx_result + result
@@ -129,6 +129,32 @@ class FileProcessor:
raise Exception, "Missing key %s" % k
+def diff(src, dst, srcname=None, dstname=None):
+ def f_content(path, name):
+ if os.access(path, os.R_OK):
+ f = open(path, 'U')
+ content = f.readlines()
+ f.close()
+ f_time = time.ctime(os.stat(path).st_mtime)
+ if content and content[-1] and content[-1][-1] != "\n":
+ content[-1] += "\n"
+ else:
+ content = []
+ f_time = time.ctime(0)
+ if not name:
+ name = path
+ return (content, name, f_time)
+
+ (src_content, src_name, src_time) = f_content(src, srcname)
+ (dst_content, dst_name, dst_time) = f_content(dst, dstname)
+
+ diff_u = difflib.unified_diff(src_content, dst_content,
+ src_name, dst_name,
+ src_time, dst_time)
+ return list(diff_u)
+
+
+
def maketemp(prefix=None, directory=None, symlink=None):
"""Creates a temporary file (guaranteed to be new), using the
specified prefix.
commit 4828118420bea4b17aef1d52c4a41d7f834beb1a
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Wed Dec 22 10:34:30 2010 +0100
made exception block more readable
diff --git a/client/tools/rhncfg/config_client/rhncfgcli_get.py b/client/tools/rhncfg/config_client/rhncfgcli_get.py
index cc17a96..4fe7b7e 100644
--- a/client/tools/rhncfg/config_client/rhncfgcli_get.py
+++ b/client/tools/rhncfg/config_client/rhncfgcli_get.py
@@ -67,67 +67,25 @@ class Handler(handler_base.TopdirHandlerBase):
dep_trans.deploy()
#5/3/05 wregglej - 136415 added missing user exception stuff.
except cfg_exceptions.UserNotFound, e:
- try:
- dep_trans.rollback()
- except FailedRollback:
- pass
- #5/3/05 wregglej - 136415 Added exception handling for missing user.
- except cfg_exceptions.UserNotFound, f:
- pass
- #5/5/05 wregglej - 136415 Added exception handling for unknown group
- except cfg_exceptions.GroupNotFound, f:
- pass
- print "Error: unable to deploy file %s, information on user '%s' could not be found." % (e[0], f[0])
-
+ self.try_rollback(dep_trans, "Error unable to deploy file, information on user '%s' could not be found" % e[0])
except cfg_exceptions.GroupNotFound, e:
- try:
- dep_trans.rollback()
- except FailedRollback:
- pass
- #5/3/05 wregglej - 136415 Added exception handling for missing user.
- except cfg_exceptions.UserNotFound, f:
- pass
- #5/5/05 wregglej - 136415 Added exception handling for unknown group
- except cfg_exceptions.GroupNotFound, f:
- pass
- print "Error: unable to deploy file %s, information on group '%s' could not be found." % (e[0], f[0])
-
+ self.try_rollback(dep_trans, "Error: unable to deploy file, information on group '%s' could not be found" % e[0])
except cfg_exceptions.FileEntryIsDirectory, e:
- try:
- dep_trans.rollback()
- except FailedRollback:
- pass
- #5/3/05 wregglej - 136415 Added exception handling for missing user.
- except cfg_exceptions.UserNotFound, f:
- pass
- #5/5/05 wregglej - 136415 Added exception handling for missing group
- except cfg_exceptions.GroupNotFound, f:
- pass
-
- print "Error: unable to deploy file %s, as it is already a directory on disk" % (e[0],)
+ self.try_rollback(dep_trans, "Error: unable to deploy file %s, as it is already a directory on disk" % e[0])
except cfg_exceptions.DirectoryEntryIsFile, e:
- try:
- dep_trans.rollback()
- except FailedRollback:
- pass
- #5/3/05 wregglej - 136415 Added exception handling for missin user
- except cfg_exceptions.UserNotFound, f:
- pass
- #5/5/05 wregglej - 136415 Added exception handling for unknown group
- except cfg_exceptions.GroupNotFound, f:
- pass
- print "Error: unable to deploy directory %s, as it is already a file on disk" % (e[0],)
+ self.try_rollback(dep_trans, "Error: unable to deploy directory %s, as it is already a file on disk" % e[0])
except Exception:
try:
- dep_trans.rollback()
- except FailedRollback:
+ self.try_rollback(dep_trans, "Deploy failed, rollback successful")
+ except:
print "Failed rollback"
- except cfg_exceptions.UserNotFound, f:
- print "Failed rollback due to missing user info"
- #5/5/05 wregglej - 136415 Added exception handling for unknown group
- except cfg_exceptions.GroupNotFound, f:
- pass
- raise
- else:
- print "Deploy failed, rollback successful"
raise
+
+ def try_rollback(self, dep_trans, msg):
+ try:
+ dep_trans.rollback()
+ except (FailedRollback,
+ cfg_exceptions.UserNotFound,
+ cfg_exceptions.GroupNotFound), f:
+ pass
+ print msg
commit 15fe38653e1d8287731959a5510c4ff7313c6a17
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Wed Dec 22 14:15:39 2010 +0100
664677 - fixed directory deployment under --topdir
diff --git a/client/tools/rhncfg/config_client/rhncfgcli_get.py b/client/tools/rhncfg/config_client/rhncfgcli_get.py
index d19bb5e..cc17a96 100644
--- a/client/tools/rhncfg/config_client/rhncfgcli_get.py
+++ b/client/tools/rhncfg/config_client/rhncfgcli_get.py
@@ -39,11 +39,8 @@ class Handler(handler_base.TopdirHandlerBase):
for path in self.get_valid_files():
- (directory, filename) = os.path.split(path)
- directory = os.path.normpath("%s%s%s" % (topdir, os.sep, directory))
-
try:
- finfo = self.repository.get_file_info(path, auto_delete=0, dest_directory=directory)
+ finfo = self.repository.get_file_info(path, auto_delete=0, dest_directory=topdir)
except cfg_exceptions.DirectoryEntryIsFile, e:
print "Error: unable to deploy directory %s, as it is already a file on disk" % (e[0], )
continue
diff --git a/client/tools/rhncfg/config_client/rpc_cli_repository.py b/client/tools/rhncfg/config_client/rpc_cli_repository.py
index 0d5cc0d..055663a 100644
--- a/client/tools/rhncfg/config_client/rpc_cli_repository.py
+++ b/client/tools/rhncfg/config_client/rpc_cli_repository.py
@@ -79,6 +79,7 @@ class ClientRepository(repository.RPC_Repository):
# Older servers will not return directories; if filetype is missing,
# assume file
if result.get('filetype') == 'directory':
+ result['path'] = dest_directory + result['path']
if os.path.isfile(result['path']):
raise cfg_exceptions.DirectoryEntryIsFile(result['path'])
else:
diff --git a/client/tools/rhncfg/config_common/file_utils.py b/client/tools/rhncfg/config_common/file_utils.py
index 88cdfcb..5873bd5 100644
--- a/client/tools/rhncfg/config_common/file_utils.py
+++ b/client/tools/rhncfg/config_common/file_utils.py
@@ -14,7 +14,6 @@
#
import os
-import os.path
import time
import tempfile
import base64
@@ -39,6 +38,9 @@ class FileProcessor:
def process(self, file_struct, directory=None, strict_ownership=1):
# Older servers will not return directories; if filetype is missing,
# assume file
+ if directory:
+ directory += os.path.split(file_struct['path'])[0]
+
if file_struct.get('filetype') == 'directory':
return directory, []
commit f6db743f85057d42ec06f82fb16fed72795cf423
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Dec 20 13:37:04 2010 +0100
664677 - fixed symlink deployment under --topdir
diff --git a/client/tools/rhncfg/config_common/file_utils.py b/client/tools/rhncfg/config_common/file_utils.py
index b22e855..88cdfcb 100644
--- a/client/tools/rhncfg/config_common/file_utils.py
+++ b/client/tools/rhncfg/config_common/file_utils.py
@@ -46,10 +46,9 @@ class FileProcessor:
if not file_struct.has_key('symlink'):
raise Exception, "Missing key symlink"
- (dirname, filename) = os.path.split(file_struct['path'])
- temppath = ".rhn-cfg-tmp_%s_%s_%.8f" % (filename, os.getpid(), time.time())
- os.symlink(file_struct['symlink'], temppath)
- return temppath, []
+ (fullpath, dirs_created, fh) = maketemp(prefix=".rhn-cfg-tmp",
+ directory=directory, symlink=file_struct['symlink'])
+ return fullpath, dirs_created
for k in self.file_struct_fields.keys():
if not file_struct.has_key(k):
@@ -128,7 +127,7 @@ class FileProcessor:
raise Exception, "Missing key %s" % k
-def maketemp(prefix=None, directory=None):
+def maketemp(prefix=None, directory=None, symlink=None):
"""Creates a temporary file (guaranteed to be new), using the
specified prefix.
@@ -148,4 +147,11 @@ def maketemp(prefix=None, directory=None):
file_prefix = "%s-%s-" % (prefix, os.getpid())
(fd, filename) = tempfile.mkstemp(prefix=file_prefix, dir=directory)
- return filename, dirs_created, os.fdopen(fd, "w+")
+ if symlink:
+ os.unlink(filename)
+ os.symlink(symlink, filename)
+ open_file = None
+ else:
+ open_file = os.fdopen(fd, "w+")
+
+ return filename, dirs_created, open_file
diff --git a/client/tools/rhncfg/config_common/transactions.py b/client/tools/rhncfg/config_common/transactions.py
index 9582277..2fbed4f 100644
--- a/client/tools/rhncfg/config_common/transactions.py
+++ b/client/tools/rhncfg/config_common/transactions.py
@@ -186,8 +186,6 @@ class DeployTransaction:
# assume file
if file_info.get('filetype') == 'directory':
self.dirs.append(file_info)
- elif file_info.get('filetype') == 'symlink':
- self.files.append(file_info)
else:
self._chown_chmod_chcon(processed_file_path, dest_path, file_info, strict_ownership=strict_ownership)
13 years, 4 months
Changes to 'refs/tags/spacewalk-java-1.3.32-1'
by Tomas Lestach
Tag 'spacewalk-java-1.3.32-1' created by Tomas Lestach <tlestach(a)redhat.com> at 2010-12-22 15:01 +0000
Tagging package [spacewalk-java] version [1.3.32-1] in directory [java/].
Changes since spacewalk-java-1.3.31-1:
Simon Lukasik (1):
Allow clients to retrieve metadata of debian channels
Tomas Lestach (3):
640928 - convert List<Integer> serverIds to List<Long>
removing rhnlib from server fedora13 comps
Automatic commit of package [spacewalk-java] release [1.3.32-1].
---
backend/server/rhnRepository.py | 2 +-
java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java | 7 ++++++-
java/spacewalk-java.spec | 5 ++++-
rel-eng/comps/comps-spacewalk-server-fedora13.xml | 1 -
rel-eng/packages/spacewalk-java | 2 +-
5 files changed, 12 insertions(+), 5 deletions(-)
---
13 years, 4 months
3 commits - java/code java/spacewalk-java.spec rel-eng/comps rel-eng/packages
by Tomas Lestach
java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java | 7 ++++++-
java/spacewalk-java.spec | 5 ++++-
rel-eng/comps/comps-spacewalk-server-fedora13.xml | 1 -
rel-eng/packages/spacewalk-java | 2 +-
4 files changed, 11 insertions(+), 4 deletions(-)
New commits:
commit 02171b9f3798f2c6b75cff1942c3437e0f4a2dac
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Wed Dec 22 16:01:03 2010 +0100
Automatic commit of package [spacewalk-java] release [1.3.32-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec
index 8c596ff..6741550 100644
--- a/java/spacewalk-java.spec
+++ b/java/spacewalk-java.spec
@@ -17,7 +17,7 @@ Name: spacewalk-java
Summary: Spacewalk Java site packages
Group: Applications/Internet
License: GPLv2
-Version: 1.3.31
+Version: 1.3.32
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -456,6 +456,9 @@ fi
%{jardir}/postgresql-jdbc.jar
%changelog
+* Wed Dec 22 2010 Tomas Lestach <tlestach(a)redhat.com> 1.3.32-1
+- 640928 - convert List<Integer> serverIds to List<Long> (tlestach(a)redhat.com)
+
* Tue Dec 21 2010 Jan Pazdziora 1.3.31-1
- Rewrite remove_unowned_errata and remove_nonrhn_unowned_errata not to use
rowid.
diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java
index f2b9631..c955716 100644
--- a/rel-eng/packages/spacewalk-java
+++ b/rel-eng/packages/spacewalk-java
@@ -1 +1 @@
-1.3.31-1 java/
+1.3.32-1 java/
commit 5c6d0f3172fcdca912389d1cd87496070d029014
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Wed Dec 22 15:39:45 2010 +0100
removing rhnlib from server fedora13 comps
correct version of rhnlib landed into offical f13 updates repo
diff --git a/rel-eng/comps/comps-spacewalk-server-fedora13.xml b/rel-eng/comps/comps-spacewalk-server-fedora13.xml
index 7c678a4..d9a8b9c 100644
--- a/rel-eng/comps/comps-spacewalk-server-fedora13.xml
+++ b/rel-eng/comps/comps-spacewalk-server-fedora13.xml
@@ -60,7 +60,6 @@
<packagereq type="default">quartz</packagereq>
<packagereq type="default">quartz-oracle</packagereq>
<packagereq type="default">redstone-xmlrpc</packagereq>
- <packagereq type="default">rhnlib</packagereq>
<packagereq type="default">rhnpush</packagereq>
<packagereq type="default">SatConfig-bootstrap</packagereq>
<packagereq type="default">SatConfig-bootstrap-server</packagereq>
commit fd2fbec691f6b80a15d049eff2f15ca26039ed67
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Tue Dec 21 17:27:52 2010 +0100
640928 - convert List<Integer> serverIds to List<Long>
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
index f1fb7db..7e40a89 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
@@ -4682,8 +4682,13 @@ public class SystemHandler extends BaseHandler {
if (cf == null) {
throw new InvalidEntitlementException();
}
+ // we need long values to pass
+ List<Long> longServerIds = new ArrayList();
+ for (Iterator it = serverIds.iterator(); it.hasNext();) {
+ longServerIds.add(new Long((Integer) it.next()));
+ }
return VirtualizationEntitlementsManager.getInstance().
- convertToFlex(serverIds, cf.getId(), user).size();
+ convertToFlex(longServerIds, cf.getId(), user).size();
}
/**
13 years, 4 months
backend/server
by Šimon Lukašík
backend/server/rhnRepository.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 699574c6956f5c3ecdd4b4685cacd2549ee1241a
Author: Simon Lukasik <slukasik(a)redhat.com>
Date: Wed Dec 22 01:27:44 2010 +0100
Allow clients to retrieve metadata of debian channels
diff --git a/backend/server/rhnRepository.py b/backend/server/rhnRepository.py
index 09f2cf0..e0f4b84 100644
--- a/backend/server/rhnRepository.py
+++ b/backend/server/rhnRepository.py
@@ -209,7 +209,7 @@ class Repository(rhnRepository.Repository):
if file_name in ["repomd.xml", "comps.xml"]:
content_type = "text/xml"
elif file_name not in ["primary.xml.gz", "other.xml.gz",
- "filelists.xml.gz", "updateinfo.xml.gz"]:
+ "filelists.xml.gz", "updateinfo.xml.gz", "Packages.gz"]:
log_debug(2, "Unknown repomd file requested: %s" % file_name)
raise rhnFault(6)
13 years, 4 months
Changes to 'refs/tags/spacewalk-java-1.3.31-1'
by Jan Pazdziora
Tag 'spacewalk-java-1.3.31-1' created by Jan Pazdziora <jpazdziora(a)redhat.com> at 2010-12-21 21:56 +0000
Tagging package [spacewalk-java] version [1.3.31-1] in directory [java/].
Changes since spacewalk-backend-1.3.32-1:
Jan Pazdziora (3):
No need to subselect from dual.
Rewrite remove_unowned_errata and remove_nonrhn_unowned_errata not to use rowid.
Automatic commit of package [spacewalk-java] release [1.3.31-1].
---
java/code/src/com/redhat/rhn/common/db/datasource/xml/Set_queries.xml | 30 ++++------
java/spacewalk-java.spec | 11 +++
rel-eng/packages/spacewalk-java | 2
3 files changed, 23 insertions(+), 20 deletions(-)
---
13 years, 4 months
java/spacewalk-java.spec rel-eng/packages
by Jan Pazdziora
java/spacewalk-java.spec | 11 ++++++++++-
rel-eng/packages/spacewalk-java | 2 +-
2 files changed, 11 insertions(+), 2 deletions(-)
New commits:
commit 48f7bdf5394e70e28d6a39cfa8616e7e5b861bda
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Dec 21 22:56:15 2010 +0100
Automatic commit of package [spacewalk-java] release [1.3.31-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec
index 808b0e3..8c596ff 100644
--- a/java/spacewalk-java.spec
+++ b/java/spacewalk-java.spec
@@ -17,7 +17,7 @@ Name: spacewalk-java
Summary: Spacewalk Java site packages
Group: Applications/Internet
License: GPLv2
-Version: 1.3.30
+Version: 1.3.31
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -456,6 +456,15 @@ fi
%{jardir}/postgresql-jdbc.jar
%changelog
+* Tue Dec 21 2010 Jan Pazdziora 1.3.31-1
+- Rewrite remove_unowned_errata and remove_nonrhn_unowned_errata not to use
+ rowid.
+- No need to subselect from dual.
+- 642926 - offer correct Channel and Channel Version for child channel errata
+ listings (tlestach(a)redhat.com)
+- 664717 - removing unused ks install type translations (tlestach(a)redhat.com)
+- 664717 - adding RHEL6 dist channel map translations (tlestach(a)redhat.com)
+
* Mon Dec 20 2010 Tomas Lestach <tlestach(a)redhat.com> 1.3.30-1
- 662981 - change warnings to errors, if required channels not found when
adding virt entitlement (tlestach(a)redhat.com)
diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java
index a2a5582..f2b9631 100644
--- a/rel-eng/packages/spacewalk-java
+++ b/rel-eng/packages/spacewalk-java
@@ -1 +1 @@
-1.3.30-1 java/
+1.3.31-1 java/
13 years, 4 months