Skip to content
This repository has been archived by the owner on Apr 21, 2024. It is now read-only.

Minor changes plus bump version to 0.11.0 #83

Merged
merged 3 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dylan-package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dylan-tool",
"version": "0.10.1",
"version": "0.11.0",
"category": "language-tools",
"contact": "[email protected]",
"description": "Manage Dylan workspaces, packages, and registries",
Expand Down
6 changes: 3 additions & 3 deletions sources/commands/publish.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ define method execute-subcommand
name, pm/release-version(release), ws/$dylan-package-file-name);
error(message);
end;
if (yes-or-no?(format-to-string("About to publish %s, ok? [ok/yes/no]", release)))
if (yes-or-no?(format-to-string("About to publish %s, ok? [yes/no] ", release)))
let file = pm/publish-release(cat, release);
note("Package file written to %s. Commit the changes and submit a"
" pull request.", file);
note("Package file written to %s.\n"
"Commit the changes and submit a pull request.", file);
else
note("Aborted.");
end;
Expand Down
19 changes: 9 additions & 10 deletions sources/pacman/catalog.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -349,19 +349,19 @@ define method load-catalog-package-file
cat.catalog-package-cache[name] := package
end method;

// Publish the given release by writing a new catalog file that contains the
// given release. Signals <catalog-error> if the release is not newer than any
// existing releases for the package.
// Publish a new catalog file that contains the given release. Signals
// <catalog-error> if the release is not newer than any existing releases for
// the package.
define function publish-release
(cat :: <catalog>, release :: <release>) => (file :: <file-locator>)
let name = package-name(release);
let old-package = find-package(cat, name);
let cat-package = find-package(cat, name);
let new-package = release-package(release);
if (old-package)
if (cat-package)
// Include the releases from the existing package when we write the file.
// new-package was created by loading dylan-package.json, and doesn't have
// any of the existing releases in it. (Maybe that should be fixed though.)
for (rel in package-releases(old-package))
// any of the existing releases in it.
for (rel in package-releases(cat-package))
add-release(new-package, rel);
end;
end;
Expand All @@ -371,9 +371,8 @@ define function publish-release
" latest release (%s)",
release-to-string(release), release-to-string(latest));
end;
// Note that we write new-package rather than old-package, meaning that the
// Note that we write new-package rather than cat-package, meaning that the
// package-level attributes from dylan-package.json (e.g., "description")
// will overwrite the package-level attributes from the catalog, if they're
// different.
// will replace the package-level attributes from the catalog.
write-package-file(cat, new-package)
end function;
4 changes: 3 additions & 1 deletion sources/pacman/packages.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ end function;
// releases belongs in <package>.
define class <release> (<object>)
// Back pointer to package containing this release.
constant slot release-package :: <package>,
slot release-package :: <package>,
required-init-keyword: package:;

// Note that this may be a semantic version or a branch version even though technically
Expand Down Expand Up @@ -407,6 +407,7 @@ define function add-release
if (v < version)
add!(pkg.package-releases, release);
sort!(pkg.package-releases, test: \>);
release.release-package := pkg;
done();
elseif (v = version)
if (rel ~= release)
Expand All @@ -417,6 +418,7 @@ define function add-release
end for;
add!(pkg.package-releases, release);
sort!(pkg.package-releases, test: \>);
release.release-package := pkg;
end block;
release
end function;
Expand Down
Loading