![](https://secure.gravatar.com/avatar/591a64259d5818dd73920a9870e63458.jpg?s=120&d=mm&r=g)
Hi, I think it's possible to use separate directories without losing the ability of source sharing. One way is what I proposed in #923, which is based on a presumption that any 2 ports that sharing source files can't have source name collisions. I think It's a fair presumption. Basically, the way to do it is to use separate intermediate directories for ports with source name collisions, but use the same intermediate directories for ports that share source files. The best place to specify the name of intermediate directories is in Pkgfiles. The patch is simple(see #923), and nothing has to be changed for normal ports or scripts, only ports that have source name collisions need modification (it has to be done anyway). It's less messy by the way, as only ports that have source name collisions require intermediate directories, for other ports the location of source files is unchanged. Actually it can overcome the problem that I said in #923, that the name of some source files don't have version numbers, and pkgmk won't download newer versions while updating. The fix for this issue is simple, just have some version numbers in their intermediate directories. For example, chromium-pepperflash/Pkgfile currently is: name=chromium-pepperflash version=47.0.2526.80 release=1 source=() build() { wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb ar -x google-chrome-stable_current_amd64.deb tar -xJf data.tar.xz install -D $SRC/opt/google/chrome/PepperFlash/libpepflashplayer.so \ $PKG/usr/lib/PepperFlash/libpepflashplayer.so } After applying the patch, it would be: name=chromium-pepperflash version=47.0.2526.80 release=1 source=(https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb) srcdir=chromium-pepperflash-$version build() { ar -x google-chrome-stable_current_amd64.deb tar -xJf data.tar.xz install -D $SRC/opt/google/chrome/PepperFlash/libpepflashplayer.so \ $PKG/usr/lib/PepperFlash/libpepflashplayer.so } Assigning the same srcdir to ports that share source files. Normal ports don't have srcdir, thus no change is made.