-
-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PackageManager: Store packages hierarchically, by version
As explained in the changelog, this hierarchy makes much more sense than the current one, and will make it possible to read the version from the directory name.
- Loading branch information
Showing
6 changed files
with
63 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
The way packages are stored internally has changed | ||
|
||
Previous versions of dub stored packages in the following format: | ||
`$CACHE_PATH/$PACKAGE_NAME-$PACKAGE_VERSION/$PACKAGE_NAME/` | ||
Starting from this version, the format will be: | ||
`$CACHE_PATH/$PACKAGE_NAME/$PACKAGE_VERSION/$PACKAGE_NAME`. | ||
|
||
Introducing a new level will help users quickly list what packages | ||
they actually have installed, and reduce visibility of packages that | ||
might update frequently. It will render various commands (e.g. `du`) | ||
more useful, and pave the way for a package GC function. | ||
More importantly, it will allow future version of dub to infer the | ||
version from the path to the package, removing the need to read (or edit) | ||
the recipe file on every dub invocation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,32 +9,32 @@ | |
# we need to nuke every `dub` version in the user cache... | ||
$DUB remove dub -n || true | ||
|
||
$DUB fetch [email protected] && [ -d $HOME/.dub/packages/dub-1.9.0/dub ] | ||
$DUB fetch [email protected] && [ -d $HOME/.dub/packages/dub-1.10.0/dub ] | ||
$DUB fetch [email protected] && [ -d $HOME/.dub/packages/dub/1.9.0/dub ] | ||
$DUB fetch [email protected] && [ -d $HOME/.dub/packages/dub/1.10.0/dub ] | ||
|
||
echo 1 | $DUB remove dub | tr -d '\n' | grep --ignore-case 'select.*1\.9\.0.*1\.10\.0.*' | ||
if [ -d $HOME/.dub/packages/dub-1.9.0/dub ]; then | ||
if [ -d $HOME/.dub/packages/dub/1.9.0/dub ]; then | ||
die $LINENO 'Failed to remove dub-1.9.0' | ||
fi | ||
|
||
$DUB fetch [email protected] && [ -d $HOME/.dub/packages/dub-1.9.0/dub ] | ||
$DUB fetch [email protected] && [ -d $HOME/.dub/packages/dub/1.9.0/dub ] | ||
# EOF aborts remove | ||
echo -xn '' | $DUB remove dub | ||
if [ ! -d $HOME/.dub/packages/dub-1.9.0/dub ] || [ ! -d $HOME/.dub/packages/dub-1.10.0/dub ]; then | ||
if [ ! -d $HOME/.dub/packages/dub/1.9.0/dub ] || [ ! -d $HOME/.dub/packages/dub/1.10.0/dub ]; then | ||
die $LINENO 'Aborted dub still removed a package' | ||
fi | ||
|
||
# validates input | ||
echo -e 'abc\n4\n-1\n3' | $DUB remove dub | ||
if [ -d $HOME/.dub/packages/dub-1.9.0/dub ] || [ -d $HOME/.dub/packages/dub-1.10.0/dub ]; then | ||
if [ -d $HOME/.dub/packages/dub/1.9.0/dub ] || [ -d $HOME/.dub/packages/dub/1.10.0/dub ]; then | ||
die $LINENO 'Failed to remove all version of dub' | ||
fi | ||
|
||
$DUB fetch [email protected] && [ -d $HOME/.dub/packages/dub-1.9.0/dub ] | ||
$DUB fetch [email protected] && [ -d $HOME/.dub/packages/dub-1.10.0/dub ] | ||
$DUB fetch [email protected] && [ -d $HOME/.dub/packages/dub/1.9.0/dub ] | ||
$DUB fetch [email protected] && [ -d $HOME/.dub/packages/dub/1.10.0/dub ] | ||
# is non-interactive with a <version-spec> | ||
$DUB remove [email protected] | ||
$DUB remove [email protected] | ||
if [ -d $HOME/.dub/packages/dub-1.9.0/dub ] || [ -d $HOME/.dub/packages/dub-1.10.0/dub ]; then | ||
if [ -d $HOME/.dub/packages/dub/1.9.0/dub ] || [ -d $HOME/.dub/packages/dub/1.10.0/dub ]; then | ||
die $LINENO 'Failed to non-interactively remove specified versions' | ||
fi |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,10 +43,10 @@ $DUB add-local "$CURR_DIR/version-spec/oldfoo" | |
$DUB remove-local "$CURR_DIR/version-spec/newfoo" | ||
$DUB remove-local "$CURR_DIR/version-spec/oldfoo" | ||
|
||
$DUB fetch [email protected] && [ -d $HOME/.dub/packages/dub-1.9.0/dub ] | ||
$DUB fetch dub=1.10.0 && [ -d $HOME/.dub/packages/dub-1.10.0/dub ] | ||
$DUB fetch [email protected] && [ -d $HOME/.dub/packages/dub/1.9.0/dub ] | ||
$DUB fetch dub=1.10.0 && [ -d $HOME/.dub/packages/dub/1.10.0/dub ] | ||
$DUB remove [email protected] | ||
$DUB remove dub=1.10.0 | ||
if [ -d $HOME/.dub/packages/dub-1.9.0/dub ] || [ -d $HOME/.dub/packages/dub-1.10.0/dub ]; then | ||
if [ -d $HOME/.dub/packages/dub/1.9.0/dub ] || [ -d $HOME/.dub/packages/dub/1.10.0/dub ]; then | ||
die $LINENO 'Failed to remove specified versions' | ||
fi |