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

pkg-clean: cache dir as a symlink #1424

Closed
fichtner opened this issue May 6, 2016 · 12 comments
Closed

pkg-clean: cache dir as a symlink #1424

fichtner opened this issue May 6, 2016 · 12 comments

Comments

@fichtner
Copy link
Contributor

fichtner commented May 6, 2016

Hi all,

I'm trying to side-step a scenario where cache dir is set via the config so /var/cache/pkg is a symlink instead. pkg-clean seems to be unable to cope even though the underlying directory has several packages cached. Is this intended?

# pkg -v
1.7.2
# pkg clean
Nothing to do.
# pkg clean -a
The following package files will be deleted:
    /var/cache/pkg
The cleanup will free 19 B

Proceed with cleaning the cache? [y/N]:
@fichtner
Copy link
Contributor Author

fichtner commented May 6, 2016

I should add that the cache works properly when used via e.g. pkg-install.

fichtner added a commit to opnsense/core that referenced this issue May 6, 2016
@bapt
Copy link
Member

bapt commented May 6, 2016

I do not see the point of using symlinks for /var/cache/pkg given it is overwritable by config, but anyway this is still a bug :)

@fichtner
Copy link
Contributor Author

fichtner commented May 6, 2016

Backwards-compatibility reasons... ok, I will send a patch for review till next week. :)

@bapt bapt closed this as completed in 9677df1 May 6, 2016
@bapt
Copy link
Member

bapt commented May 6, 2016

can you try 1.7.99.6?

@fichtner
Copy link
Contributor Author

fichtner commented May 6, 2016

It works, although it gives a segfault at the end. FreeBSD 10.2 build from the git repo, not the ports tree:

# ./pkg -v
1.7.99.6-d559da8
# ./pkg clean
Nothing to do.
# ./pkg clean -a
The following package files will be deleted:
    /var/cache/pkg/opnsense-lang-16.1.13-056b08377e.txz
    /var/cache/pkg/opnsense-lang-16.1.13.txz
The cleanup will free 0 B

Proceed with cleaning the cache? [y/N]: y
Deleting files: 100%
All done
Child process pid=41086 terminated abnormally: Segmentation fault

How can I produce more information? This is reproducible.

It shows 0 byte, that seems off but not important. Just for reference:

# ls -lah /var/cache/pkg/
total 488
drwxr-xr-x  2 root  wheel   512B May  6 18:45 .
drwxr-xr-x  4 root  wheel   512B May  6 18:39 ..
-rw-r--r--  1 root  wheel   417K May  4 10:08 opnsense-lang-16.1.13-056b08377e.txz
lrwxr-xr-x  1 root  wheel    36B May  6 18:45 opnsense-lang-16.1.13.txz -> opnsense-lang-16.1.13-056b08377e.txz
# du -hd1 /var/cache/pkg
4.0K    /var/cache/pkg
# du -hd1 /var/cache/pkg/
484K    /var/cache/pkg/

@andrejzverev andrejzverev reopened this May 6, 2016
@andrejzverev
Copy link
Contributor

moreover, percents are crazy here.

# ./src/pkg fetch pkg rmilter
The following packages will be fetched:

New packages to be FETCHED:
        pkg-1.7.2 (90.40% of 3 MiB: 2 MiB)
        rmilter-1.8.4_23 (9.60% of 3 MiB: 263 KiB)

@fichtner
Copy link
Contributor Author

fichtner commented May 6, 2016

This seems to be intended? 90.4 + 9.6 is 100, one package yields this:

# ./pkg fetch opnsense-devel
Updating OPNsense repository catalogue...
OPNsense repository is up-to-date.
All repositories are up-to-date.
The following packages will be fetched:

New packages to be FETCHED:
    opnsense-devel-16.7.b_78 (100.00% of 9 MiB: 9 MiB)

The process will require 9 MiB more space.
9 MiB to be downloaded.

Proceed with fetching packages? [y/N]:

@bapt
Copy link
Member

bapt commented May 6, 2016

clean segfault and size 0 has been fixed (related to capsicumizing, sorry

@bapt
Copy link
Member

bapt commented May 6, 2016

For the fetch, this behaviour is new to me, but yes, it seems ok explaining how bytes will have to be fetched (I find the output mis leading but hey :))

@bapt
Copy link
Member

bapt commented May 6, 2016

does something like

New packages to be FETCHED:
      rmilter-1.8.4 (131 KiB: 0.70% of the 18 MiB to download)
      opendkim-2.10.3_5 (308 KiB: 1.64% of the 18 MiB to download)
      unbound-1.5.8 (2 MiB: 8.61% of the 18 MiB to download)
      expat-2.1.0_3 (99 KiB: 0.53% of the 18 MiB to download)
      ldns-1.6.17_5 (384 KiB: 2.04% of the 18 MiB to download)
      lua52-5.2.4 (165 KiB: 0.88% of the 18 MiB to download)
      libedit-3.1.20150325_2 (123 KiB: 0.65% of the 18 MiB to download)
      perl5-5.20.3_12 (13 MiB: 71.47% of the 18 MiB to download)
      pcre-8.38_1 (1 MiB: 5.88% of the 18 MiB to download)
      libmemcached-1.0.18_2 (697 KiB: 3.71% of the 18 MiB to download)
      libevent2-2.0.22_1 (261 KiB: 1.39% of the 18 MiB to download)
      cyrus-sasl-2.1.26_12 (471 KiB: 2.50% of the 18 MiB to download)

The process will require 18 MiB more space.
18 MiB to be downloaded.

look more understandable

@fichtner
Copy link
Contributor Author

fichtner commented May 6, 2016

@bapt actual size in the first part of the annotation looks sane. and thanks for fixing, will retest till monday

@bapt bapt closed this as completed May 6, 2016
@fichtner
Copy link
Contributor Author

fichtner commented May 7, 2016

all good now on 1.7.99.8-0fb053c, thank you very much :)

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

3 participants