Could python2 be breaking genpkgmetadata.py?
On Fri, 2010-11-12 at 13:46 +0800, Gergely Imreh wrote:
> On 12 November 2010 13:32, David C. Rankin > <drankinatty@suddenlinkmail.com> wrote: > > Guys, > > > > I'm using yum-createrepo 0.9.8-3 on from AUR and suddenly my createrepo updates > > on my Arch server are failing with the following error: > > > > 23:22 nirvana:/home/backup/rpms> sudo createrepo --update -d openSUSE_11.3/ > > File "/usr/share/createrepo/genpkgmetadata.py", line 189 > > print thing > > ^ > > SyntaxError: invalid syntax > > Not bug, change. > Print is now a function in Python 3, i.e. one has to use print(thing) > instead of the previous form. > http://docs.python.org/release/3.0.1/whatsnew/3.0.html > > Most likely either change the call in beginning of the script to > python2 instead of python, or roll up the sleeves and start converting > to the new version (python 2to3 should help > http://docs.python.org/library/2to3.html ) > > Cheers, > Greg Out of curiosity, David, I know you're on the ML quite often, how could you NOT realize all the python update emails and complaints going around? |
Could python2 be breaking genpkgmetadata.py?
On 11/12/2010 12:47 AM, Ng Oon-Ee wrote:
> Out of curiosity, David, I know you're on the ML quite often, how could > you NOT realize all the python update emails and complaints going > around? > Err.. (sheepishly) -- python to me is a snake. So while I did see the emails about the python issues, etc.. -- they didn't register any alarm bells until the snake turned around and bit me :p So what's the consensus, change all the #!/usr/bin/python to #!/usr/bin/python2 in the scripts giving errors? I know nobody wants me hacking the scripts to try and move them to python 3 (especially me...) Currently the guys on the createrepo list (rpm-metadata) haven't even ported createrepo to python 3, so I guess the fix would be to fix the executable line. But on how many packages? Just the ones that are breaking or is there some set of base packages I should backup and the do a 'perl -p -i -e s/bin/python/bin/python2/' on? I should learn more python, but there are only so many hours in the day, and I can usually do what I need in BASH, c or perl anyway :) -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com |
Could python2 be breaking genpkgmetadata.py?
On 11/12/2010 11:44 AM, David C. Rankin wrote:
> > But on how many packages? Just the ones that are breaking or is there some set > of base packages I should backup and the do a 'perl -p -i -e > s/bin/python/bin/python2/' on? > Err.. It doesn't seem to be that simple. After changed the executable line, now the scripts don't find the modules: Traceback (most recent call last): File "/usr/share/createrepo/genpkgmetadata.py", line 29, in <module> import createrepo ImportError: No module named createrepo Is there a way to teach the python2 scripts about the modules it used to know? -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com |
Could python2 be breaking genpkgmetadata.py?
the package you mentioned is orphaned and marked out-of-date. i think
you can simply adopt and update it. change the PYTHON variable in Makefile to python2 and several shebang lines in .py files may solve the breakage. of course, you need to change the dependency from python to python2. > Date: Fri, 12 Nov 2010 12:00:26 -0600 > From: "David C. Rankin" <drankinatty@suddenlinkmail.com> > Subject: Re: [arch-general] Could python2 be breaking > * * * *genpkgmetadata.py? > To: General Discussion about Arch Linux <arch-general@archlinux.org> > Message-ID: <4CDD80BA.7080004@suddenlinkmail.com> > Content-Type: text/plain; charset=ISO-8859-9 > > On 11/12/2010 11:44 AM, David C. Rankin wrote: >> >> But on how many packages? Just the ones that are breaking or is there some set >> of base packages I should backup and the do a 'perl -p -i -e >> s/bin/python/bin/python2/' on? >> > > Err.. It doesn't seem to be that simple. After changed the executable line, now > the scripts don't find the modules: > > Traceback (most recent call last): > *File "/usr/share/createrepo/genpkgmetadata.py", line 29, in <module> > * *import createrepo > ImportError: No module named createrepo > > Is there a way to teach the python2 scripts about the modules it used to know? > > > -- > David C. Rankin, J.D.,P.E. > Rankin Law Firm, PLLC > 510 Ochiltree Street > Nacogdoches, Texas 75961 > Telephone: (936) 715-9333 > Facsimile: (936) 715-9339 > www.rankinlawfirm.com > > > ------------------------------ > |
Could python2 be breaking genpkgmetadata.py?
On 11/12/2010 12:52 PM, Auguste Pop wrote:
> the package you mentioned is orphaned and marked out-of-date. i think > you can simply adopt and update it. change the PYTHON variable in > Makefile to python2 and several shebang lines in .py files may solve > the breakage. of course, you need to change the dependency from python > to python2. Thanks for your vote of confidence Auguste. I have been reluctant to adopt it, or the others like it, because when I run into make problems, I don't really have the skill set to be able to solve the issues on my own in a reasonable amount of time. Usually, I can sort through them, but there are some, especially in large multi-source, multi-language packages where I just get stuck. I don't mind doing it, if you guys don't mind me asking for help when I do. As I've said before, what I don't need is to try and help, get stuck, and then be flamed for not being able to solve all the issues on my own. Nobody needs that. I'll see if I can get it sorted over the weekend. If I can fix it, then I'll ask how to go about adopting it. There are a list of packages that are dependencies of create repo that really need to be maintained (or at least not orphaned) to make createrepo work: beecrypt rpm yum-metadata-parser python-iniparse yum yum-createrepo Then if you want 'repoview' you also need kid repoview Lastly, if you are using createrepo on a suse repository, then you must patch yum to handle suse's continued use of rpmsense_prereq: patch-yum-packages.py --- yum/packages.py.orig +++ yum/packages.py @@ -1353,11 +1353,14 @@ is a pre-requires or a not""" # FIXME this should probably be put in rpmUtils.miscutils since # - that's what it is + RPMSENSE_PREREQ = (1 << 6) + RPMSENSE_SCRIPT_PRE = (1 << 9) + RPMSENSE_SCRIPT_POST = (1 << 10) if flag is not None: # Note: RPMSENSE_PREREQ == 0 since rpm-4.4'ish - if flag & (rpm.RPMSENSE_PREREQ | - rpm.RPMSENSE_SCRIPT_PRE | - rpm.RPMSENSE_SCRIPT_POST): + if flag & (RPMSENSE_PREREQ | + RPMSENSE_SCRIPT_PRE | + RPMSENSE_SCRIPT_POST): return 1 return 0 All of the above was current through mid-Sept. 2010 with yum-createrepo 0.9.8-3 and rpm 5.1.9-1. As of the beginning of Oct., Chris (old maintainer) was going to see if somebody else could pick them up. I guess there were no takers. I'll see how far I get and let you know. Thanks. -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com |
| All times are GMT. The time now is 07:38 AM. |
VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.