[arch-dev-public] [PATCH] Do not refer to $startdir/{src, pkg} in PKGBUILDs
PKGBUILDs should always use $srcdir and $pkgdir and their locations are not guaranteed to be $startdir/src and $startdir/pkg respecitively. Signed-off-by: Allan McRae <allan@archlinux.org> --- Namcap/invalidstartdir.py | 6 +++--- namcap-tags | 6 +++--- namcap.1 | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Namcap/invalidstartdir.py b/Namcap/invalidstartdir.py index 69a6969..052b380 100644 --- a/Namcap/invalidstartdir.py +++ b/Namcap/invalidstartdir.py @@ -23,7 +23,7 @@ class package: def short_name(self): return "invalidstartdir" def long_name(self): - return "Looks for anything that's not $startdir/pkg or $startdir/src" + return "Looks for references to $startdir" def prereq(self): return "" def analyze(self, pkginfo, tar): @@ -34,9 +34,9 @@ class package: if j[:4] != '/pkg' and j[:4] != '/src': ret[0].append(("file-referred-in-startdir", ())) elif j[:4] == '/pkg': - ret[2].append(("recommend-use-pkgdir", ())) + ret[0].append(("use-pkgdir", ())) elif j[:4] == '/src': - ret[2].append(("recommend-use-srcdir", ())) + ret[0].append(("use-srcdir", ())) return ret def type(self): return "pkgbuild" diff --git a/namcap-tags b/namcap-tags index c144f06..c4b1b3d 100644 --- a/namcap-tags +++ b/namcap-tags @@ -25,7 +25,7 @@ empty-directory %s :: Directory (%s) is empty extra-var-begins-without-underscore %s :: Non standard variable '%s' doesn't start with an underscore file-in-non-standard-dir %s :: File (%s) exists in a non-standard directory. file-not-world-readable %s :: File (%s) does not have the world readable bit set. -file-referred-in-startdir :: File referenced in $startdir outside of $startdir/src or $startdir/pkg +file-referred-in-startdir :: File referenced in $startdir file-world-writable %s :: File (%s) has the world writable bit set. gnome-mime-file %s :: File (%s) is an auto-generated GNOME mime file hardlink-found %s points to %s :: Hard link (%s) found that points to %s @@ -56,13 +56,13 @@ perllocal-pod-present %s :: perllocal.pod found in %s. pkgname-in-description :: Description should not contain the package name. potential-non-fhs-info-page %s :: Potential non-FHS info page (%s) found. potential-non-fhs-man-page %s :: Potential non-FHS man page (%s) found. -recommend-use-pkgdir :: Recommend use of $pkgdir instead of $startdir/pkg -recommend-use-srcdir :: Recommend use of $srcdir instead of $startdir/src script-link-detected %s in %s :: Script link detected (%s) in file %s scrollkeeper-dir-exists %s :: Scrollkeeper directory exists (%s). Remember to not run scrollkeeper till post_{install,upgrade,remove}. specific-host-type-used %s :: Reference to one of %s should be changed to $CARCH specific-sourceforge-mirror :: Attempting to use specific sourceforge mirror, use downloads.sourceforge.net instead symlink-found %s points to %s :: Symlink (%s) found that points to %s too-many-md5sums %i needed :: Too Many md5sums: %i needed +use-pkgdir :: Use $pkgdir instead of $startdir/pkg +use-srcdir :: Use $srcdir instead of $startdir/src using-dl-sourceforge :: Attempting to use dl sourceforge domain, use downloads.sourceforge.net instead variable-not-array %s :: Variable %s is not an array. diff --git a/namcap.1 b/namcap.1 index f03186c..ea0a65a 100644 --- a/namcap.1 +++ b/namcap.1 @@ -77,7 +77,7 @@ files in /usr/share/icons/hicolor Verifies that a package does not contain the info directory file (/usr/share/info/dir) .TP .B invalidstartdir -Any PKGBUILDs that refer to files not stored in $startdir/pkg or $startdir/src are incorrect +Any PKGBUILDs that refer to files in $startdir are incorrect .TP .B libtool Warns if libtool (*.la) files are present -- 1.7.1
On Mon, Jun 7, 2010 at 10:18 PM, Allan McRae <allan@archlinux.org> wrote:
PKGBUILDs should always use $srcdir and $pkgdir and their locations are not guaranteed to be $startdir/src and $startdir/pkg respecitively.
Signed-off-by: Allan McRae <allan@archlinux.org>
Looks good to me.
--- Namcap/invalidstartdir.py | 6 +++--- namcap-tags | 6 +++--- namcap.1 | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/Namcap/invalidstartdir.py b/Namcap/invalidstartdir.py index 69a6969..052b380 100644 --- a/Namcap/invalidstartdir.py +++ b/Namcap/invalidstartdir.py @@ -23,7 +23,7 @@ class package: def short_name(self): return "invalidstartdir" def long_name(self): - return "Looks for anything that's not $startdir/pkg or $startdir/src" + return "Looks for references to $startdir" def prereq(self): return "" def analyze(self, pkginfo, tar): @@ -34,9 +34,9 @@ class package: if j[:4] != '/pkg' and j[:4] != '/src': ret[0].append(("file-referred-in-startdir", ())) elif j[:4] == '/pkg': - ret[2].append(("recommend-use-pkgdir", ())) + ret[0].append(("use-pkgdir", ())) elif j[:4] == '/src': - ret[2].append(("recommend-use-srcdir", ())) + ret[0].append(("use-srcdir", ())) return ret def type(self): return "pkgbuild" diff --git a/namcap-tags b/namcap-tags index c144f06..c4b1b3d 100644 --- a/namcap-tags +++ b/namcap-tags @@ -25,7 +25,7 @@ empty-directory %s :: Directory (%s) is empty extra-var-begins-without-underscore %s :: Non standard variable '%s' doesn't start with an underscore file-in-non-standard-dir %s :: File (%s) exists in a non-standard directory. file-not-world-readable %s :: File (%s) does not have the world readable bit set. -file-referred-in-startdir :: File referenced in $startdir outside of $startdir/src or $startdir/pkg +file-referred-in-startdir :: File referenced in $startdir file-world-writable %s :: File (%s) has the world writable bit set. gnome-mime-file %s :: File (%s) is an auto-generated GNOME mime file hardlink-found %s points to %s :: Hard link (%s) found that points to %s @@ -56,13 +56,13 @@ perllocal-pod-present %s :: perllocal.pod found in %s. pkgname-in-description :: Description should not contain the package name. potential-non-fhs-info-page %s :: Potential non-FHS info page (%s) found. potential-non-fhs-man-page %s :: Potential non-FHS man page (%s) found. -recommend-use-pkgdir :: Recommend use of $pkgdir instead of $startdir/pkg -recommend-use-srcdir :: Recommend use of $srcdir instead of $startdir/src script-link-detected %s in %s :: Script link detected (%s) in file %s scrollkeeper-dir-exists %s :: Scrollkeeper directory exists (%s). Remember to not run scrollkeeper till post_{install,upgrade,remove}. specific-host-type-used %s :: Reference to one of %s should be changed to $CARCH specific-sourceforge-mirror :: Attempting to use specific sourceforge mirror, use downloads.sourceforge.net instead symlink-found %s points to %s :: Symlink (%s) found that points to %s too-many-md5sums %i needed :: Too Many md5sums: %i needed +use-pkgdir :: Use $pkgdir instead of $startdir/pkg +use-srcdir :: Use $srcdir instead of $startdir/src using-dl-sourceforge :: Attempting to use dl sourceforge domain, use downloads.sourceforge.net instead variable-not-array %s :: Variable %s is not an array. diff --git a/namcap.1 b/namcap.1 index f03186c..ea0a65a 100644 --- a/namcap.1 +++ b/namcap.1 @@ -77,7 +77,7 @@ files in /usr/share/icons/hicolor Verifies that a package does not contain the info directory file (/usr/share/info/dir) .TP .B invalidstartdir -Any PKGBUILDs that refer to files not stored in $startdir/pkg or $startdir/src are incorrect +Any PKGBUILDs that refer to files in $startdir are incorrect .TP .B libtool Warns if libtool (*.la) files are present -- 1.7.1
On Tue, 8 Jun 2010 13:18:17 +1000, Allan McRae <allan@archlinux.org> wrote:
PKGBUILDs should always use $srcdir and $pkgdir and their locations are not guaranteed to be $startdir/src and $startdir/pkg respecitively.
Signed-off-by: Allan McRae <allan@archlinux.org>
When will $startdir be removed? I just checked: 1022 packages are affected. (not a big deal though as they can changed on rebuilds) But I have seen packages which modify the .install script during build. For example to set the current kernel version for depmod. How could this be handled then? Or are .install scripts are now available under srcdir? -- Pierre Schmitz, https://users.archlinux.de/~pierre
On 08/06/10 17:28, Pierre Schmitz wrote:
On Tue, 8 Jun 2010 13:18:17 +1000, Allan McRae<allan@archlinux.org> wrote:
PKGBUILDs should always use $srcdir and $pkgdir and their locations are not guaranteed to be $startdir/src and $startdir/pkg respecitively.
Signed-off-by: Allan McRae<allan@archlinux.org>
When will $startdir be removed? I just checked: 1022 packages are affected. (not a big deal though as they can changed on rebuilds)
But I have seen packages which modify the .install script during build. For example to set the current kernel version for depmod. How could this be handled then? Or are .install scripts are now available under srcdir?
$startdir will not be removed. The error printed for $startdir usage was always there so I did not change that. For install files, once 3.4 is released, you can put them in the source array without any issues and then adjust them in $srcdir. This patch was mainly to check for $startdir/pkg which will not be the same as $pkgdir from 3.5 onwards (i.e. two releases away). This is already true for split packages, but will become true for unsplit ones too. A lot of packages are affected but we have been telling people not to use $startdir/pkg for more that a year, maybe even two years... Allan
On Tue, 08 Jun 2010 17:43:47 +1000, Allan McRae <allan@archlinux.org> wrote:
$startdir will not be removed. The error printed for $startdir usage was always there so I did not change that. For install files, once 3.4 is released, you can put them in the source array without any issues and
then adjust them in $srcdir.
This patch was mainly to check for $startdir/pkg which will not be the same as $pkgdir from 3.5 onwards (i.e. two releases away). This is already true for split packages, but will become true for unsplit ones too. A lot of packages are affected but we have been telling people not to use $startdir/pkg for more that a year, maybe even two years...
No problem then. Maybe we could "sed" all $startdir/{pkg,src} usage in trunk for the remaining packages. This way startdir will be gone sooner or later. -- Pierre Schmitz, https://users.archlinux.de/~pierre
participants (3)
-
Allan McRae
-
Dan McGee
-
Pierre Schmitz