letters, ASCII digits, ASCII underscores, and ASCII minus-hyphens.
If the \-\-lsbsysinit option is given, then the names must not end
-in .dpkg\-old or .dpkg\-dist or .dpkg\-new or .dpkg\-tmp, and must
+in rpm backups (.rpmsave, .rpmnew, .rpmorig), and must
belong to one or more of the following namespaces: the
LANANA-assigned namespace (^[a\-z0\-9]+$); the LSB hierarchical and
reserved namespaces (^_?([a\-z0\-9_.]+\-)+[a\-z0\-9]+$);
else
retval = !regexec(&tradre, s, 0, NULL, 0);
- } else
- retval = !regexec(&classicalre, s, 0, NULL, 0);
+ } else {
+ if (!regexec(&classicalre, s, 0, NULL, 0)) {
+ retval = regexec(&excsre, s, 0, NULL, 0);
+ }
+ }
return retval;
}
REG_EXTENDED | REG_NOSUB)) != 0)
pt_regex = &hierre;
- else if ( (err = regcomp(&excsre, "^[a-z0-9-].*dpkg-(old|dist|new|tmp)$",
+ else if ( (err = regcomp(&excsre, "^[a-z0-9-].*(\.rpm(save|new|orig)|~|,v)$",
REG_EXTENDED | REG_NOSUB)) != 0)
pt_regex = &excsre;
!= 0)
pt_regex = &tradre;
- } else if ( (err = regcomp(&classicalre, "^[a-zA-Z0-9_-]+$",
+ } else if ( (err = regcomp(&classicalre, "^.+$",
+ REG_EXTENDED | REG_NOSUB)) != 0)
+ pt_regex = &classicalre;
+ else if ( (err = regcomp(&excsre, "^[.]|(\.rpm(save|new|orig)|~|,v)$",
REG_EXTENDED | REG_NOSUB)) != 0)
- pt_regex = &classicalre;
+ pt_regex = &excsre;
if (err != 0) {
fprintf(stderr, "Unable to build regexp: %s", \
regfree(&excsre);
regfree(&tradre);
- } else
+ } else {
regfree(&classicalre);
+ regfree(&excsre);
+ }
}