allanjude / uclcmd

Command line tool for working with UCL config files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

case sensitivity of keys

allanjude opened this issue · comments

i tried uclcmd
thanks for it!
there's only one thing that confuses me:
uclcmd get -f /etc/pkg/FreeBSD.conf .FreeBSD.url
null
but .freebsd.url
works
is it on purpose that all keys are lower case?

Add a flag to enable case sensitivity of keys. When not enabled, lowercase all input

While using uclcmd to generate pkg-create(8) manifests from ucl fragments, case folding is a Bad Thing as there are a number of keys used in the manifest that could be filenames of Mixed Case. After uclcmd has edited the file, the keys have been lower cased.

My gut feel is that POLA would be case insensitive by default, as this is normally the case for config files, but my unix soul screams out in future pain if this would actually come to pass for uclcmd. YMMV.

{
  "name": "halbot",
  "origin": "spam/halbot",
  "version": "0.1.1",
  "comment": "Open the pod bay doors, HAL.",
  "maintainer": "spam@ideegeo.com",
  "www": "https://github.com/spam/halbot",
  "abi": "FreeBSD:11:amd64",
  "arch": "freebsd:11:x86:64",
  "prefix": "/usr/local",
  "flatsize": 17892910,
  "licenselogic": "single",
  "licenses": [
    "MIT"
  ],
  "desc": "The 9000 series is the most reliable computer ever made. No 9000 computer has\never made a mistake or distorted information. We are all, by any practical\ndefinition of the words, foolproof and incapable of error.", 
"deps": {
    "erlang": {
      "origin": "lang/erlang",
      "version": "19"
    }
  },
  "categories": [
    "local"
  ],
  "shlibs_required": [
    "libexpat.so.1",
    "libcrypto.so.38"
    ],
    "files": {
        "/usr/local/lib/halbot/bin/nodetool": "1$ea7ca9af5a1c37c1803836e44671e524fa96f35ce4b339124d3f4316a7e6e44e",
        "/usr/local/lib/halbot/lib/logger-1.3.3/ebin/Elixir.Logger.ErrorHandler.beam": "1$d4219309de90353411b1060449bce03784e0ab48ac2ea1ca35655650da7543c6",
        "/usr/local/lib/halbot/lib/logger-1.3.3/ebin/Elixir.Logger.Formatter.beam": "1$40b31d38d837cb0d1799fa58f31c0d646c0d1e84cff57832a7ba14c68630c151",
        "/usr/local/lib/halbot/lib/logger-1.3.3/ebin/Elixir.Logger.Config.beam": "1$b3755549a114d14d5be7b54ce406085ec2b001adf0ecc4f4b346f4c45bcc15e9",
        "/usr/local/lib/halbot/lib/logger-1.3.3/ebin/Elixir.Logger.App.beam": "1$ba89f61504c880827136e025c768f989958da170e48670ea3b44c89a8ece4fe8",
        "/usr/local/lib/halbot/lib/logger-1.3.3/ebin/logger.app": "1$7a2ea0b594d13b22df989e348654411294ba2b758a8908c5962a10655fe6b472"
    }
}

After querying (or mergning):

# uclcmd get --file casefold.json --json .files
{
    "/usr/local/lib/halbot/bin/nodetool": "1$ea7ca9af5a1c37c1803836e44671e524fa96f35ce4b339124d3f4316a7e6e44e",
    "/usr/local/lib/halbot/lib/logger-1.3.3/ebin/elixir.logger.errorhandler.beam": "1$d4219309de90353411b1060449bce03784e0ab48ac2ea1ca35655650da7543c6",
    "/usr/local/lib/halbot/lib/logger-1.3.3/ebin/elixir.logger.formatter.beam": "1$40b31d38d837cb0d1799fa58f31c0d646c0d1e84cff57832a7ba14c68630c151",
    "/usr/local/lib/halbot/lib/logger-1.3.3/ebin/elixir.logger.config.beam": "1$b3755549a114d14d5be7b54ce406085ec2b001adf0ecc4f4b346f4c45bcc15e9",
    "/usr/local/lib/halbot/lib/logger-1.3.3/ebin/elixir.logger.app.beam": "1$ba89f61504c880827136e025c768f989958da170e48670ea3b44c89a8ece4fe8",
    "/usr/local/lib/halbot/lib/logger-1.3.3/ebin/logger.app": "1$7a2ea0b594d13b22df989e348654411294ba2b758a8908c5962a10655fe6b472"
}

This was fixed in 2bc8997