<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -200,17 +200,29 @@ proc portclean::clean_work {args} {
 
 proc portclean::clean_archive {args} {
     global workpath portarchivepath name version ports_version_glob
-    global configure.build_arch
+    global configure.build_arch configure.universal_archs
 
-    # Define archive destination directory and target filename
+    # Define archive destination directory, target filename, regex for archive name,
+    # and universal arch string
     if {$portarchivepath ne $workpath &amp;&amp; $portarchivepath ne &quot;&quot;} {
-        set archivepath [file join $portarchivepath [option os.platform] ${configure.build_arch}]
+        if {[variant_exists universal] &amp;&amp; [variant_isset universal]} {
+            set archstring [join [lsort -ascii ${configure.universal_archs}] -]
+            set archivepath [file join $portarchivepath [option os.platform] &quot;universal&quot;]
+            set regexstring &quot;^$name-\[-_a-zA-Z0-9\.\]+_\[0-9\]*\[+-_a-zA-Z0-9\]*\[\.\]${archstring}\[\.\]\[a-z2\]+\$&quot;
+        } else {
+            set archivepath [file join $portarchivepath [option os.platform] ${configure.build_arch}]
+            set regexstring &quot;^$name-\[-_a-zA-Z0-9\.\]+_\[0-9\]*\[+-_a-zA-Z0-9\]*\[\.\]${configure.build_arch}\[\.\]\[a-z2\]+\$&quot;
+        }
     }
 
     if {[info exists ports_version_glob]} {
         # Match all possible archive variants that match the version
         # glob specified by the user for this OS.
-        set fileglob &quot;$name-[option ports_version_glob]*.${configure.build_arch}.*&quot;
+        if {[variant_exists universal] &amp;&amp; [variant_isset universal]} {
+            set fileglob &quot;$name-[option ports_version_glob]*+universal.${archstring}.*&quot;
+        } else {
+            set fileglob &quot;$name-[option ports_version_glob]*.${configure.build_arch}.*&quot;
+        }
     } else {
         # Match all possible archive variants for the current version on
         # this OS. If you want to delete previous versions, use the
@@ -219,7 +231,11 @@ proc portclean::clean_archive {args} {
         # We do this because if we don't, then ports that match the
         # first part of the name (e.g. trying to remove foo-* will
         # pick up anything foo-bar-* as well, which is undesirable).
-        set fileglob &quot;$name-$version*.${configure.build_arch}.*&quot;
+        if {[variant_exists universal] &amp;&amp; [variant_isset universal]} {
+            set fileglob &quot;$name-$version*+universal.${archstring}.*&quot;
+        } else {
+            set fileglob &quot;$name-$version*.${configure.build_arch}.*&quot;
+        }
     }
 
     # Remove the archive files
@@ -229,7 +245,7 @@ proc portclean::clean_archive {args} {
             set file [file tail $path]
             # Make sure file is truly a port archive file, and not
             # an accidental match with some other file that might exist.
-            if {[regexp &quot;^$name-\[-_a-zA-Z0-9\.\]+_\[0-9\]*\[+-_a-zA-Z0-9\]*\[\.\]${configure.build_arch}\[\.\]\[a-z2\]+\$&quot; $file]} {
+            if {[regexp $regexstring $file]} {
                 if {[file isfile $path]} {
                     ui_debug &quot;Removing archive: $path&quot;
                     if {[catch {delete $path} result]} {</diff>
      <filename>base/src/port1.0/portclean.tcl</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6b3752fbda638ddb5b2f442f0c8203d628b84b65</id>
    </parent>
  </parents>
  <author>
    <name>Jeremy Lavergne</name>
    <email>snc@macports.org</email>
  </author>
  <url>http://github.com/kballard/macports/commit/857a437dcaae2e333f25f9a01bf62612e5fe901c</url>
  <id>857a437dcaae2e333f25f9a01bf62612e5fe901c</id>
  <committed-date>2009-11-08T11:27:47-08:00</committed-date>
  <authored-date>2009-11-08T11:27:47-08:00</authored-date>
  <message>have clean handle universal binaries, which are placed in their own directory and do not use build_arch in their name


git-svn-id: http://svn.macports.org/repository/macports/trunk@60296 d073be05-634f-4543-b044-5fe20cf6d1d6</message>
  <tree>fff53058ca641a9e348987898c8ff7fc56d4165e</tree>
  <committer>
    <name>Jeremy Lavergne</name>
    <email>snc@macports.org</email>
  </committer>
</commit>
