Skip to content

Commit

Permalink
trivial: Remove some deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
ximion committed Jan 12, 2020
1 parent a7e7b48 commit 969cd2c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/asgen/utils.d
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ bool isTopLevelDomain (const string value) pure
@trusted
string buildCptGlobalID (string cid, string checksum, bool allowNoChecksum = false) pure
in { assert (cid.length >= 2); }
body
do
{
if (cid is null)
return null;
Expand Down Expand Up @@ -412,7 +412,7 @@ bool isRemote (const string uri)

private immutable(Nullable!SysTime) download (const string url, ref File dest, const uint retryCount = 5) @trusted
in { assert (url.isRemote); }
body
do
{
import core.time : dur;
import std.string : toLower;
Expand Down
13 changes: 7 additions & 6 deletions src/asgen/zarchive.d
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public:

void extractArchive (const string dest)
in { assert (std.file.isDir (dest)); }
body
do
{
import std.path;
archive_entry *en;
Expand Down Expand Up @@ -525,14 +525,14 @@ public:
closed = true;
}

void addFile (string fname, string dest = null)
void addFile (const string fname, const string dest = null)
in {
if (!std.file.exists (fname)) {
logError ("File %s does not exist!", fname);
assert (0);
}
}
body
do
{
import std.conv: octal;
import std.path: baseName;
Expand All @@ -543,14 +543,15 @@ public:
stat_t st;
ubyte[BUFFER_SIZE] buff;

if (dest is null)
dest = baseName (fname);
string destName = dest;
if (destName is null)
destName = baseName (fname);

lstat (fname.toStringz, &st);
entry = archive_entry_new ();
scope (exit) archive_entry_free (entry);
archive_entry_set_pathname (entry, toStringz (dest));

archive_entry_set_pathname (entry, destName.toStringz);
archive_entry_set_size (entry, st.st_size);
archive_entry_set_filetype (entry, S_IFREG);
archive_entry_set_perm (entry, octal!755);
Expand Down

0 comments on commit 969cd2c

Please sign in to comment.