Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ubuntu backend with langpack support #18

Merged
merged 5 commits into from Sep 15, 2016
Merged

Conversation

iainlane
Copy link
Collaborator

The Ubuntu backjend just inherits the Debian one and does a few extra things on top.

Improvement suggestions welcome - I'm sure I messed up the style in some places, and the approach feels like it could be cleaner somehow although I don't quite know what to do differently right now.

In particular I would have like to make the hook thing more general, but there's so much state that it's hard to know how to do that.

I'll make some other more specific comments on the diff.

scope(exit) archive_read_free (ar);

dest.chdir;
scope(exit) cwd.chdir;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

libarchive's API always extracts to the working directory. There's some thread safety problems here if things use relative paths. I only found one problem there in practice, and made it use an absolute path.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's why I never use the disk writer of libarchive - actually, the archive decompressor classes should have all you need already.
There is also on extract-by-regex function which you could probably use (would need a flag to preserve directory structures, I think)

@@ -212,7 +213,7 @@ class Config

JSONValue root = parseJSON (jsonData);

workspaceDir = dirName (fname);
workspaceDir = dirName (fname).absolutePath;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we always access things in the workspace directory as an absolute path, then (at least some of) the thread safety problems with libarchive don't happen.

@iainlane iainlane force-pushed the langpacks branch 4 times, most recently from b941b06 to 4b5a814 Compare August 30, 2016 14:05
@iainlane
Copy link
Collaborator Author

Pushed the fixes - please review!

In the next iteration, if you can help me include mo in as a submodule and get it built, I will optimise by extracting only the mo files and eliminating the use of gettext. If these are small enough I can do it in memory too. I would rather get this working implementation merged first though.

@@ -21,7 +21,7 @@
"targetType": "executable",
"buildRequirements": ["disallowDeprecations"],

"dflags-gdc": ["-Wl,--push-state,-no-as-needed", "-lcurl", "-Wl,--pop-state"],
"dflags-gdc": ["-Wl,--push-state,-no-as-needed", "-lcurl", "-Wl,--pop-state", "-L/home/laney/dev/canonical/release/appstream/build/src"],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh... ;-)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On 30 August 2016 16:41:23 BST, Matthias Klumpp notifications@github.com wrote:

@@ -21,7 +21,7 @@
"targetType": "executable",
"buildRequirements": ["disallowDeprecations"],

  • "dflags-gdc": ["-Wl,--push-state,-no-as-needed", "-lcurl",
    "-Wl,--pop-state"],
  • "dflags-gdc": ["-Wl,--push-state,-no-as-needed", "-lcurl",
    "-Wl,--pop-state",
    "-L/home/laney/dev/canonical/release/appstream/build/src"],

Eh... ;-)

heheh

@@ -13,6 +13,7 @@ RUN apt-get install -yq git gcc gdc
RUN apt-get install -yq --no-install-recommends \
cmake \
intltool \
libstemmer-dev \
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed anymore, I updated the dependencies in master (and dropped most of them).

@@ -595,7 +589,6 @@ unittest

writeln ("TEST: ", "Extracting a tarball");

import bindings.asgenstdilb : mkdtemp;
import std.file : buildPath, tempDir;

auto archive = buildPath (getcwd (), "test", "samples", "test.tar.xz");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use getTestSamplesDir() here.

@iainlane
Copy link
Collaborator Author

One more time?

Iain Lane added 5 commits September 1, 2016 12:26
The first time that we encounter a package with an
X-Ubuntu-Gettext-Domain key in its desktop file, we extract the
langpacks and generate the locales that they reference. Then we can
query these translations and stuff them into the component.
@ximion
Copy link
Owner

ximion commented Sep 12, 2016

Should I wait with merging for libmo to be ready, or would it make sense for you to have this in master now?

@iainlane
Copy link
Collaborator Author

On 12 September 2016 05:32:37 WEST, Matthias Klumpp notifications@github.com wrote:

Should I wait with merging for libmo to be ready, or would it make
sense for you to have this in master now?

It would be nice for it to be merged, since I don't know when limbo will be mergable-it needs some fixes to submodule handling in meson first.

@ximion
Copy link
Owner

ximion commented Sep 12, 2016

Okay, so I think I will merge it today or tomorrow then and fix every nitpick I find afterwards :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants