On Mon, Mar 07, 2011 at 02:28:48PM +0100, Michael Calmer wrote:
> Hello,
> 
> the attached patch set implements updateinfo to errata import in spacewalk-
> repo-sync.
> This patch also requires two small changes to yum. Patches are also attached.
> 
> This patch include also two enhancements. It adds errata_from to store the
> "from" attribute of the updateinfo into the database.
> Seconds it adds a URL attribute to bugs which make it possible to show links 
> in the web page also for 3rd party bugs linked to other bugzilla instances 
> than bugzilla.redhat.com.

Michael,

I've scratch built packages with your patches. Then I've run

        spacewalk-repo-sync -c fedora-7-i386-updates

where channel fedora-7-i386-updates has repository

        
http://archives.fedoraproject.org/pub/archive/fedora/linux/updates/7/i386/

configured to it.

After syncing the packages, I get the following traceback:

        4752/4754 : xscreensaver-gl-extras-gss-5.05-3.fc7-1.i386
        4753/4754 : jack-audio-connection-kit-devel-0.103.0-1.fc7-0.i386
        4754/4754 : python-logilab-astng-0.17.1-1.fc7-0.noarch
        Traceback (most recent call last):
          File "/usr/bin/spacewalk-repo-sync", line 69, in <module>
            sys.exit(abs(main() or 0))
          File "/usr/bin/spacewalk-repo-sync", line 63, in main
            sync.main()
          File 
"/usr/lib/python2.6/site-packages/spacewalk/satellite_tools/reposync.py", line 
111, in main
            self.import_updates(plugin, url)
          File 
"/usr/lib/python2.6/site-packages/spacewalk/satellite_tools/reposync.py", line 
143, in import_updates
            notices = plug.get_updates()
          File 
"/usr/lib/python2.6/site-packages/spacewalk/satellite_tools/repo_plugins/yum_src.py",
 line 107, in get_updates
            um.add(self.repo, all=True)
        TypeError: add() got an unexpected keyword argument 'all'

which I assume stems from the fact that I don't have the patch

        yum-3.2.20-all-updateinfos.patch

applied. My yum is

        # rpm -qf /usr/lib/python2.6/site-packages/yum/update_md.py
        yum-3.2.29-7.el6.noarch

What is the current plan of getting the patches needed to yum? Maybe
we could have a subclass of UpdateMetadata which would override the
add method?

When I remove the all=True in the call to add, I get

        Repo 
http://archives.fedoraproject.org/pub/archive/fedora/linux/updates/7/i386/ has 
2320 patches.
        No cheksum found for nfs-utils-1.1.0-4.fc7.ppc64. Skipping Patch 
FEDORA-2007-2206-1.4-channel-ia32

What exactly does this mean? I assume the issue is that I've been syncing
i386 channel and this talks about ppc64. However, that shouldn't
be a reason for skipping the whole FEDORA-2007-2206, should it? It
contains

        <package arch="i386" name="nfs-utils-debuginfo" release="4.fc7" 
src="http://download.fedoraproject.org/pub/fedora/linux/updates/7/i386/nfs-utils-debuginfo-1.1.0-4.fc7.i386.rpm";
 version="1.1.0">
          <filename>nfs-utils-debuginfo-1.1.0-4.fc7.i386.rpm</filename>
        </package>

in its pkglist/collection.

By the way, we will want the cheksum typo addressed as well.

I also can see that you are using "patch" where Red Hat and Fedora
traditionally use the term "errata". I would probably prefer to have
the terminology in the Spacewalk consistent. Can we make it erratas,
and possibly come up with some additional product branding approaches
which would make it easy to flip erratas to patches easily, without
patching the sources.

Anyway, the spacewalk-repo-sync without the all=True then continues
and fails with

        No cheksum found for apr-util-debuginfo-1.2.10-1.fc7.ppc64. Skipping 
Patch FEDORA-2007-2207-1.4-channel-ia32
        Traceback (most recent call last):
          File "/usr/bin/spacewalk-repo-sync", line 69, in <module>
            sys.exit(abs(main() or 0))
          File "/usr/bin/spacewalk-repo-sync", line 63, in main
            sync.main()
          File 
"/usr/lib/python2.6/site-packages/spacewalk/satellite_tools/reposync.py", line 
111, in main
            self.import_updates(plugin, url)
          File 
"/usr/lib/python2.6/site-packages/spacewalk/satellite_tools/reposync.py", line 
146, in import_updates
            self.upload_updates(notices)
          File 
"/usr/lib/python2.6/site-packages/spacewalk/satellite_tools/reposync.py", line 
270, in upload_updates
            bzs = filter(lambda r: r['type'] == 'bugzilla', 
notice['references'])
        TypeError: 'NoneType' object is not iterable

I can see in that

        
http://archives.fedoraproject.org/pub/archive/fedora/linux/updates/7/i386/repodata/updateinfo.xml.gz

file that the references element can be empty. Can you please address
this issue? My impulse fix would be along the lines of

        --- satellite_tools/reposync.py.orig    2011-03-09 05:36:51.000000000 
-0500
        +++ satellite_tools/reposync.py 2011-03-10 05:09:14.537381370 -0500
        @@ -269,3 +269,5 @@
                 e['bugs'] = []
        -        bzs = filter(lambda r: r['type'] == 'bugzilla', 
notice['references'])
        +        bzs = ()
        +        if notice['references']:
        +          bzs = filter(lambda r: r['type'] == 'bugzilla', 
notice['references'])
                 if len(bzs):

but you might have some better approach in the queue.

As for the patches:

> Subject: [PATCH 1/9] implement updateinfo => Errata import

[...]

>  import yum
>  import shutil
>  import sys
> +from yum import config

What is the config here needed for?

> diff --git 
> a/schema/spacewalk/upgrade/spacewalk-schema-1.3-to-spacewalk-schema-1.4/016-rhnErrata.sql
>  
> b/schema/spacewalk/upgrade/spacewalk-schema-1.3-to-spacewalk-schema-1.4/016-rhnErrata.sql
> index 6c81260..bbfda5f 100644
> --- 
> a/schema/spacewalk/upgrade/spacewalk-schema-1.3-to-spacewalk-schema-1.4/016-rhnErrata.sql
> +++ 
> b/schema/spacewalk/upgrade/spacewalk-schema-1.3-to-spacewalk-schema-1.4/016-rhnErrata.sql
> @@ -12,5 +12,6 @@
>  
>  ALTER TABLE rhnErrata MODIFY advisory_name varchar2(100);
>  ALTER TABLE rhnErrata MODIFY advisory varchar2(100);
> +ALTER TABLE rhnErrata ADD    errata_from varchar2(127);
>  \
>  show errors

These will fail on PostgreSQL. Could you please provide .oracle
and .postgresql variants of the schema upgrade scripts? Please see

        
https://www.redhat.com/archives/spacewalk-devel/2011-January/msg00061.html

for suggestions about how to do that.

FYI, the packages that I've used are at

        https://koji.spacewalkproject.org/koji/taskinfo?taskID=62852
        https://koji.spacewalkproject.org/koji/taskinfo?taskID=62851
        https://koji.spacewalkproject.org/koji/taskinfo?taskID=62849
        https://koji.spacewalkproject.org/koji/taskinfo?taskID=62846

should you review the result of my git am.      

Thank you,

-- 
Jan Pazdziora
Principal Software Engineer, Satellite Engineering, Red Hat

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to