]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
Merge branch 'lsfd-refine-columns' of https://github.com/masatake/util-linux
authorKarel Zak <kzak@redhat.com>
Tue, 13 Sep 2022 06:57:49 +0000 (08:57 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 13 Sep 2022 06:57:49 +0000 (08:57 +0200)
* 'lsfd-refine-columns' of https://github.com/masatake/util-linux:
  lsfd: cosmetic change
  lsfd: (man) write about PIDFD.* columns
  lsfd: show pid, comm, and nspid of pidfd in PIDFD.{PID,COMM,NSPID} columns
  lsfd: (filter): accept '.' used in column names
  tests: (lsfd) fix the potential problems reported by github-code-scan
  tests: (lsfd) put double quote characters around variable expansions
  lsfd: use NAME column to show cooked file names
  lsfd: use TYPE column to show cooked file types
  lsfd: show classes of anonyomous inodes in AINODECLASS column
  lsfd: cosmetic changes
  tests: (mkfds) add a factory for making an inotify fd
  tests: (mkfds) cosmetic change, deleting an empty line

lib/timeutils.c
meson.build
meson_options.txt
tests/functions.sh
tests/ts/look/separator
tests/ts/mount/remount

index 6dda2e8deefbea3d0c2bf956a9c5dc6f2ae17879..4eaef9533ab2696c766f0477d7be3362d3ba0f66 100644 (file)
@@ -181,7 +181,7 @@ int parse_timestamp(const char *t, usec_t *usec)
         *
         *   2012-09-22 16:34:22
         *   2012-09-22T16:34:22
-        *   1348331662           (seconds since the Epoch (1970-01-01 00:00 UTC))
+        *   @1348331662          (seconds since the Epoch (1970-01-01 00:00 UTC))
         *   2012-09-22 16:34     (seconds will be set to 0)
         *   2012-09-22           (time will be set to 00:00:00)
         *   16:34:22             (date will be set to today)
@@ -233,7 +233,12 @@ int parse_timestamp(const char *t, usec_t *usec)
                        return r;
 
                goto finish;
+       } else if (t[0] == '@') {
+               k = strptime(t + 1, "%s", &tm);
+               if (k && *k == 0)
+                       goto finish;
 
+               return -EINVAL;
        } else if (endswith(t, " ago")) {
                char *z;
 
@@ -326,13 +331,6 @@ int parse_timestamp(const char *t, usec_t *usec)
                goto finish;
        }
 
-       tm = copy;
-       k = strptime(t, "%s", &tm);
-       if (k && *k == 0) {
-               tm.tm_sec = 0;
-               goto finish;
-       }
-
        return -EINVAL;
 
  finish:
index 57bf8961e3451893de3abb5fbb8b55efe9d876bf..2447b631dad1e281f80ed06284e461f51dd2f43d 100644 (file)
@@ -36,9 +36,10 @@ add_project_arguments('-D_GNU_SOURCE', language : 'c')
 cc = meson.get_compiler('c')
 
 conf = configuration_data()
+conf.set_quoted('PACKAGE', meson.project_name())
+conf.set_quoted('PACKAGE_VERSION', meson.project_version())
 package_string = '@0@ @1@'.format(meson.project_name(), meson.project_version())
 conf.set_quoted('PACKAGE_STRING', package_string)
-conf.set_quoted('PACKAGE_VERSION', meson.project_version())
 
 codes = [''' {print $1}  ''',
          ''' {sub("-.*","",$2); print $2} ''',
@@ -271,6 +272,18 @@ lib_readline_static = dependency(
   static : true,
   required : need_static_libs ? get_option('readline') : disabler())
 
+if meson.version().version_compare('>= 0.59.0')
+  lib_intl = dependency(
+    'intl',
+    required : get_option('nls'))
+  conf.set('ENABLE_NLS', lib_intl.found() ? 1 : false)
+else
+  if get_option('nls').enabled()
+    error('nls is not supported with meson before 0.59.0')
+  endif
+  lib_intl = dependency('', required : false)
+endif
+
 lib_user = dependency(
   'libuser',
   version : '>= 0.58',
@@ -326,9 +339,11 @@ lib_cryptsetup = dependency(
 conf.set('HAVE_CRYPTSETUP', lib_cryptsetup.found() ? 1 : false)
 
 if not get_option('cryptsetup').disabled() and get_option('cryptsetup-dlopen').enabled()
-  lib_dl = cc.find_library(
-    'libdl',
-    required : true)
+  if meson.version().version_compare('>= 0.62.0')
+    lib_dl = dependency('dl')
+  else
+    lib_dl = cc.find_library('dl')
+  endif
   conf.set('CRYPTSETUP_VIA_DLOPEN', 1)
   summary('cryptsetup support (dlopen)',
           'enabled',
index 5272cb317c97d6f8a54ccaaaf772c306a411ffda..07abf315bf83579f8c02a3e5a9f760c43bf0e355 100644 (file)
@@ -9,6 +9,7 @@ option('cryptsetup',  type : 'feature')
 option('cryptsetup-dlopen',  type : 'feature')
 option('zlib',        type : 'feature')
 option('readline',    type : 'feature')
+option('nls',         type : 'feature')
 option('libutil',     type : 'feature')
 option('libutempter', type : 'feature')
 option('libpcre2-posix',     type : 'feature')
index e24d5c87984d94787d605fe403613f3f9ccd485b..216b66e64a151cd2c0345edeb2f8000e7ac44b0c 100644 (file)
@@ -742,7 +742,7 @@ function ts_device_has {
 
 function ts_is_uuid()
 {
-       printf "%s\n" "$1" | egrep -q '^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$'
+       printf "%s\n" "$1" | grep -E -q '^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$'
        return $?
 }
 
index c6028e3147943764d82d57c63c590164feed2e3a..2a5ecf3074562261508edab6c51de0697f9b1dea 100755 (executable)
@@ -22,8 +22,8 @@
 #
 # for example:
 #
-#      cat words.raw | egrep --invert-match "'s$" | \
-#              egrep  "^[[:alnum:]'&!,./-]+$" | \
+#      cat words.raw | grep -E --invert-match "'s$" | \
+#              grep -E "^[[:alnum:]'&!,./-]+$" | \
 #              sort --ignore-case --dictionary-order | \
 #              uniq >  words
 #
index 468d5d30b2a828c40c609b5740a8f5ee6c45bde6..827436cb88504c7eb7aedd1dcdef5f75c81589d5 100755 (executable)
@@ -42,7 +42,7 @@ mkfs.ext2 $DEVICE &> /dev/null || ts_die "Cannot make ext2 on $DEVICE"
 $TS_CMD_MOUNT $DEVICE $TS_MOUNTPOINT || ts_die "Cannot mount $TS_MOUNTPOINT"
 
 # check the mount
-egrep -q "^$DEVICE $TS_MOUNTPOINT" $MTAB_FILE \
+grep -E -q "^$DEVICE $TS_MOUNTPOINT" $MTAB_FILE \
  || ts_die "Cannot find $TS_MOUNTPOINT in $MTAB_FILE"
 
 # remount