Fix failure of "kpm pack" on shared external file references

parent #704