Use subdirectories.
authorroot <jan.kratochvil@redhat.com>
Wed, 2 Nov 2011 18:32:28 +0000 (19:32 +0100)
committerroot <jan.kratochvil@redhat.com>
Wed, 2 Nov 2011 18:32:28 +0000 (19:32 +0100)
bin/rpmmerge

index 39fb27d..c61a6b7 100755 (executable)
@@ -17,7 +17,7 @@ for base in $l;do
        # The old `-orig' format should be converted by:
        # rpm -qla|perl -lne 'chomp;s/$/-orig/;next if ! -e;$o=$_;$o=~s/-orig$//;$o=~tr{/}{-};$o="/root/rpmmerge/$o";die $o if -e $o;$_="mv -f '\''$_'\'' '\''$o'\''";system $_ and die "$_: $!";'
 
-       orig="/root/rpmmerge/$(echo $base|tr / -)"
+       orig="/root/rpmmerge/$base"
 
        if test ! -f $orig
        then
@@ -54,7 +54,7 @@ done
 if $ok
 then
        mkdir -p /root/rpmmerge
-       rpm -qac|perl -ne 'chomp;next if $_ eq "(contains no files)";next if m{^/var/lib/rpm/};next if $_ eq "/usr/lib/locale/locale-archive";next if ! -f $_;$o=$_;$o=~tr{/}{-};$o="/root/rpmmerge/$o";next if -e $o;system "cp -i -p '\''$_'\'' '\''$o'\''" and die "$_: $!";'
+       rpm -qac|perl -ne 'chomp;next if $_ eq "(contains no files)";next if m{^/var/lib/rpm/};next if $_ eq "/usr/lib/locale/locale-archive";next if ! -f $_;$o=$_;$o="/root/rpmmerge/$o";next if -e $o;$od=$o;$od=~s{[^/]*$}{};system "mkdir -p '\''$od'\''" and die "dir $_: $!";system "cp -i -p '\''$_'\'' '\''$o'\''" and die "$_: $!";'
 
        echo OK
 else