Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indentation issue. #66

Open
tomkcpr opened this issue Oct 7, 2022 · 1 comment
Open

Indentation issue. #66

tomkcpr opened this issue Oct 7, 2022 · 1 comment

Comments

@tomkcpr
Copy link

tomkcpr commented Oct 7, 2022

else:

# pwd
/mnt/storage/files/target-fb/configshell-fb-rpm
# diff ./build/configshell-fb-1.1.29.7.g50d5ffe/setup.py setup.py
28a29
>         print "Version from init: %s " % (match)
32,33c33,34
<     else:
<         raise Exception("Couldn't find version in setup.py")
---
>         else:
>             raise Exception("Couldn't find version in setup.py")

When making RPM using Makefiles from targetcli-pkgscripts/

# make rpm
.
.
.
.
+ cd configshell-fb-1.1.29.7.g50d5ffe
+ LANG=C
+ export LANG
+ unset DISPLAY
+ /usr/bin/python setup.py build
Traceback (most recent call last):
  File "setup.py", line 33, in <module>
    raise Exception("Couldn't find version in setup.py")
Exception: Couldn't find version in setup.py
error: Bad exit status from /var/tmp/rpm-tmp.imTp3e (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.imTp3e (%build)
make: *** [build/rpm-stamp] Error 1
#
@tomkcpr
Copy link
Author

tomkcpr commented Oct 8, 2022

Corrected above. The else is fine. Needed to update the expression match on this dated CentOS 6 Python 2.6.x install. Line 28 below:

     23 # Get version without importing.
     24 init_file_path = os.path.join(os.path.dirname(__file__), 'configshell/__init__.py')
     25
     26 with open(init_file_path) as f:
     27     for line in f:
     28         match = re.match(r"__version__.*'([0-9]+\.[0-9]+\.[0-9]+.*\.gba.*)'", line)
     29         if match:
     30             print "Version from init: %s " % (match)
     31         if match:
     32             version = match.group(1)
     33             break
     34     else:
     35         raise Exception("Couldn't find version in setup.py")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant