# tries to detect the repo type and generate one SOLV file on stdout
get_DESCRDIR () {
- local d=$(grep '^DESCRDIR' content | sed 's/^DESCRDIR[[:space:]]\+\(.*\)[[:space:]]*$/\1/')
+ local d=$(grep '^DESCRDIR' content | sed 's/^DESCRDIR[[:space:]]\+\(.*[^[:space:]]\)[[:space:]]*$/\1/')
if test -z "$d"; then
echo suse/setup/desc
else
linep += strlen(linep);
if (linep == line || linep[-1] != '\n')
continue;
- *--linep = 0;
+ while ( --linep > line && ( linep[-1] == ' ' || linep[-1] == '\t' ) )
+ ; /* skip trailing ws */
+ *linep = 0;
linep = line;
/* expect "key value" lines */