Skip to content

Commit

Permalink
Manage sources renaming (see https://wiki.archlinux.org/index.php/PKG…
Browse files Browse the repository at this point in the history
  • Loading branch information
Gianni Vialetto committed Jun 20, 2013
1 parent 554f5cd commit c8aeaa7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkgbuild-mode.el
Expand Up @@ -304,12 +304,15 @@ Otherwise, it saves all modified buffers without asking."
(if (search-forward-regexp "^\\s-*source=(\\([^()]*\\))" (point-max) t)
(let ((all-available t)
(sources (split-string (pkgbuild-shell-command-to-string "source PKGBUILD 2>/dev/null && for source in ${source[@]};do echo $source|sed 's|^.*://.*/||g';done")))
(sources-renamed (split-string (pkgbuild-shell-command-to-string "source PKGBUILD 2>/dev/null && for source in ${source[@]};do echo $source|sed 's|::.*://.*||g';done")))
(source-locations (pkgbuild-source-locations)))
(if (= (length sources) (length source-locations))
(progn
(loop for source in sources
(loop for source in sources
for source-renamed in sources-renamed
for source-location in source-locations
do (when (not (pkgbuild-find-file source (split-string pkgbuild-source-directory-locations ":")))
do (when (and (not (pkgbuild-find-file source (split-string pkgbuild-source-directory-locations ":")))
(not (pkgbuild-find-file source-renamed (split-string pkgbuild-source-directory-locations ":"))))
(progn
(setq all-available nil)
(pkgbuild-make-overlay (car source-location) (cdr source-location)))))
Expand Down

0 comments on commit c8aeaa7

Please sign in to comment.