Skip to content

Commit

Permalink
Revert "Fix #2691: Use same structure for managed and unmanaged path"
Browse files Browse the repository at this point in the history
This reverts commit 1a53049.
  • Loading branch information
s-ludwig committed Feb 16, 2024
1 parent 85a78c0 commit 6d8c584
Show file tree
Hide file tree
Showing 33 changed files with 26 additions and 11 deletions.
2 changes: 1 addition & 1 deletion source/dub/packagemanager.d
Original file line number Diff line number Diff line change
Expand Up @@ -1453,7 +1453,7 @@ package struct Location {

// Managed structure: $ROOT/$NAME/$VERSION/$NAME
// This is the most common code path
else {
else if (mgr.isManagedPath(path)) {
// Iterate over versions of a package
foreach (versdir; mgr.iterateDirectory(pack_path)) {
if (!versdir.isDirectory) continue;
Expand Down
8 changes: 4 additions & 4 deletions test/issue1024-selective-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

. $(dirname "${BASH_SOURCE[0]}")/common.sh
cd ${CURR_DIR}/issue1024-selective-upgrade
echo "{\"fileVersion\": 1,\"versions\": {\"a\": \"1.0.0\", \"b\": \"1.0.0\"}}" > main/~master/main/dub.selections.json
$DUB upgrade --bare --root=main/~master/main/ a
echo "{\"fileVersion\": 1,\"versions\": {\"a\": \"1.0.0\", \"b\": \"1.0.0\"}}" > main/dub.selections.json
$DUB upgrade --bare --root=main a

if ! grep -c -e "\"a\": \"1.0.1\"" main/~master/main/dub.selections.json; then
if ! grep -c -e "\"a\": \"1.0.1\"" main/dub.selections.json; then
die $LINENO "Specified dependency was not upgraded."
fi

if grep -c -e "\"b\": \"1.0.1\"" main/~master/main/dub.selections.json; then
if grep -c -e "\"b\": \"1.0.1\"" main/dub.selections.json; then
die $LINENO "Non-specified dependency got upgraded."
fi
5 changes: 4 additions & 1 deletion test/issue564-invalid-upgrade-dependency.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@

. $(dirname "${BASH_SOURCE[0]}")/common.sh
cd ${CURR_DIR}/issue564-invalid-upgrade-dependency
${DUB} build -f --bare --compiler=${DC} main
rm -rf a-1.0.0/.dub
rm -rf a-1.1.0/.dub
rm -rf main/.dub
${DUB} build --bare --compiler=${DC} main
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"fileVersion": 1,
"versions": {
"a": "1.0.0"
}
}
7 changes: 5 additions & 2 deletions test/issue813-pure-sub-dependency.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@

. $(dirname "${BASH_SOURCE[0]}")/common.sh
cd ${CURR_DIR}/issue813-pure-sub-dependency
rm -f main/~master/main/dub.selections.json
${DUB} build -f --bare --compiler=${DC} main
rm -rf main/.dub
rm -rf sub/.dub
rm -rf sub/sub/.dub
rm -f main/dub.selections.json
${DUB} build --bare --compiler=${DC} main
9 changes: 6 additions & 3 deletions test/issue923-subpackage-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

. $(dirname "${BASH_SOURCE[0]}")/common.sh
cd ${CURR_DIR}/issue923-subpackage-deps
rm -f main/~master/main/dub.selections.json
${DUB} build -f --bare --compiler=${DC} main
rm -rf main/.dub
rm -rf a/.dub
rm -rf b/.dub
rm -f main/dub.selections.json
${DUB} build --bare --compiler=${DC} main


if ! grep -c -e \"b\" main/~master/main/dub.selections.json; then
if ! grep -c -e \"b\" main/dub.selections.json; then
die $LINENO 'Dependency b not resolved.'
fi
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 6d8c584

Please sign in to comment.