backend/common/fileutils.py | 8 ++
client/tools/rhncfg/config_client/rhncfgcli_elist.py | 2
client/tools/rhncfg/config_common/file_utils.py | 51 +++++++++++++++++++
client/tools/rhncfg/config_management/rhncfg_diff.py | 2
client/tools/rhncfg/rhncfg.spec | 6 +-
rel-eng/packages/rhncfg | 2
6 files changed, 66 insertions(+), 5 deletions(-)
New commits:
commit d3a4d70b32f754161105e7e92427cf7ac78947c6
Author: Stephen Herr <sherr(a)redhat.com>
Date: Wed Aug 28 11:54:04 2013 -0400
Automatic commit of package [rhncfg] release [5.10.56-1].
diff --git a/client/tools/rhncfg/rhncfg.spec b/client/tools/rhncfg/rhncfg.spec
index 3e14cf6..93575c1 100644
--- a/client/tools/rhncfg/rhncfg.spec
+++ b/client/tools/rhncfg/rhncfg.spec
@@ -8,7 +8,7 @@ Group: Applications/System
License: GPLv2
URL:
https://fedorahosted.org/spacewalk
Source0:
https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
-Version: 5.10.55
+Version: 5.10.56
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -120,6 +120,9 @@ fi
# $Id$
%changelog
+* Wed Aug 28 2013 Stephen Herr <sherr(a)redhat.com> 5.10.56-1
+- 1002193 - remove spacewalk-backend-libs dependency from rhncfg
+
* Wed Jul 17 2013 Tomas Kasparek <tkasparek(a)redhat.com> 5.10.55-1
- updating copyright years
diff --git a/rel-eng/packages/rhncfg b/rel-eng/packages/rhncfg
index 3c6db31..8f79cfd 100644
--- a/rel-eng/packages/rhncfg
+++ b/rel-eng/packages/rhncfg
@@ -1 +1 @@
-5.10.55-1 client/tools/rhncfg/
+5.10.56-1 client/tools/rhncfg/
commit 1b384f6f5cbe1a6769a2696b5417471af38a150b
Author: Stephen Herr <sherr(a)redhat.com>
Date: Wed Aug 28 11:21:12 2013 -0400
1002193 - remove spacewalk-backend-libs dependency from rhncfg
diff --git a/backend/common/fileutils.py b/backend/common/fileutils.py
index 290a051..bac640a 100644
--- a/backend/common/fileutils.py
+++ b/backend/common/fileutils.py
@@ -373,6 +373,8 @@ def getUidGid(user=None, group=None):
gid = os.getgid()
return uid, gid
+# Duplicated in client/tools/rhncfg/config_common/file_utils.py to remove dependency
+# requirement. If making changes make them there too.
FILETYPE2CHAR = {
'file' : '-',
'directory' : 'd',
@@ -381,12 +383,16 @@ FILETYPE2CHAR = {
'blockdev' : 'b',
}
+# Duplicated in client/tools/rhncfg/config_common/file_utils.py to remove dependency
+# requirement. If making changes make them there too.
def _ifelse(cond, thenval, elseval):
if cond:
return thenval
else:
return elseval
+# Duplicated in client/tools/rhncfg/config_common/file_utils.py to remove dependency
+# requirement. If making changes make them there too.
def ostr_to_sym(octstr, ftype):
""" Convert filemode in octets (like '644') to string like
"ls -l" ("-rwxrw-rw-")
ftype is one of: file, directory, symlink, chardev, blockdev.
@@ -412,6 +418,8 @@ def ostr_to_sym(octstr, ftype):
_ifelse(mode & stat.S_ISVTX, 'T', '-'))
return symstr
+# Duplicated in client/tools/rhncfg/config_common/file_utils.py to remove dependency
+# requirement. If making changes make them there too.
def f_date(dbiDate):
return "%04d-%02d-%02d %02d:%02d:%02d" % (dbiDate.year, dbiDate.month,
dbiDate.day, dbiDate.hour, dbiDate.minute, dbiDate.second)
diff --git a/client/tools/rhncfg/config_client/rhncfgcli_elist.py
b/client/tools/rhncfg/config_client/rhncfgcli_elist.py
index 2592d38..637c026 100755
--- a/client/tools/rhncfg/config_client/rhncfgcli_elist.py
+++ b/client/tools/rhncfg/config_client/rhncfgcli_elist.py
@@ -1,5 +1,5 @@
from config_common.rhn_log import log_debug, die
-from spacewalk.common.fileutils import ostr_to_sym
+from config_common.file_utils import ostr_to_sym
import handler_base, base64
class Handler(handler_base.HandlerBase):
diff --git a/client/tools/rhncfg/config_common/file_utils.py
b/client/tools/rhncfg/config_common/file_utils.py
index 8f993e0..5766534 100644
--- a/client/tools/rhncfg/config_common/file_utils.py
+++ b/client/tools/rhncfg/config_common/file_utils.py
@@ -210,3 +210,54 @@ def maketemp(prefix=None, directory=None, symlink=None):
open_file = os.fdopen(fd, "w+")
return filename, dirs_created, open_file
+
+# Duplicated from backend/common/fileutils.py to remove dependency requirement.
+# If making changes make them there too.
+FILETYPE2CHAR = {
+ 'file' : '-',
+ 'directory' : 'd',
+ 'symlink' : 'l',
+ 'chardev' : 'c',
+ 'blockdev' : 'b',
+}
+
+# Duplicated from backend/common/fileutils.py to remove dependency requirement.
+# If making changes make them there too.
+def _ifelse(cond, thenval, elseval):
+ if cond:
+ return thenval
+ else:
+ return elseval
+
+# Duplicated from backend/common/fileutils.py to remove dependency requirement.
+# If making changes make them there too.
+def ostr_to_sym(octstr, ftype):
+ """ Convert filemode in octets (like '644') to string like
"ls -l" ("-rwxrw-rw-")
+ ftype is one of: file, directory, symlink, chardev, blockdev.
+ """
+ mode = int(str(octstr), 8)
+
+ symstr = FILETYPE2CHAR.get(ftype, '?')
+
+ symstr += _ifelse(mode & stat.S_IRUSR, 'r', '-')
+ symstr += _ifelse(mode & stat.S_IWUSR, 'w', '-')
+ symstr += _ifelse(mode & stat.S_IXUSR,
+ _ifelse(mode & stat.S_ISUID, 's', 'x'),
+ _ifelse(mode & stat.S_ISUID, 'S', '-'))
+ symstr += _ifelse(mode & stat.S_IRGRP, 'r', '-')
+ symstr += _ifelse(mode & stat.S_IWGRP, 'w', '-')
+ symstr += _ifelse(mode & stat.S_IXGRP,
+ _ifelse(mode & stat.S_ISGID, 's', 'x'),
+ _ifelse(mode & stat.S_ISGID, 'S', '-'))
+ symstr += _ifelse(mode & stat.S_IROTH, 'r', '-')
+ symstr += _ifelse(mode & stat.S_IWOTH, 'w', '-')
+ symstr += _ifelse(mode & stat.S_IXOTH,
+ _ifelse(mode & stat.S_ISVTX, 't', 'x'),
+ _ifelse(mode & stat.S_ISVTX, 'T', '-'))
+ return symstr
+
+# Duplicated from backend/common/fileutils.py to remove dependency requirement.
+# If making changes make them there too.
+def f_date(dbiDate):
+ return "%04d-%02d-%02d %02d:%02d:%02d" % (dbiDate.year, dbiDate.month,
+ dbiDate.day, dbiDate.hour, dbiDate.minute, dbiDate.second)
diff --git a/client/tools/rhncfg/config_management/rhncfg_diff.py
b/client/tools/rhncfg/config_management/rhncfg_diff.py
index 72a0dd1..d8a2e3a 100644
--- a/client/tools/rhncfg/config_management/rhncfg_diff.py
+++ b/client/tools/rhncfg/config_management/rhncfg_diff.py
@@ -21,7 +21,7 @@ import sys
from config_common import handler_base, utils, cfg_exceptions
from config_common.rhn_log import log_debug, die
-from spacewalk.common.fileutils import f_date, ostr_to_sym
+from config_common.file_utils import f_date, ostr_to_sym
class Handler(handler_base.HandlerBase):
diff --git a/client/tools/rhncfg/rhncfg.spec b/client/tools/rhncfg/rhncfg.spec
index 5061d55..3e14cf6 100644
--- a/client/tools/rhncfg/rhncfg.spec
+++ b/client/tools/rhncfg/rhncfg.spec
@@ -27,7 +27,6 @@ Requires: rhn-client-tools
%endif
%endif
-Requires: spacewalk-backend-libs >= 1.3.32-1
%if 0%{?suse_version}
# provide rhn directories and no selinux on suse
BuildRequires: rhn-client-tools