RTEMS | waf: Fix handling of the VERSION file in a release (!257)

Sebastian Huber (@sebhub) gitlab at rtems.org
Fri Oct 11 07:09:06 UTC 2024




Sebastian Huber started a new discussion on wscript: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/257#note_113084

 >  #define _RTEMS_VERSION_VC_KEY_H_
 >  """
 >              key = bld.env.RTEMS_VERSION_CONTROL_KEY
 > -            if key == "git":
 > -                from waflib.Build import Context
 > -                from waflib.Errors import WafError
 > -
 > -                try:
 > -                    key = bld.cmd_and_log("git rev-parse HEAD",
 > -                                          quiet=Context.STDOUT).strip()
 > -                except WafError:
 > -                    key = ""
 > +            if key != "":
 > +                if key == "git":
 > +                    from waflib.Build import Context

Replacing an

```python
if key == "git":
```

with

```python
if key != "":
    if key == "git":
```

is here the same as

```python
if key != "" and key == "git":
```

which is the same as

```python
if key == "git":
```

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/257#note_113084
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20241011/ac18cb2a/attachment-0001.htm>


More information about the bugs mailing list