Displaying 20 results from an estimated 55 matches for "match2".
Did you mean:
match
2009 Apr 22
2
function output with for loop and if statement
...l<-match(tmp.match,unique(names(test.veg)))
tmp[1:nrow(test.veg),tmp.col]<-test.out
tmp.out<-data.frame(row.names(test.veg),tmp,row.names=1);names(tmp.out)<-unique(names(test.veg))
tmp.out
tmp.out.sort<-tmp.out[,order(names(tmp.out))]
}
if(table(names(tmp.out))[i]==1)
tmp.match2<-names(tmp.out.sort)[names(tmp.out.sort)==i]
tmp.col2<-match(tmp.match2,names(tmp.out.sort))
tmp.out.sort[1:nrow(test.veg),tmp.col2]<-test.veg[,names(test.veg)==i]
return(tmp.out.sort)
else return(tmp.out.sort)
}
----Incorrect output when run as function-----
> tes...
2016 May 18
0
[PATCH 2/2] inspect: switch to version struct for os major/minor version
...sonable first.
@@ -220,43 +220,27 @@ parse_os_release (guestfs_h *g, struct inspect_fs *fs, const char *filename)
free (product_name);
product_name = safe_strndup (g, value, value_len);
} else if (STRPREFIX (line, "VERSION_ID=")) {
- char *major, *minor;
- if (match2 (g, value, re_major_minor, &major, &minor)) {
- major_version = guestfs_int_parse_unsigned_int (g, major);
- free (major);
- if (major_version == -1) {
- free (minor);
- return -1;
- }
- minor_version = guestfs_int_parse_unsigned_int (g,...
2015 May 22
2
[PATCH v5] inspector: recognize ppc64 and ppc64le archs (RHBZ#1211996)
Patch extracts MSB/LSB info from /bin/file output and passes it as separate
parameret from elf_arch. Then it is sent to impl_file_architecture and checked/
Modified magic_for_file to handle regex changes.
Now with tests for file_architecture, and error reporting for unknown
endianness.
Fixes: RHBZ#1211996
Maros Zatko (1):
inspector: recognize ppc64 and ppc64le archs (RHBZ#1211996)
2003 Aug 18
1
Remarking non conformant packets as AF13 from AF11
...ev eth1''
Rate1=''rate 800Kbit''
Rate2=''rate 2500Kbit''
Burst=''burst 9K''
Action=''continue''
Match1=''match ip src 192.6.0.90 match ip dst 10.37.1.63 match ip sport
6970 0xffff match ip protocol 17 0xff''
Match2=''match ip src 192.6.0.90 match ip dst 10.37.1.63 match ip dport
5005 0xffff match ip protocol 17 0xff''
Match3=''match ip src 0/0''
Meter1="police $Rate1 $Burst $Action"
Meter2="police $Rate2 $Burst $Action"
./tc qdisc add $Link handle 1:0 root...
2016 May 17
3
[PATCH 0/2] src: introduce an helper version struct
Hi,
this adds an helper version struct, and uses it in the backends (for the
libvirt and qemu versions) and inspection code. This also moves common
code to that, so it is not repeated in many places.
This should help with the small refactoring proposed with
https://www.redhat.com/archives/libguestfs/2016-May/msg00070.html
Thanks,
Pino Toscano (2):
src: start unifying version handling
2016 May 18
3
[PATCH v2 0/2] src: introduce an helper version struct
Hi,
this adds an helper version struct, and uses it in the backends (for the
libvirt and qemu versions) and inspection code. This also moves common
code to that, so it is not repeated in many places.
This should help with the small refactoring proposed with
https://www.redhat.com/archives/libguestfs/2016-May/msg00070.html
Thanks,
Pino Toscano (2):
src: start unifying version handling
2015 May 29
1
[PATCH] inspection: fix CentOS 7 detection
...lse if (guestfs_is_file_opts (g, "/etc/centos-release",
+ GUESTFS_IS_FILE_OPTS_FOLLOWSYMLINKS, 1, -1) > 0) {
+ fs->distro = OS_DISTRO_CENTOS;
+
+ if (parse_release_file (g, fs, "/etc/centos-release") == -1)
+ return -1;
+
+ if (match2 (g, fs->product_name, re_centos_old, &major, &minor) ||
+ match2 (g, fs->product_name, re_centos, &major, &minor)) {
+ fs->major_version = guestfs_int_parse_unsigned_int (g, major);
+ free (major);
+ if (fs->major_version == -1) {
+ free...
2011 Sep 15
1
Detecting duplicate messages with sieve
...sage has a Message-ID: header that's already in the cache file,
reformail terminates with the exit code set to 0. Otherwise, reformail
terminates with the exit code set to 1.
###
### my entry in mailfilter
`reformail -D 8192 $HOME/.msg.cache`
if ($RETURNCODE == 0)
{
/^From: *!.*/
FROM1=${MATCH2}
/^Subject: *!.*/
log "$FROM (${FROM1}) => Not Delivered duplicate MSG-ID. Subject
${MATCH2}\n"
exit
}
###
Is there a similar feature in sieve or can I still use the upper setup?
Another question is about to add this header line in every mail.
xfilter "${REFORMAIL...
2016 May 26
1
[PATCH] osinfo: use guestfs_int_version_from_x_y to parse the os version
...t osinfo *osinfo_db = NULL;
@@ -436,17 +434,16 @@ static int
parse_version (guestfs_h *g, xmlNodePtr node, struct osinfo *osinfo)
{
CLEANUP_FREE char *content = NULL;
- CLEANUP_FREE char *major = NULL, *minor = NULL;
content = (char *) xmlNodeGetContent (node);
if (content) {
- if (match2 (g, content, re_major_minor, &major, &minor)) {
- osinfo->major_version = guestfs_int_parse_unsigned_int (g, major);
- if (osinfo->major_version == -1)
- return -1;
- osinfo->minor_version = guestfs_int_parse_unsigned_int (g, minor);
- if (osinfo->mino...
2015 May 19
0
[PATCH v4 1/2] inspector: recognize ppc64 and ppc64le archs (RHBZ#1211996)
...UP_FREE char *endianness = NULL;
flags = g->verbose ? MAGIC_DEBUG : 0;
flags |= MAGIC_ERROR | MAGIC_RAW;
@@ -145,7 +150,7 @@ magic_for_file (guestfs_h *g, const char *filename, bool *loading_ok,
if (loading_ok)
*loading_ok = true;
- elf_arch = match1 (g, line, re_file_elf);
+ match2 (g, line, re_file_elf, &endianness, &elf_arch);
if (elf_arch == NULL) {
error (g, "no re_file_elf match in '%s'", line);
return NULL;
@@ -154,7 +159,7 @@ magic_for_file (guestfs_h *g, const char *filename, bool *loading_ok,
if (matched)
*matched = true...
2016 May 26
1
[PATCH] lib: qemu: use guestfs_int_version_from_x_y for qemu version parsing
...put of qemu -device ? */
@@ -265,29 +261,15 @@ static void
parse_qemu_version (guestfs_h *g, const char *qemu_help,
struct version *qemu_version)
{
- CLEANUP_FREE char *major_s = NULL, *minor_s = NULL;
- int major_i, minor_i;
-
version_init_null (qemu_version);
- if (!match2 (g, qemu_help, re_major_minor, &major_s, &minor_s)) {
- parse_failed:
+ if (guestfs_int_version_from_x_y (g, qemu_version, qemu_help) < 1) {
debug (g, "%s: failed to parse qemu version string from the first line of the output of '%s -help'. When reporting this bug pl...
2015 May 22
0
[PATCH v5] inspector: recognize ppc64 and ppc64le archs (RHBZ#1211996)
...UP_FREE char *endianness = NULL;
flags = g->verbose ? MAGIC_DEBUG : 0;
flags |= MAGIC_ERROR | MAGIC_RAW;
@@ -145,7 +154,7 @@ magic_for_file (guestfs_h *g, const char *filename, bool *loading_ok,
if (loading_ok)
*loading_ok = true;
- elf_arch = match1 (g, line, re_file_elf);
+ match2 (g, line, re_file_elf, &endianness, &elf_arch);
if (elf_arch == NULL) {
error (g, "no re_file_elf match in '%s'", line);
return NULL;
@@ -154,7 +163,7 @@ magic_for_file (guestfs_h *g, const char *filename, bool *loading_ok,
if (matched)
*matched = true...
2016 Mar 22
0
[PATCH v3 07/11] launch: direct: Don't run qemu -version.
...ion (guestfs_h *g, struct backend_direct_data *data)
@@ -1013,13 +999,13 @@ parse_qemu_version (guestfs_h *g, struct backend_direct_data *data)
data->qemu_version_major = 0;
data->qemu_version_minor = 0;
- if (!data->qemu_version)
+ if (!data->qemu_help)
return;
- if (!match2 (g, data->qemu_version, re_major_minor, &major_s, &minor_s)) {
+ if (!match2 (g, data->qemu_help, re_major_minor, &major_s, &minor_s)) {
parse_failed:
- debug (g, "%s: failed to parse qemu version string '%s'",
- __func__, data->qemu_versi...
2006 Jul 17
6
Nested functions
Hi there,
I'm having myself a hard time writing an algorithm for finding patterns
within a given melody. In a vector I'd like to find ALL sequences that
occur at least twice, without having to check all possible patterns via
pattern matching.
I finally found a solution in a style that I'm used from C, i.e. calling
one function from within another. GNU R doesn't seem to like that,
2015 May 19
4
[PATCH v4 0/2] inspector: recognize ppc64 and ppc64le archs (RHBZ#1211996)
Patch extracts MSB/LSB info from /bin/file output and passes it as separate
parameret from elf_arch. Then it is sent to impl_file_architecture and checked/
Modified magic_for_file to handle regex changes.
Now with tests for file_architecture.
Fixes: RHBZ#1211996
Maros Zatko (2):
inspector: recognize ppc64 and ppc64le archs (RHBZ#1211996)
tests: ppc64 and ppc64le for file_architecture
2015 Sep 08
1
[PATCH] inspect: recognize the Frugalware distribution
...tfs_is_file_opts (g, "/etc/frugalware-release",
+ GUESTFS_IS_FILE_OPTS_FOLLOWSYMLINKS, 1, -1) > 0) {
+ fs->distro = OS_DISTRO_FRUGALWARE;
+
+ if (parse_release_file (g, fs, "/etc/frugalware-release") == -1)
+ return -1;
+
+ if (match2 (g, fs->product_name, re_frugalware, &major, &minor)) {
+ fs->major_version = guestfs_int_parse_unsigned_int (g, major);
+ free (major);
+ if (fs->major_version == -1) {
+ free (minor);
+ return -1;
+ }
+ fs->minor_version = guestfs_int_par...
2011 Oct 18
4
[PATCH 1/5] launch: Store drive information in guestfs_h
This is a NFC on its own, but provides a place-holder for drive metadata which
can be used after launch.
---
src/guestfs-internal.h | 17 +++++++-
src/guestfs.c | 20 +++++++++
src/launch.c | 104 +++++++++++++++++++++++++++---------------------
src/virt.c | 4 +-
4 files changed, 96 insertions(+), 49 deletions(-)
-------------- next part --------------
A
2010 Aug 02
5
[PATCH v3 0/5] Inspection code in C
The first three patches were posted previously:
https://www.redhat.com/archives/libguestfs/2010-July/msg00082.html
The last two patches in this series change guestfish -i to use
this new code.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to
2010 Jul 29
4
[PATCH 0/3] Inspection code in C
These three patches (two were previously posted) can do simple
operating system inspection in C.
Example of use:
><fs> add-ro rhel55.img
><fs> run
><fs> inspect-os
/dev/VolGroup00/LogVol00
><fs> inspect-get-type /dev/VolGroup00/LogVol00
linux
><fs> inspect-get-distro /dev/VolGroup00/LogVol00
rhel
><fs> inspect-get-arch
2010 Aug 17
8
[PATCH v4 0/8] Inspection code in C
Previously discussed here:
https://www.redhat.com/archives/libguestfs/2010-August/msg00002.html
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/