Skip to content

distclean fails #58

@danielebaisero

Description

@danielebaisero

Distclean fails both under CLI and Python API

Ubuntu 22.10

Python API

>>> import elevation
>>> elevation.clip(bounds=(12.35, 41.8, 12.65, 42), output='/home/user/Rome-DEM.tif')
make: Entering directory '/home/user/.cache/elevation/SRTM1'
make: Nothing to be done for 'download'.
make: Leaving directory '/home/user/.cache/levation/SRTM1'
make: Entering directory '/home/user/.cache/elevation/SRTM1'
make: Nothing to be done for 'all'.
make: Leaving directory '/home/user/.cache/elevation/SRTM1'
make: Entering directory '/home/user/.cache/elevation/SRTM1'
cp SRTM1.vrt SRTM1.1013a80cf57a452aaec8ea3c149be78f.vrt
make: Leaving directory '/home/user/.cache/elevation/SRTM1'
make: Entering directory '/home/user/.cache/elevation/SRTM1'
gdal_translate -q -co TILED=YES -co COMPRESS=DEFLATE -co ZLEVEL=9 -co PREDICTOR=2 -projwin 12.35 42.0 12.65 41.8 SRTM1.1013a80cf57a452aaec8ea3c149be78f.vrt /home/user/Rome-DEM.tif
rm -f SRTM1.1013a80cf57a452aaec8ea3c149be78f.vrt
make: Leaving directory '/home/user/.cache/elevation/SRTM1'
>>> elevation.distclean()
make: Entering directory '/home/user/.cache/elevation/SRTM1'
find cache -size 0 -name "*.tif" -delete
rm -f SRTM1.*.vrt
rm -f -r spool/*
rm -f cache/* SRTM1.vrt Makefile
rm: cannot remove 'cache/N41': Is a directory
make: *** [Makefile:50: distclean] Error 1
make: Leaving directory '/home/user/.cache/elevation/SRTM1'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/.local/lib/python3.10/site-packages/elevation/datasource.py", line 247, in distclean
    util.check_call_make(datasource_root, targets=['distclean'])
  File "/home/user/.local/lib/python3.10/site-packages/elevation/util.py", line 88, in check_call_make
    subprocess.check_call(cmd, shell=True)
  File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'make -C /home/user/.cache/elevation/SRTM1 distclean ' returned non-zero exit status 2.
>>> 

CLI

user@server:~> eio clip -o Rome-30m-DEM.tif --bounds 12.35 41.8 12.65 42
make: Entering directory '/home/user/.cache/elevation/SRTM1'
make: Nothing to be done for 'download'.
make: Leaving directory '/home/user/.cache/elevation/SRTM1'
make: Entering directory '/home/user/.cache/elevation/SRTM1'
gdalbuildvrt -q -overwrite SRTM1.vrt cache/N41/N41E012.tif
make: Leaving directory '/home/user/.cache/elevation/SRTM1'
make: Entering directory '/home/user/.cache/elevation/SRTM1'
cp SRTM1.vrt SRTM1.6183fda52aa745f094cc6d239ee81355.vrt
make: Leaving directory '/home/user/.cache/elevation/SRTM1'
make: Entering directory '/home/user/.cache/elevation/SRTM1'
gdal_translate -q -co TILED=YES -co COMPRESS=DEFLATE -co ZLEVEL=9 -co PREDICTOR=2 -projwin 12.35 42.0 12.65 41.8 SRTM1.6183fda52aa745f094cc6d239ee81355.vrt /home/user/Rome-30m-DEM.tif
rm -f SRTM1.6183fda52aa745f094cc6d239ee81355.vrt
make: Leaving directory '/home/user/.cache/elevation/SRTM1'
user@server:~> eio distclean
make: Entering directory '/home/user/.cache/elevation/SRTM1'
find cache -size 0 -name "*.tif" -delete
rm -f SRTM1.*.vrt
rm -f -r spool/*
rm -f cache/* SRTM1.vrt Makefile
rm: cannot remove 'cache/N41': Is a directory
make: *** [Makefile:50: distclean] Error 1
make: Leaving directory '/home/user/.cache/elevation/SRTM1'
Traceback (most recent call last):
  File "/home/user/.local/bin/eio", line 8, in <module>
    sys.exit(eio())
  File "/usr/lib/python3/dist-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/user/.local/lib/python3.10/site-packages/elevation/cli.py", line 63, in wrapper
    return wrapped(**kwargs)
  File "/home/user/.local/lib/python3.10/site-packages/elevation/cli.py", line 119, in distclean
    elevation.distclean(**kwargs)
  File "/home/user/.local/lib/python3.10/site-packages/elevation/datasource.py", line 247, in distclean
    util.check_call_make(datasource_root, targets=['distclean'])
  File "/home/user/.local/lib/python3.10/site-packages/elevation/util.py", line 88, in check_call_make
    subprocess.check_call(cmd, shell=True)
  File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'make -C /home/user/.cache/elevation/SRTM1 distclean ' returned non-zero exit status 2.
user@server:~> 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions